diff --git a/stable/kong/Chart.yaml b/stable/kong/Chart.yaml index 16b8dccdc1..68256871e4 100644 --- a/stable/kong/Chart.yaml +++ b/stable/kong/Chart.yaml @@ -12,5 +12,5 @@ maintainers: name: kong sources: - https://github.com/Kong/kong -version: 0.27.1 +version: 0.27.2 appVersion: 1.3 diff --git a/stable/kong/README.md b/stable/kong/README.md index cb6aab83d1..26e8093e56 100644 --- a/stable/kong/README.md +++ b/stable/kong/README.md @@ -403,6 +403,13 @@ You can can learn about kong ingress custom resource definitions [here](https:// ## Changelog +### 0.27.2 + +#### Fixes + +- Do not create a ServiceAccount if it is not necessary. +- If a configuration change requires creating a ServiceAccount, create a temporary ServiceAccount to allow pre-upgrade tasks to complete before the regular ServiceAccount is created. + ### 0.27.1 #### Documentation updates @@ -415,6 +422,13 @@ You can can learn about kong ingress custom resource definitions [here](https:// - DB-less mode is enabled by default. - Kong is installed as an Ingress Controller for the cluster by default. +### 0.25.0 + +#### New features + +- Add support for PodSecurityPolicy +- Require creation of a ServiceAccount + ### 0.24.0 #### Breaking changes diff --git a/stable/kong/templates/controller-service-account.yaml b/stable/kong/templates/controller-service-account.yaml index b788b2cf31..4ca1d35756 100644 --- a/stable/kong/templates/controller-service-account.yaml +++ b/stable/kong/templates/controller-service-account.yaml @@ -1,3 +1,4 @@ +{{- if or .Values.podSecurityPolicy.enabled (and .Values.ingressController.enabled .Values.ingressController.serviceAccount.create) -}} apiVersion: v1 kind: ServiceAccount metadata: @@ -8,3 +9,4 @@ metadata: chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" +{{- end -}} diff --git a/stable/kong/templates/deployment.yaml b/stable/kong/templates/deployment.yaml index 6b74c23ac6..be4a82421d 100644 --- a/stable/kong/templates/deployment.yaml +++ b/stable/kong/templates/deployment.yaml @@ -36,7 +36,9 @@ spec: release: {{ .Release.Name }} component: app spec: + {{- if or .Values.ingressController.enabled .Values.podSecurityPolicy.enabled }} serviceAccountName: {{ template "kong.serviceAccountName" . }} + {{ end }} {{- if .Values.image.pullSecrets }} imagePullSecrets: {{- range .Values.image.pullSecrets }} diff --git a/stable/kong/templates/migrations-post-upgrade.yaml b/stable/kong/templates/migrations-post-upgrade.yaml index 965157d232..9c6ca7b1c9 100644 --- a/stable/kong/templates/migrations-post-upgrade.yaml +++ b/stable/kong/templates/migrations-post-upgrade.yaml @@ -23,7 +23,9 @@ spec: release: "{{ .Release.Name }}" component: post-upgrade-migrations spec: + {{- if .Values.podSecurityPolicy.enabled }} serviceAccountName: {{ template "kong.serviceAccountName" . }} + {{- end }} {{- if .Values.image.pullSecrets }} imagePullSecrets: {{- range .Values.image.pullSecrets }} diff --git a/stable/kong/templates/migrations-pre-upgrade.yaml b/stable/kong/templates/migrations-pre-upgrade.yaml index 12d144d9bb..084a00cc52 100644 --- a/stable/kong/templates/migrations-pre-upgrade.yaml +++ b/stable/kong/templates/migrations-pre-upgrade.yaml @@ -23,7 +23,9 @@ spec: release: "{{ .Release.Name }}" component: pre-upgrade-migrations spec: + {{- if .Values.podSecurityPolicy.enabled }} serviceAccountName: {{ template "kong.serviceAccountName" . }} + {{- end }} {{- if .Values.image.pullSecrets }} imagePullSecrets: {{- range .Values.image.pullSecrets }} @@ -80,3 +82,20 @@ spec: volumes: {{- include "kong.volumes" . | nindent 6 -}} {{- end }} + +{{- if or .Values.podSecurityPolicy.enabled (and .Values.ingressController.enabled .Values.ingressController.serviceAccount.create) -}} +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ template "kong.serviceAccountName" . }} + namespace: {{ .Release.namespace }} + annotations: + "helm.sh/hook": pre-upgrade + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded + labels: + app: {{ template "kong.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +{{- end -}} diff --git a/stable/kong/templates/migrations.yaml b/stable/kong/templates/migrations.yaml index 416c5022fd..4208aa2314 100644 --- a/stable/kong/templates/migrations.yaml +++ b/stable/kong/templates/migrations.yaml @@ -18,7 +18,9 @@ spec: release: "{{ .Release.Name }}" component: init-migrations spec: + {{- if .Values.podSecurityPolicy.enabled }} serviceAccountName: {{ template "kong.serviceAccountName" . }} + {{- end }} {{- if .Values.image.pullSecrets }} imagePullSecrets: {{- range .Values.image.pullSecrets }}