diff --git a/charts/codezero/templates/_helpers.tpl b/charts/codezero/templates/_helpers.tpl index ef0d3f0..36a594a 100644 --- a/charts/codezero/templates/_helpers.tpl +++ b/charts/codezero/templates/_helpers.tpl @@ -2,12 +2,7 @@ Expand the name of the chart. */}} {{- define "codezero.name" -}} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if hasSuffix .Values.codezero.name $name }} -{{- $name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" $name .Values.codezero.name | trunc 63 | trimSuffix "-" }} -{{- end }} +{{- .Values.nameOverride | default .Chart.Name | trunc 63 | trimSuffix "-" -}} {{- end }} {{/* @@ -16,22 +11,16 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this If release name contains chart name it will be used as a full name. */}} {{- define "codezero.fullname" -}} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if .Values.fullnameOverride }} -{{- $name = .Values.fullnameOverride }} -{{- else }} -{{- if contains $name .Release.Name }} -{{- $name = .Release.Name }} -{{- else }} -{{- $name = printf "%s-%s" .Release.Name $name }} -{{- end }} -{{- end }} -{{- if hasSuffix .Values.codezero.name $name }} -{{- $name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" $name .Values.codezero.name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- if contains .Values.nameOverride .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} {{/* Create chart name and version as used by the chart label. @@ -50,7 +39,7 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: codezero -{{- with .Values.codezero.labels }} +{{- with .Values.labels }} {{ . | toYaml }} {{- end }} {{- end }} @@ -60,7 +49,7 @@ Pod labels */}} {{- define "codezero.podLabels" -}} {{ include "codezero.labels" . }} -{{- with .Values.codezero.podLabels }} +{{- with .Values.podLabels }} {{ . | toYaml }} {{- end }} {{- end }} @@ -69,7 +58,7 @@ Pod labels Pod annotations */}} {{- define "codezero.podAnnotations" -}} -{{- with .Values.codezero.podAnnotations }} +{{- with .Values.podAnnotations }} {{ . | toYaml }} {{- end }} {{- end }} diff --git a/charts/codezero/templates/orchestrator/deployment.yaml b/charts/codezero/templates/orchestrator/deployment.yaml index 59ff96a..1a40d9e 100644 --- a/charts/codezero/templates/orchestrator/deployment.yaml +++ b/charts/codezero/templates/orchestrator/deployment.yaml @@ -23,7 +23,7 @@ spec: - name: {{ include "orchestrator.name" . }} securityContext: {{- toYaml .Values.orchestrator.securityContext | nindent 12 }} - image: "c6oio/orchestrator:{{ .Values.orchestrator.image.tag | default .Chart.AppVersion }}" + image: "c6oio/orchestrator:{{ .Values.orchestrator.image.tag | default .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.orchestrator.image.pullPolicy }} env: - name: CZ_SPACE_ID @@ -38,9 +38,9 @@ spec: value: /etc/ssl/certs/space/tls.pem - name: CZ_CLUSTER_CERT_KEY value: /etc/ssl/certs/space/tls.key - {{- if .Values.codezero.hub.url }} + {{- if .Values.hub.url }} - name: CZ_HUB_URL - value: {{ printf "%s/" .Values.codezero.hub.url }} + value: {{ printf "%s/" .Values.hub.url }} {{- end }} - name: CZ_PORT value: '8900' diff --git a/charts/codezero/templates/system/deployment.yaml b/charts/codezero/templates/system/deployment.yaml index 19ade42..fe27bf7 100644 --- a/charts/codezero/templates/system/deployment.yaml +++ b/charts/codezero/templates/system/deployment.yaml @@ -23,7 +23,7 @@ spec: - name: {{ include "system.name" . }} securityContext: {{- toYaml .Values.system.securityContext | nindent 12 }} - image: "c6oio/system:{{ .Values.system.image.tag | default .Chart.AppVersion }}" + image: "c6oio/system:{{ .Values.system.image.tag | default .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.system.image.pullPolicy }} env: - name: CZ_SPACE_CA_CERT @@ -32,9 +32,9 @@ spec: value: /etc/ssl/certs/space/tls.pem - name: CZ_CLUSTER_CERT_KEY value: /etc/ssl/certs/space/tls.key - {{- if .Values.codezero.hub.url }} + {{- if .Values.hub.url }} - name: CZ_HUB_URL - value: {{ .Values.codezero.hub.url }} + value: {{ .Values.hub.url }} {{- end }} - name: CZ_SPACE_ID valueFrom: @@ -47,7 +47,7 @@ spec: - name: CZ_PORT value: "8800" - name: CZ_ROUTER_IMAGE - value: "c6oio/router:{{ .Values.system.image.tag | default .Chart.AppVersion }}" + value: "c6oio/router:{{ .Values.system.image.tag | default .Values.image.tag | default .Chart.AppVersion }}" envFrom: - secretRef: name: {{ include "system.fullname" . }} diff --git a/charts/codezero/templates/system/secret.yaml b/charts/codezero/templates/system/secret.yaml index 74e9d9e..cc5be78 100644 --- a/charts/codezero/templates/system/secret.yaml +++ b/charts/codezero/templates/system/secret.yaml @@ -1,4 +1,4 @@ -{{- if eq .Values.codezero.space.token "" }} +{{- if eq .Values.space.token "" }} {{- fail "A Values.token is required" }} {{- end }} @@ -7,4 +7,4 @@ kind: Secret metadata: name: {{ include "system.fullname" . }} data: - CZ_HUB_SPACE_TOKEN: {{ .Values.codezero.space.token | b64enc }} + CZ_HUB_SPACE_TOKEN: {{ .Values.space.token | b64enc }} diff --git a/charts/codezero/values.yaml b/charts/codezero/values.yaml index cb016cf..485e0e4 100644 --- a/charts/codezero/values.yaml +++ b/charts/codezero/values.yaml @@ -5,21 +5,21 @@ nameOverride: "" fullnameOverride: "" -codezero: - name: codezero - hub: - url: https://api.codezero.io - space: - token: "" +image: + tag: pasley +hub: + url: https://api.codezero.io +space: + token: "" - podAnnotations: { } - labels: { } - podLabels: { } +podAnnotations: { } +labels: { } +podLabels: { } system: name: system image: - tag: pasley + tag: "" pullPolicy: Always replicaCount: 1 @@ -43,7 +43,7 @@ system: orchestrator: name: orchestrator image: - tag: pasley + tag: "" pullPolicy: Always replicaCount: 1