From 22a2a1d0cdcc3585140836c42348fa38750babf8 Mon Sep 17 00:00:00 2001 From: Sabari Kumar Murugesan Date: Thu, 5 Jul 2018 17:22:15 -0700 Subject: [PATCH] Helm chart enhancements * Adds a nginx class option. This can be used to target a different ingress controller in a deployment. * Fixes an issue where the resources specified for an individual sub-chart didn't take precedence over the global resources * Switch to upstream Kafka Helm chart repo --- .../api-manager/templates/deployment.yaml | 2 +- .../templates/deployment.yaml | 2 +- .../echo-server/templates/deployment.yaml | 2 +- .../event-manager/templates/deployment.yaml | 2 +- .../function-manager/templates/deployment.yaml | 4 ++-- .../charts/function-manager/values.yaml | 8 ++++++++ .../identity-manager/templates/deployment.yaml | 4 ++-- .../templates/ingress.noauth.yaml | 1 + .../image-manager/templates/deployment.yaml | 4 ++-- .../dispatch/charts/image-manager/values.yaml | 18 +++++++++++++----- .../secret-store/templates/deployment.yaml | 2 +- .../service-manager/templates/deployment.yaml | 2 +- charts/dispatch/templates/_helpers.tpl | 2 +- charts/dispatch/values.yaml | 3 ++- pkg/dispatchcli/cmd/install_config.go | 3 +-- 15 files changed, 38 insertions(+), 21 deletions(-) diff --git a/charts/dispatch/charts/api-manager/templates/deployment.yaml b/charts/dispatch/charts/api-manager/templates/deployment.yaml index 47a93c257..8b690a009 100644 --- a/charts/dispatch/charts/api-manager/templates/deployment.yaml +++ b/charts/dispatch/charts/api-manager/templates/deployment.yaml @@ -76,7 +76,7 @@ spec: - name: DOCKER_API_VERSION value: "1.24" resources: -{{ toYaml .Values.resources | default .Values.global.resources | indent 12 }} +{{ .Values.resources | default .Values.global.resources | toYaml | indent 12 }} volumes: - name: {{ template "fullname" . }} emptyDir: {} diff --git a/charts/dispatch/charts/application-manager/templates/deployment.yaml b/charts/dispatch/charts/application-manager/templates/deployment.yaml index 8d1d6f3cc..8a4641ca6 100644 --- a/charts/dispatch/charts/application-manager/templates/deployment.yaml +++ b/charts/dispatch/charts/application-manager/templates/deployment.yaml @@ -72,7 +72,7 @@ spec: - name: DOCKER_API_VERSION value: "1.24" resources: -{{ toYaml .Values.resources | default .Values.global.resources | indent 12 }} +{{ .Values.resources | default .Values.global.resources | toYaml | indent 12 }} volumes: - name: {{ template "fullname" . }} emptyDir: {} diff --git a/charts/dispatch/charts/echo-server/templates/deployment.yaml b/charts/dispatch/charts/echo-server/templates/deployment.yaml index 23c918ef9..135c91ca9 100644 --- a/charts/dispatch/charts/echo-server/templates/deployment.yaml +++ b/charts/dispatch/charts/echo-server/templates/deployment.yaml @@ -53,7 +53,7 @@ spec: path: / port: {{ .Values.service.internalPort }} resources: -{{ toYaml .Values.resources | default .Values.global.resources | indent 12 }} +{{ .Values.resources | default .Values.global.resources | toYaml | indent 12 }} {{- if .Values.nodeSelector }} nodeSelector: {{ toYaml .Values.nodeSelector | indent 8 }} diff --git a/charts/dispatch/charts/event-manager/templates/deployment.yaml b/charts/dispatch/charts/event-manager/templates/deployment.yaml index c631b35e7..92403523a 100644 --- a/charts/dispatch/charts/event-manager/templates/deployment.yaml +++ b/charts/dispatch/charts/event-manager/templates/deployment.yaml @@ -83,7 +83,7 @@ spec: name: tls readOnly: true resources: -{{ toYaml .Values.resources | default .Values.global.resources | indent 12 }} +{{ .Values.resources | default .Values.global.resources | toYaml | indent 12 }} volumes: - name: {{ template "fullname" . }} {{- if default .Values.global.data.persist .Values.data.persist }} diff --git a/charts/dispatch/charts/function-manager/templates/deployment.yaml b/charts/dispatch/charts/function-manager/templates/deployment.yaml index 2391838c6..baf1349f6 100644 --- a/charts/dispatch/charts/function-manager/templates/deployment.yaml +++ b/charts/dispatch/charts/function-manager/templates/deployment.yaml @@ -81,7 +81,7 @@ spec: - name: DOCKER_HOST value: "tcp://localhost:2375" resources: -{{ toYaml .Values.resources | default .Values.global.resources | indent 12 }} +{{ .Values.resources | default .Values.global.resources | toYaml | indent 12 }} - name: {{ .Chart.Name }}-docker image: docker:dind imagePullPolicy: {{ default .Values.global.pullPolicy .Values.image.pullPolicy }} @@ -95,7 +95,7 @@ spec: - name: docker-graph-storage mountPath: /var/lib/docker resources: -{{ toYaml .Values.resources | default .Values.global.resources | indent 12 }} +{{ .Values.dindResources | default .Values.global.resources | toYaml | indent 12 }} volumes: - name: {{ template "fullname" . }} {{- if default .Values.global.data.persist .Values.data.persist }} diff --git a/charts/dispatch/charts/function-manager/values.yaml b/charts/dispatch/charts/function-manager/values.yaml index 4ec6104d7..161b21fad 100644 --- a/charts/dispatch/charts/function-manager/values.yaml +++ b/charts/dispatch/charts/function-manager/values.yaml @@ -37,6 +37,14 @@ resources: {} #requests: # cpu: 100m # memory: 128Mi +# Resources to allocate for Docker-in-Docker container within the function-manager pod +dindResources: {} +# limits: + # cpu: 500m + # memory: 2Gi + #requests: + # cpu: 250m + # memory: 512Mi faas: selected: openfaas templates: /images/function-manager/templates diff --git a/charts/dispatch/charts/identity-manager/templates/deployment.yaml b/charts/dispatch/charts/identity-manager/templates/deployment.yaml index 094855de7..7557ade89 100644 --- a/charts/dispatch/charts/identity-manager/templates/deployment.yaml +++ b/charts/dispatch/charts/identity-manager/templates/deployment.yaml @@ -74,7 +74,7 @@ spec: initialDelaySeconds: 10 periodSeconds: 3 resources: -{{ toYaml .Values.resources | default .Values.global.resources | indent 12 }} +{{ .Values.resources | default .Values.global.resources | toYaml | indent 12 }} - name: oauth2-proxy image: {{ .Values.oauth2proxy.image }} imagePullPolicy: {{ default .Values.global.pullPolicy .Values.image.pullPolicy }} @@ -141,7 +141,7 @@ spec: ports: - containerPort: {{ .Values.oauth2proxy.service.internalPort }} resources: -{{ toYaml .Values.resources | default .Values.global.resources | indent 12 }} +{{ .Values.resources | default .Values.global.resources | toYaml | indent 12 }} volumes: - name: {{ template "fullname" . }} {{- if default .Values.global.data.persist .Values.data.persist }} diff --git a/charts/dispatch/charts/identity-manager/templates/ingress.noauth.yaml b/charts/dispatch/charts/identity-manager/templates/ingress.noauth.yaml index 48cc7c4b2..12004edb6 100644 --- a/charts/dispatch/charts/identity-manager/templates/ingress.noauth.yaml +++ b/charts/dispatch/charts/identity-manager/templates/ingress.noauth.yaml @@ -11,6 +11,7 @@ metadata: release: {{ .Release.Name }} heritage: {{ .Release.Service }} annotations: + kubernetes.io/ingress.class: "{{ .Values.global.ingress.class }}" {{ .Values.global.ingress.annotationsPrefix }}/configuration-snippet: | error_page 403 = @403.json; error_page 401 = @401.json; diff --git a/charts/dispatch/charts/image-manager/templates/deployment.yaml b/charts/dispatch/charts/image-manager/templates/deployment.yaml index f129434ee..b9c41e986 100644 --- a/charts/dispatch/charts/image-manager/templates/deployment.yaml +++ b/charts/dispatch/charts/image-manager/templates/deployment.yaml @@ -76,7 +76,7 @@ spec: - name: DOCKER_HOST value: "tcp://localhost:2375" resources: -{{ toYaml .Values.resources | default .Values.global.resources | indent 12 }} +{{ .Values.resources | default .Values.global.resources | toYaml | indent 12 }} - name: {{ .Chart.Name }}-docker image: docker:dind imagePullPolicy: {{ default .Values.global.pullPolicy .Values.image.pullPolicy }} @@ -90,7 +90,7 @@ spec: - name: docker-graph-storage mountPath: /var/lib/docker resources: -{{ toYaml .Values.resources | default .Values.global.resources | indent 12 }} +{{ .Values.dindResources | default .Values.global.resources | toYaml | indent 12 }} volumes: - name: {{ template "fullname" . }} {{- if default .Values.global.data.persist .Values.data.persist }} diff --git a/charts/dispatch/charts/image-manager/values.yaml b/charts/dispatch/charts/image-manager/values.yaml index bfd7e969d..2f4576764 100644 --- a/charts/dispatch/charts/image-manager/values.yaml +++ b/charts/dispatch/charts/image-manager/values.yaml @@ -32,11 +32,19 @@ resources: {} # resources, such as Minikube. If you do want to specify resources, uncomment the following # lines, adjust them as necessary, and remove the curly braces after 'resources:'. # limits: - # cpu: 500m - # memory: 4Gi - # requests: - # cpu: 250m - # memory: 2Gi + # cpu: 100m + # memory: 128Mi + #requests: + # cpu: 100m + # memory: 128Mi +# Resources to allocate for Docker-in-Docker container within the image-manager pod +dindResources: {} +# limits: + # cpu: 500m + # memory: 2Gi + #requests: + # cpu: 250m + # memory: 512Mi registry: {} # insecure: false # uri: docker-docker-registry.docker.svc.cluster.local:5000 diff --git a/charts/dispatch/charts/secret-store/templates/deployment.yaml b/charts/dispatch/charts/secret-store/templates/deployment.yaml index fd7250236..2ed751bd6 100644 --- a/charts/dispatch/charts/secret-store/templates/deployment.yaml +++ b/charts/dispatch/charts/secret-store/templates/deployment.yaml @@ -74,7 +74,7 @@ spec: - name: DOCKER_API_VERSION value: "1.23" resources: -{{ toYaml .Values.resources | default .Values.global.resources | indent 12 }} +{{ .Values.resources | default .Values.global.resources | toYaml | indent 12 }} volumes: - name: {{ template "fullname" . }} {{- if default .Values.global.data.persist .Values.data.persist }} diff --git a/charts/dispatch/charts/service-manager/templates/deployment.yaml b/charts/dispatch/charts/service-manager/templates/deployment.yaml index f997edd2e..d68583cff 100644 --- a/charts/dispatch/charts/service-manager/templates/deployment.yaml +++ b/charts/dispatch/charts/service-manager/templates/deployment.yaml @@ -79,7 +79,7 @@ spec: name: {{ template "fullname" . }} key: organization resources: -{{ toYaml .Values.resources | indent 12 }} +{{ .Values.resources | default .Values.global.resources | toYaml | indent 12 }} volumes: - name: {{ template "fullname" . }} {{- if default .Values.global.data.persist .Values.data.persist }} diff --git a/charts/dispatch/templates/_helpers.tpl b/charts/dispatch/templates/_helpers.tpl index 1d9324043..ef6e061dd 100644 --- a/charts/dispatch/templates/_helpers.tpl +++ b/charts/dispatch/templates/_helpers.tpl @@ -14,7 +14,7 @@ metadata: release: {{ .Release.Name }} heritage: {{ .Release.Service }} annotations: - kubernetes.io/ingress.class: "nginx" + kubernetes.io/ingress.class: "{{ .Values.global.ingress.class }}" {{- range $key, $value := $ingress_annotations }} {{ $key }}: {{ $value | quote }} {{- end }} diff --git a/charts/dispatch/values.yaml b/charts/dispatch/values.yaml index f772ddf27..aceb2b6ba 100644 --- a/charts/dispatch/values.yaml +++ b/charts/dispatch/values.yaml @@ -26,6 +26,7 @@ global: release: postgres ingress: enabled: true + class: nginx # Used to create Ingress record (should used with service.type: ClusterIP). # host: dispatch.vmware.com # The annotationsPrefix that your ingress controller requires. default - nginx.ingress.kubernetes.io for @@ -53,7 +54,7 @@ global: create: true # Ignored, if rbac.create is true serviceAccountName: default - resources: + resources: {} # limits: # cpu: 100m # memory: 128Mi diff --git a/pkg/dispatchcli/cmd/install_config.go b/pkg/dispatchcli/cmd/install_config.go index 3bbaa1370..d8c6ca7f7 100644 --- a/pkg/dispatchcli/cmd/install_config.go +++ b/pkg/dispatchcli/cmd/install_config.go @@ -58,8 +58,7 @@ kafka: chart: kafka namespace: dispatch release: transport - repo: https://riff-charts.storage.googleapis.com - version: 0.0.1 + repo: http://storage.googleapis.com/kubernetes-charts-incubator brokers: - transport-kafka.dispatch:9092 zookeeperNodes: