diff --git a/charts/kong/ci/test2-values.yaml b/charts/kong/ci/test2-values.yaml index 964613882..810654f26 100644 --- a/charts/kong/ci/test2-values.yaml +++ b/charts/kong/ci/test2-values.yaml @@ -1,5 +1,6 @@ # This tests the following unrelated aspects of Ingress Controller # - ingressController deploys with a database +# - stream listens work ingressController: enabled: true installCRDs: false diff --git a/charts/kong/ci/test5-values.yaml b/charts/kong/ci/test5-values.yaml new file mode 100644 index 000000000..4987d4e7b --- /dev/null +++ b/charts/kong/ci/test5-values.yaml @@ -0,0 +1,43 @@ +# This tests the following unrelated aspects of Ingress Controller +# - ingressController deploys with a database +# - TODO database-backed proxy works _without_ stream listens +# This test is a duplicate of test2-values.yaml to handle the https://github.com/Kong/charts/issues/295 +# workaround when the socket file is _not_ created +ingressController: + enabled: true + installCRDs: false + env: + anonymous_reports: "false" +postgresql: + enabled: true + postgresqlUsername: kong + postgresqlDatabase: kong + service: + port: 5432 +env: + anonymous_reports: "off" + database: "postgres" +# - ingress resources are created without hosts +admin: + type: NodePort + ingress: + enabled: true + hosts: [] + path: / +proxy: + type: NodePort + ingress: + enabled: true + hostname: proxy.kong.example + annotations: {} + path: / + +# - PDB is enabled +podDisruptionBudget: + enabled: true +# update strategy +updateStrategy: + type: "RollingUpdate" + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 diff --git a/charts/kong/templates/_helpers.tpl b/charts/kong/templates/_helpers.tpl index 962489b96..e7271a7ac 100644 --- a/charts/kong/templates/_helpers.tpl +++ b/charts/kong/templates/_helpers.tpl @@ -489,14 +489,15 @@ The name of the service used for the ingress controller's validation webhook {{- end -}} {{- define "kong.wait-for-db" -}} +{{ $sockFile := (printf "%s/stream_rpc.sock" (default "/usr/local/kong" .Values.env.prefix)) }} - name: wait-for-db image: {{ include "kong.getRepoTag" .Values.image }} imagePullPolicy: {{ .Values.image.pullPolicy }} env: {{- include "kong.env" . | nindent 2 }} -{{/* TODO: the rm command here is a workaround for https://github.com/Kong/kong/issues/6827 +{{/* TODO: the rm command here is a workaround for https://github.com/Kong/charts/issues/295 It should be removed once that's fixed */}} - command: [ "/bin/sh", "-c", "until kong start; do echo 'waiting for db'; sleep 1; done; kong stop; rm {{ .Values.env.prefix | default "/usr/local/kong" }}/stream_rpc.sock" ] + command: [ "/bin/sh", "-c", "until kong start; do echo 'waiting for db'; sleep 1; done; kong stop; if [ -f {{ $sockFile }} ]; then rm {{ $sockFile }}; else true; fi"] volumeMounts: {{- include "kong.volumeMounts" . | nindent 4 }} resources: