diff --git a/charts/steadybit-platform/Chart.yaml b/charts/steadybit-platform/Chart.yaml index 3409c90..192498b 100644 --- a/charts/steadybit-platform/Chart.yaml +++ b/charts/steadybit-platform/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: steadybit-platform description: steadybit Platform Helm chart for Kubernetes. -version: 1.0.106 +version: 1.1.0 appVersion: 2.1.26 home: https://www.steadybit.com/ icon: https://steadybit-website-assets.s3.amazonaws.com/logo-symbol-transparent.png diff --git a/charts/steadybit-platform/templates/NOTES.txt b/charts/steadybit-platform/templates/NOTES.txt index 748f8ac..fe97c22 100644 --- a/charts/steadybit-platform/templates/NOTES.txt +++ b/charts/steadybit-platform/templates/NOTES.txt @@ -1,8 +1,8 @@ {{- if not .Values.platform.tenant.agentKey -}} -################################################################################## -#### ERROR: You did not specify your secret agent key (platform.tenant.agentKey). #### -################################################################################## +############################################################################## +#### ERROR: You did not specify your secret agent key. #### +############################################################################## {{- else -}} diff --git a/charts/steadybit-platform/templates/_helpers.tpl b/charts/steadybit-platform/templates/_helpers.tpl index 4224457..30468f7 100644 --- a/charts/steadybit-platform/templates/_helpers.tpl +++ b/charts/steadybit-platform/templates/_helpers.tpl @@ -130,4 +130,15 @@ returns either the url or the data-url for an image {{- else if .data -}} {{- printf "data:%s;base64,%s" .mediaType (.data | b64enc) -}} {{- end -}} +{{- end -}} + +{{/* +returns the image tag for the platform container and validates wether a license is provided +*/}} +{{- define "validContainerImageTag" -}} +{{- $version := default .Values.image.tag | default .Chart.AppVersion -}} +{{- if and (semverCompare ">=2.2.0-0" $version) (not .Values.platform.tenant.license) -}} +{{- fail ".Values.platform.license missing. A license is required to run steadybit platform >= 2.2.0" -}} +{{- end -}} +{{- $version -}} {{- end -}} \ No newline at end of file diff --git a/charts/steadybit-platform/templates/deployment.yaml b/charts/steadybit-platform/templates/deployment.yaml index 28a8ef0..d0047bc 100644 --- a/charts/steadybit-platform/templates/deployment.yaml +++ b/charts/steadybit-platform/templates/deployment.yaml @@ -48,7 +48,7 @@ spec: {{- if .Values.platform.database.migration.useInitContainer }} initContainers: - name: {{ include "steadybit-platform.name" . }}-db-migration - image: "{{ .Values.image.name }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + image: "{{ .Values.image.name }}:{{ template "validContainerImageTag" . }}" imagePullPolicy: {{ .Values.image.pullPolicy }} resources: requests: @@ -99,7 +99,7 @@ spec: {{- end }} containers: - name: {{ include "steadybit-platform.name" . }} - image: "{{ .Values.image.name }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + image: "{{ .Values.image.name }}:{{ template "validContainerImageTag" . }}" imagePullPolicy: {{ .Values.image.pullPolicy }} lifecycle: {{ .Values.platform.lifecycle | toYaml | nindent 12 }} resources: diff --git a/charts/steadybit-platform/tests/__snapshot__/deployment_test.yaml.snap b/charts/steadybit-platform/tests/__snapshot__/deployment_test.yaml.snap index 71e565f..a53ee2f 100644 --- a/charts/steadybit-platform/tests/__snapshot__/deployment_test.yaml.snap +++ b/charts/steadybit-platform/tests/__snapshot__/deployment_test.yaml.snap @@ -1366,3 +1366,137 @@ manifest should support various variables: imagePullSecrets: - name: RELEASE-NAME-steadybit-platform-pull-secrets serviceAccountName: RELEASE-NAME-steadybit-platform +should not fail with missing license for version >= 2.2.0: + 1: | + apiVersion: apps/v1 + kind: Deployment + metadata: + labels: + app.kubernetes.io/instance: RELEASE-NAME + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: steadybit-platform + app.kubernetes.io/version: 0.0.0 + helm.sh/chart: steadybit-platform-0.0.0 + name: RELEASE-NAME-steadybit-platform + namespace: NAMESPACE + spec: + minReadySeconds: 60 + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/instance: RELEASE-NAME + app.kubernetes.io/name: steadybit-platform + strategy: + type: Recreate + template: + metadata: + annotations: + prometheus.io/path: /actuator/prometheus + prometheus.io/port: "9090" + prometheus.io/scrape: "true" + labels: + app.kubernetes.io/instance: RELEASE-NAME + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: steadybit-platform + app.kubernetes.io/version: 0.0.0 + helm.sh/chart: steadybit-platform-0.0.0 + spec: + containers: + - env: + - name: STEADYBIT_EXPERIMENT_EXECUTION_SHUTDOWN_CHECK_INTERVAL + value: 10s + - name: LOGGING_FORMAT + value: text + - name: INSTANCE_GROUP + valueFrom: + fieldRef: + fieldPath: metadata.labels['pod-template-hash'] + - name: STEADYBIT_TENANT_MODE + value: ONPREM + - name: STEADYBIT_TENANT_AGENTKEY + valueFrom: + secretKeyRef: + key: key + name: RELEASE-NAME-steadybit-platform + - name: STEADYBIT_TENANT_KEY + value: onprem + - name: STEADYBIT_TENANT_NAME + value: onprem + - name: STEADYBIT_TENANT_LICENSE + valueFrom: + secretKeyRef: + key: license + name: RELEASE-NAME-steadybit-platform-license + - name: STEADYBIT_WEB_PUBLIC_EXPERIMENT_PORT + value: "80" + - name: SPRING_DATASOURCE_USERNAME + value: steadybit + - name: SPRING_DATASOURCE_URL + value: jdbc:postgresql://RELEASE-NAME-postgresql:5432/steadybit + - name: SPRING_DATASOURCE_PASSWORD + valueFrom: + secretKeyRef: + key: password + name: RELEASE-NAME-postgresql + - name: STEADYBIT_AUTH_PROVIDER + value: static + - name: STEADYBIT_AUTH_STATIC_0_USERNAME + value: admin + - name: STEADYBIT_AUTH_STATIC_0_PASSWORD + value: '{noop}admin' + envFrom: [] + image: docker.steadybit.io/steadybit/platform:2.2.0 + imagePullPolicy: Always + lifecycle: + preStop: + exec: + command: + - /bin/sh + - -c + - sleep 20 + livenessProbe: + failureThreshold: 5 + httpGet: + path: /api/health/liveness + port: ui-port + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + name: steadybit-platform + ports: + - containerPort: 8080 + name: ui-port + protocol: TCP + - containerPort: 7878 + name: websocket-port + protocol: TCP + readinessProbe: + failureThreshold: 3 + httpGet: + path: /api/health/readiness + port: ui-port + initialDelaySeconds: 10 + periodSeconds: 5 + successThreshold: 1 + timeoutSeconds: 5 + resources: + limits: + cpu: 4000m + memory: 4Gi + requests: + cpu: 2000m + memory: 2Gi + startupProbe: + failureThreshold: 200 + httpGet: + path: /api/health/liveness + port: ui-port + initialDelaySeconds: 60 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + volumeMounts: null + imagePullSecrets: + - name: RELEASE-NAME-steadybit-platform-pull-secrets + serviceAccountName: RELEASE-NAME-steadybit-platform diff --git a/charts/steadybit-platform/tests/deployment_test.yaml b/charts/steadybit-platform/tests/deployment_test.yaml index be8491c..eac5771 100644 --- a/charts/steadybit-platform/tests/deployment_test.yaml +++ b/charts/steadybit-platform/tests/deployment_test.yaml @@ -92,5 +92,21 @@ tests: loadingScreen: data: mediaType: image/svg+xml + asserts: + - matchSnapshot: {} + - it: should fail with missing license for version >= 2.2.0 + set: + image: + tag: 2.2.0 + asserts: + - failedTemplate: + errorMessage: .Values.platform.license missing. A license is required to run steadybit platform >= 2.2.0 + - it: should not fail with missing license for version >= 2.2.0 + set: + image: + tag: 2.2.0 + platform: + tenant: + license: "test" asserts: - matchSnapshot: {} \ No newline at end of file diff --git a/charts/steadybit-platform/values.yaml b/charts/steadybit-platform/values.yaml index ed4b553..a5b1159 100644 --- a/charts/steadybit-platform/values.yaml +++ b/charts/steadybit-platform/values.yaml @@ -10,8 +10,9 @@ platform: key: onprem # platform.tenant.name -- Key for the tenant assigned to you. name: onprem - # -- The secret token which your agent uses to authenticate to steadybit's servers. Get it from https://platform.steadybit.io/settings/agents/setup. + # platform.tenant.agentKey -- The secret token which your agent uses to authenticate to steadybit's servers. Get it from https://platform.steadybit.io/settings/agents/setup. agentKey: null + # platform.tenant.license -- The license to run the platform. This is mandatory for platform >= 2.2.0 license: null agent: auth: