Moving dev back to LF Gerrit
[it/dep.git] / ric-infra / 30-Kong / helm / kong / charts / kong / templates / deployment.yaml
index fcc21b3..9bcbab0 100755 (executable)
@@ -1,4 +1,4 @@
-apiVersion: apps/v1beta2
+apiVersion: apps/v1
 kind: Deployment
 metadata:
   name: "{{ template "kong.fullname" . }}"
@@ -15,18 +15,28 @@ spec:
       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 }}
@@ -40,7 +50,7 @@ spec:
       {{- 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" . }}
@@ -98,7 +108,7 @@ spec:
         - 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:
@@ -135,7 +145,8 @@ spec:
         {{- 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" . }}
@@ -151,6 +162,11 @@ spec:
         - 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 }}
@@ -174,6 +190,9 @@ spec:
           {{- end}}
           protocol: TCP
         {{- end }}
+        - name: metrics
+          containerPort: 9542
+          protocol: TCP
         {{- if .Values.enterprise.enabled }}
         {{- if .Values.manager.http.enabled }}
         - name: manager
@@ -224,6 +243,13 @@ spec:
           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:
@@ -240,3 +266,16 @@ spec:
     {{- 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 }}