diff --git a/deploy/api-service/templates/_helpers.tpl b/deploy/api-service/templates/_helpers.tpl index 705c63a..2914529 100644 --- a/deploy/api-service/templates/_helpers.tpl +++ b/deploy/api-service/templates/_helpers.tpl @@ -21,6 +21,9 @@ helm.sh/chart: {{ include "api-service.chart" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} +{{- with .Values.global.labels }} +{{ toYaml . }} +{{- end }} {{- end }} {{/* diff --git a/deploy/api-service/templates/deployment.yaml b/deploy/api-service/templates/deployment.yaml index 4d00ad0..94ebd53 100644 --- a/deploy/api-service/templates/deployment.yaml +++ b/deploy/api-service/templates/deployment.yaml @@ -33,7 +33,7 @@ spec: securityContext: {{ toYaml .Values.securityContext | nindent 12 }} image: {{ .Values.image }} - imagePullPolicy: IfNotPresent + imagePullPolicy: {{ .Values.imagePullPolicy }} args: - --backend-addr - {{ include "api-service.backendAddr" . }} @@ -64,7 +64,10 @@ spec: affinity: {{ toYaml . | nindent 8 }} {{ end }} - {{ with .Values.tolerations }} + {{ with .Values.global.tolerations }} tolerations: {{ toYaml . | nindent 8 }} {{ end }} + {{ with .Values.global.dns }} + {{ toYaml . | nindent 6 }} + {{ end }} diff --git a/deploy/api-service/templates/service.yaml b/deploy/api-service/templates/service.yaml index 8d525bf..0ac95cb 100644 --- a/deploy/api-service/templates/service.yaml +++ b/deploy/api-service/templates/service.yaml @@ -7,7 +7,9 @@ metadata: {{ include "api-service.labels" . | nindent 4 }} spec: type: {{ .Values.service.type }} - #clusterIP: None + {{ if .Values.service.clusterIP }} + clusterIP: {{ .Values.service.clusterIP }} + {{ end }} ports: - port: {{ .Values.service.port }} targetPort: http diff --git a/deploy/controller/templates/_helpers.tpl b/deploy/controller/templates/_helpers.tpl index e2fbc39..cda2616 100644 --- a/deploy/controller/templates/_helpers.tpl +++ b/deploy/controller/templates/_helpers.tpl @@ -21,6 +21,9 @@ helm.sh/chart: {{ include "controller.chart" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} +{{- with .Values.global.labels }} +{{ toYaml . }} +{{- end }} {{- end }} {{/* diff --git a/deploy/controller/templates/deployment.yaml b/deploy/controller/templates/deployment.yaml index cabde71..d63e615 100644 --- a/deploy/controller/templates/deployment.yaml +++ b/deploy/controller/templates/deployment.yaml @@ -33,7 +33,7 @@ spec: securityContext: {{ toYaml .Values.securityContext | nindent 12 }} image: {{ .Values.image }} - imagePullPolicy: IfNotPresent + imagePullPolicy: {{ .Values.imagePullPolicy }} {{- if .Values.command }} command: {{- toYaml .Values.command | nindent 12 }} @@ -82,7 +82,10 @@ spec: affinity: {{ toYaml . | nindent 8 }} {{ end }} - {{ with .Values.tolerations }} + {{ with .Values.global.tolerations }} tolerations: {{ toYaml . | nindent 8 }} {{ end }} + {{ with .Values.global.dns }} + {{ toYaml . | nindent 6 }} + {{ end }} diff --git a/rolebinding.yaml b/deploy/controller/templates/rolebinding.yaml similarity index 100% rename from rolebinding.yaml rename to deploy/controller/templates/rolebinding.yaml diff --git a/deploy/controller/templates/service.yaml b/deploy/controller/templates/service.yaml index 6753694..9b0393a 100644 --- a/deploy/controller/templates/service.yaml +++ b/deploy/controller/templates/service.yaml @@ -7,7 +7,9 @@ metadata: {{ include "controller.labels" . | nindent 4 }} spec: type: {{ .Values.service.type }} - #clusterIP: None + {{ if .Values.service.clusterIP }} + clusterIP: {{ .Values.service.clusterIP }} + {{ end }} ports: - port: {{ .Values.service.port }} targetPort: http diff --git a/deploy/envhub/templates/_helpers.tpl b/deploy/envhub/templates/_helpers.tpl index b13cb7b..26d6dfd 100644 --- a/deploy/envhub/templates/_helpers.tpl +++ b/deploy/envhub/templates/_helpers.tpl @@ -21,6 +21,9 @@ helm.sh/chart: {{ include "envhub.chart" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} +{{- with .Values.global.labels }} +{{ toYaml . }} +{{- end }} {{- end }} {{/* @@ -29,3 +32,11 @@ Selector labels {{- define "envhub.selectorLabels" -}} app.kubernetes.io/name: {{ .Values.name }} {{- end }} + +{{- define "envhub.redisAddr" -}} + {{ if .Values.redisAddr }} + {{- .Values.redisAddr -}} + {{ else }} + {{- printf "redis.%s.svc.cluster.local:6379" .Values.metadata.namespace -}} + {{ end }} +{{ end }} diff --git a/deploy/envhub/templates/deployment.yaml b/deploy/envhub/templates/deployment.yaml index 490078b..42a7ffc 100644 --- a/deploy/envhub/templates/deployment.yaml +++ b/deploy/envhub/templates/deployment.yaml @@ -33,7 +33,7 @@ spec: securityContext: {{ toYaml .Values.securityContext | nindent 12 }} image: {{ .Values.image }} - imagePullPolicy: IfNotPresent + imagePullPolicy: {{.Values.imagePullPolicy }} env: - name: ACI_ACCESS valueFrom: @@ -72,7 +72,7 @@ spec: - --storage-backend - redis - --redis-addr - - redis.aenv.svc.cluster.local:6379 + - {{ include "envhub.redisAddr" . }} - --redis-key-prefix - env - --port @@ -104,7 +104,10 @@ spec: affinity: {{ toYaml . | nindent 8 }} {{ end }} - {{ with .Values.tolerations }} + {{ with .Values.global.tolerations }} tolerations: {{ toYaml . | nindent 8 }} {{ end }} + {{ with .Values.global.dns }} + {{ toYaml . | nindent 6 }} + {{ end }} diff --git a/deploy/envhub/templates/service.yaml b/deploy/envhub/templates/service.yaml index 86b4c59..92db4e1 100644 --- a/deploy/envhub/templates/service.yaml +++ b/deploy/envhub/templates/service.yaml @@ -7,7 +7,9 @@ metadata: {{ include "envhub.labels" . | nindent 4 }} spec: type: {{ .Values.service.type }} - #clusterIP: None + {{ if .Values.service.clusterIP }} + clusterIP: {{ .Values.service.clusterIP }} + {{ end }} ports: - port: {{ .Values.service.port }} targetPort: http diff --git a/deploy/redis/templates/_helpers.tpl b/deploy/redis/templates/_helpers.tpl index 14632e0..18bc387 100644 --- a/deploy/redis/templates/_helpers.tpl +++ b/deploy/redis/templates/_helpers.tpl @@ -14,6 +14,9 @@ helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} app.kubernetes.io/name: {{ include "redis.name" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- with .Values.global.labels }} +{{ toYaml . }} +{{- end }} {{- end }} {{- define "redis.selectorLabels" -}} diff --git a/deploy/redis/templates/deployment.yaml b/deploy/redis/templates/deployment.yaml index cbacd5a..81e3d6c 100644 --- a/deploy/redis/templates/deployment.yaml +++ b/deploy/redis/templates/deployment.yaml @@ -21,8 +21,8 @@ spec: {{- end }} containers: - name: {{ include "redis.name" . }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + image: "{{ .Values.image }}" + imagePullPolicy: {{ .Values.imagePullPolicy }} ports: - name: redis containerPort: 6379 @@ -58,13 +58,16 @@ spec: affinity: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} {{- if .Values.persistence.enabled }} volumes: - name: redis-data persistentVolumeClaim: claimName: {{ include "redis.fullname" . }} {{- end }} + {{ with .Values.global.tolerations }} + tolerations: + {{ toYaml . | nindent 8 }} + {{ end }} + {{ with .Values.global.dns }} + {{ toYaml . | nindent 6 }} + {{ end }} diff --git a/deploy/redis/templates/service.yaml b/deploy/redis/templates/service.yaml index 29b2475..b20ad1a 100644 --- a/deploy/redis/templates/service.yaml +++ b/deploy/redis/templates/service.yaml @@ -7,6 +7,9 @@ metadata: {{- include "redis.labels" . | nindent 4 }} spec: type: {{ .Values.service.type }} + {{ if .Values.service.clusterIP }} + clusterIP: {{ .Values.service.clusterIP }} + {{ end }} ports: - port: {{ .Values.service.port }} targetPort: redis diff --git a/deploy/values.yaml b/deploy/values.yaml index 479ffcf..7ec58aa 100644 --- a/deploy/values.yaml +++ b/deploy/values.yaml @@ -17,6 +17,7 @@ controller: namespace: create: true image: aenvironment/controller:0.1.0 + imagePullPolicy: IfNotPresent service: type: LoadBalancer port: 8080 @@ -39,16 +40,20 @@ redis: namespace: aenv namespace: create: false - image: - repository: redis - tag: "7.2.4" + image: redis:7.2.4 + imagePullPolicy: IfNotPresent + service: + type: LoadBalancer + port: 6379 resources: limits: cpu: "1" memory: "2Gi" + ephemeral-storage: 10Gi requests: cpu: "0.5" memory: "1Gi" + ephemeral-storage: 10Gi configmap: enabled: false clusterEnabled: "no" @@ -65,6 +70,7 @@ envhub: namespace: create: false image: aenvironment/envhub:0.1.0 + imagePullPolicy: IfNotPresent service: type: LoadBalancer port: 8083 @@ -89,6 +95,7 @@ api-service: namespace: create: false image: aenvironment/api-service:0.1.0 + imagePullPolicy: IfNotPresent service: type: LoadBalancer port: 8080