diff --git a/charts/hawkbit/Chart.yaml b/charts/hawkbit/Chart.yaml index f2bfa03f..117610f1 100644 --- a/charts/hawkbit/Chart.yaml +++ b/charts/hawkbit/Chart.yaml @@ -10,8 +10,8 @@ # SPDX-License-Identifier: EPL-2.0 --- apiVersion: v2 -version: 1.7.0 -appVersion: "0.5.0-mysql" +version: 2.0.0 +appVersion: "0.8.0" description: | Eclipse hawkBit™ is a domain independent back-end framework for rolling out software updates to constrained edge devices as well as more powerful controllers and gateways connected to diff --git a/charts/hawkbit/templates/_helpers.tpl b/charts/hawkbit/templates/_helpers.tpl index a097f0e4..9a1dff73 100644 --- a/charts/hawkbit/templates/_helpers.tpl +++ b/charts/hawkbit/templates/_helpers.tpl @@ -54,3 +54,14 @@ Return the appropriate apiVersion for ingress. {{- print "networking.k8s.io/v1beta1" -}} {{- end -}} {{- end -}} + +{{- define "hawkbit.ingressDefaultPaths" -}} +- path: "/rest" + service: {{ include "hawkbit.fullname" . }} +- path: "/swagger-ui" + service: {{ include "hawkbit.fullname" . }} +- path: "/v3" + service: {{ include "hawkbit.fullname" . }} +- path: "/" + service: {{ include "hawkbit.fullname" . }}-simple-ui +{{- end -}} \ No newline at end of file diff --git a/charts/hawkbit/templates/deployment-simple-ui.yaml b/charts/hawkbit/templates/deployment-simple-ui.yaml new file mode 100644 index 00000000..d32b69f2 --- /dev/null +++ b/charts/hawkbit/templates/deployment-simple-ui.yaml @@ -0,0 +1,82 @@ +{{- $hawkbit_service_name := include "hawkbit.fullname" . -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ include "hawkbit.fullname" . }}-simple-ui" + labels: + app.kubernetes.io/name: "{{ include "hawkbit.name" . }}-simple-ui" +spec: + replicas: {{ .Values.serviceSimpleUI.replicaCount }} + strategy: + {{- with .Values.serviceSimpleUI.updateStrategy }} + {{- toYaml . | nindent 4 }} + {{- end }} + selector: + matchLabels: + app.kubernetes.io/name: "{{ include "hawkbit.name" . }}-simple-ui" + app.kubernetes.io/instance: {{ .Release.Name }} + template: + metadata: + labels: + app.kubernetes.io/name: "{{ include "hawkbit.name" . }}-simple-ui" + app.kubernetes.io/instance: {{ .Release.Name }} + annotations: + checksum/config: {{ include (print .Template.BasePath "/secrets.yaml") . | sha256sum }} + {{- with .Values.podTemplate.annotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.simpleUIImage.pullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: "{{ .Chart.Name }}-simple-ui" + image: "{{ .Values.simpleUIImage.repository }}:{{ .Values.simpleUIImage.tag }}" + imagePullPolicy: {{ .Values.simpleUIImage.pullPolicy }} + env: + - name: HAWKBIT_SERVER_MGMTURL + value: {{ .Values.envSimpleUI.hawkbitServerMgmtUrl | default (printf "http://%s:%v" $hawkbit_service_name $.Values.service.port ) }} + - name: "SPRING_APPLICATION_JSON" + valueFrom: + secretKeyRef: + name: {{ include "hawkbit.fullname" . }} + key: SIMPLE_UI_SPRING_APPLICATION_JSON + ports: + - name: http + containerPort: 8088 + protocol: TCP + livenessProbe: + httpGet: + path: /login + port: http + initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} + timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} + readinessProbe: + httpGet: + path: /login + port: http + initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} + timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} + resources: +{{ toYaml .Values.serviceSimpleUI.resources | indent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- if .Values.securityContext.enabled }} + securityContext: + fsGroup: {{ .Values.securityContext.fsGroup }} + runAsUser: {{ .Values.securityContext.runAsUser }} + {{- if .Values.securityContext.extra }} + {{- toYaml .Values.securityContext.extra | nindent 8 }} + {{- end }} + {{- end }} diff --git a/charts/hawkbit/templates/deployment.yaml b/charts/hawkbit/templates/deployment.yaml index 614581af..c6db6f5e 100644 --- a/charts/hawkbit/templates/deployment.yaml +++ b/charts/hawkbit/templates/deployment.yaml @@ -7,7 +7,7 @@ metadata: spec: replicas: {{ .Values.replicaCount }} strategy: - {{- with .Values.updateStrategy }} + {{- with .Values.service.updateStrategy }} {{- toYaml . | nindent 4 }} {{- end }} selector: @@ -34,7 +34,7 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} env: - - name: SPRING_PROFILES_ACTIVE + - name: PROFILES value: "{{ .Values.spring.profiles }}" - name: "SPRING_DATASOURCE_URL" {{- if .Values.env.springDatasourceUrl }} diff --git a/charts/hawkbit/templates/ingress.yaml b/charts/hawkbit/templates/ingress.yaml index d024cc1c..1aebed76 100644 --- a/charts/hawkbit/templates/ingress.yaml +++ b/charts/hawkbit/templates/ingress.yaml @@ -1,4 +1,5 @@ {{- if .Values.ingress.enabled -}} +{{- $ingressDefaultPaths := (include "hawkbit.ingressDefaultPaths" $ | fromYamlArray ) }} {{- $apiVersion := include "hawkbit.ingressAPIVersion" . -}} {{- $fullName := include "hawkbit.fullname" . -}} apiVersion: {{ $apiVersion }} @@ -30,18 +31,18 @@ spec: - host: {{ .host | quote }} http: paths: - {{- range .paths }} - - path: {{ . }} + {{- range default .paths $ingressDefaultPaths }} + - path: {{ .path }} {{- if eq $apiVersion "networking.k8s.io/v1" }} pathType: Prefix backend: service: - name: {{ $fullName }} + name: {{ .service }} port: name: http {{- else }} backend: - serviceName: {{ $fullName }} + serviceName: {{ .service }} servicePort: http {{- end }} {{- end }} diff --git a/charts/hawkbit/templates/secrets.yaml b/charts/hawkbit/templates/secrets.yaml index 2def1c4a..8fc7b54b 100644 --- a/charts/hawkbit/templates/secrets.yaml +++ b/charts/hawkbit/templates/secrets.yaml @@ -7,6 +7,7 @@ metadata: type: Opaque data: SPRING_APPLICATION_JSON: {{ .Values.config.secrets | toJson | b64enc }} + SIMPLE_UI_SPRING_APPLICATION_JSON: {{ .Values.config.simpleUI | toJson | b64enc }} --- apiVersion: v1 kind: Secret diff --git a/charts/hawkbit/templates/servicesimpleui.yaml b/charts/hawkbit/templates/servicesimpleui.yaml new file mode 100644 index 00000000..c4f20a1b --- /dev/null +++ b/charts/hawkbit/templates/servicesimpleui.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: Service +metadata: + name: "{{ include "hawkbit.fullname" . }}-simple-ui" + labels: + app.kubernetes.io/name: "{{ include "hawkbit.name" . }}-simple-ui" + app.kubernetes.io/instance: {{ .Release.Name }} + {{- with .Values.serviceSimpleUI.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + type: {{ .Values.serviceSimpleUI.type }} + ports: + - port: {{ .Values.serviceSimpleUI.port }} + targetPort: http + protocol: TCP + name: http + selector: + app.kubernetes.io/name: "{{ include "hawkbit.name" . }}-simple-ui" + app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/charts/hawkbit/values.yaml b/charts/hawkbit/values.yaml index 44a4c17b..645de2ef 100644 --- a/charts/hawkbit/values.yaml +++ b/charts/hawkbit/values.yaml @@ -15,10 +15,14 @@ image: repository: "hawkbit/hawkbit-update-server" - tag: 0.5.0-mysql + tag: "0.8.0" + pullPolicy: IfNotPresent + +simpleUIImage: + repository: "hawkbit/hawkbit-simple-ui" + tag: "0.8.0" pullPolicy: IfNotPresent -replicaCount: 1 ## podDisruptionBudget configuration podDisruptionBudget: @@ -34,27 +38,38 @@ securityContext: runAsUser: 65534 extra: {} -## strategy used to replace old Pods by new ones -## ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy -updateStrategy: - ## default is re-create, because of possible database migrations - type: Recreate nameOverride: "" fullnameOverride: "" service: type: ClusterIP - port: 80 + port: 8080 annotations: {} + replicaCount: 1 + ## strategy used to replace old Pods by new ones + ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy + updateStrategy: + ## default is re-create, because of possible database migrations + type: Recreate # traefik.ingress.kubernetes.io/affinity: "true" +serviceSimpleUI: + type: ClusterIP + port: 8088 + annotations: {} + replicaCount: 1 + updateStrategy: + type: RollingUpdate + resources: {} + livenessProbe: initialDelaySeconds: 240 timeoutSeconds: 5 readinessProbe: - initialDelaySeconds: 120 + failureThreshold: 24 timeoutSeconds: 5 + periodSeconds: 5 ingress: enabled: false @@ -64,7 +79,16 @@ ingress: # kubernetes.io/tls-acme: "true" hosts: - host: hawkbit.local - paths: [] + paths: + # default value: + # - path: "/rest" + # service: {{ include "hawkbit.fullname" . }} + # - path: "/swagger-ui" + # service: {{ include "hawkbit.fullname" . }} + # - path: "/v3" + # service: {{ include "hawkbit.fullname" . }} + #² - path: "/" + # service: {{ include "hawkbit.fullname" . }}-simple-ui tls: [] # - secretName: hawkbit-tls # hosts: @@ -90,6 +114,9 @@ env: springRabbitmqUsername: "hawkbit" springRabbitmqPassword: "hawkbit" +envSimpleUI: + hawkbitServerMgmtUrl: "" + # optional env vars extraEnv: {} # JAVA_TOOL_OPTIONS: "-Xms1024m -Xmx1024m" @@ -170,6 +197,7 @@ config: datasource: username: hawkbit password: hawkbit + simpleUI: {} ## dependency charts config