-apiVersion: apps/v1beta2
+apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ template "kong.fullname" . }}"
app: {{ template "kong.name" . }}
release: {{ .Release.Name }}
component: app
+ {{- if .Values.updateStrategy }}
+ strategy:
+{{ toYaml .Values.updateStrategy | indent 4 }}
+ {{- end }}
+
template:
metadata:
- {{- if .Values.podAnnotations }}
annotations:
+ {{- if (and (not .Values.ingressController.enabled) (eq .Values.env.database "off" )) }}
+ {{- if .Values.dblessConfig.config }}
+ checksum/dbless.config: {{ toYaml .Values.dblessConfig.config | sha256sum }}
+ {{- end }}
+ {{- end }}
+ {{- if .Values.podAnnotations }}
{{ toYaml .Values.podAnnotations | indent 8 }}
- {{- end }}
+ {{- end }}
labels:
app: {{ template "kong.name" . }}
release: {{ .Release.Name }}
component: app
spec:
- {{- if (and (.Values.ingressController) (eq .Values.env.database "off")) }}
+ {{- if (and (.Values.ingressController.enabled) (eq .Values.env.database "off")) }}
serviceAccountName: {{ template "kong.serviceAccountName" . }}
{{ end }}
{{- if .Values.image.pullSecrets }}
{{- include "kong.wait-for-db" . | nindent 6 }}
{{ end }}
containers:
- {{- if (and (.Values.ingressController) (eq .Values.env.database "off")) }}
+ {{- if (and (.Values.ingressController.enabled) (eq .Values.env.database "off")) }}
{{- include "kong.controller-container" . | nindent 6 }}
{{ end }}
- name: {{ template "kong.name" . }}
- name: KONG_ADMIN_GUI_AUTH
value: {{ .Values.enterprise.rbac.admin_gui_auth | default "basic-auth" }}
- name: KONG_ADMIN_GUI_AUTH_CONF
- value: {{ toJson .Values.enterprise.rbac.admin_gui_auth_conf | default "" }}
+ value: '{{ toJson .Values.enterprise.rbac.admin_gui_auth_conf }}'
- name: KONG_ADMIN_GUI_SESSION_CONF
valueFrom:
secretKeyRef:
{{- end }}
{{- include "kong.license" . | nindent 8 }}
{{- end }}
- {{- include "kong.env" . | indent 8 }}
+ - name: KONG_NGINX_HTTP_INCLUDE
+ value: /kong/servers.conf
{{- if .Values.postgresql.enabled }}
- name: KONG_PG_HOST
value: {{ template "kong.postgresql.fullname" . }}
- name: KONG_CASSANDRA_CONTACT_POINTS
value: {{ template "kong.cassandra.fullname" . }}
{{- end }}
+ {{- if (and (not .Values.ingressController.enabled) (eq .Values.env.database "off")) }}
+ - name: KONG_DECLARATIVE_CONFIG
+ value: "/kong_dbless/kong.yml"
+ {{- end }}
+ {{- include "kong.env" . | indent 8 }}
ports:
- name: admin
containerPort: {{ .Values.admin.containerPort }}
{{- end}}
protocol: TCP
{{- end }}
+ - name: metrics
+ containerPort: 9542
+ protocol: TCP
{{- if .Values.enterprise.enabled }}
{{- if .Values.manager.http.enabled }}
- name: manager
protocol: TCP
{{- end }}
{{- end }}
+ volumeMounts:
+ - name: custom-nginx-template-volume
+ mountPath: /kong
+ {{- if (and (not .Values.ingressController.enabled) (eq .Values.env.database "off")) }}
+ - name: kong-custom-dbless-config-volume
+ mountPath: /kong_dbless/
+ {{- end }}
readinessProbe:
{{ toYaml .Values.readinessProbe | indent 10 }}
livenessProbe:
{{- end }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
+ volumes:
+ - name: custom-nginx-template-volume
+ configMap:
+ name: {{ template "kong.fullname" . }}-default-custom-server-blocks
+{{- if (and (not .Values.ingressController.enabled) (eq .Values.env.database "off")) }}
+ - name: kong-custom-dbless-config-volume
+ configMap:
+ {{- if .Values.dblessConfig.configMap }}
+ name: {{ .Values.dblessConfig.configMap }}
+ {{- else }}
+ name: {{ template "kong.dblessConfig.fullname" . }}
+ {{- end }}
+{{- end }}