[stable/kong] add support for Kong 1.0 (#10511)

* [stable/kong] add support for Kong 1.0

Signed-off-by: Harry Bagdi <harrybagdi@gmail.com>

* fix --kong-url for HTTPS

Signed-off-by: Harry Bagdi <harrybagdi@gmail.com>

* fix comment and add todo

Signed-off-by: Harry Bagdi <harrybagdi@gmail.com>
This commit is contained in:
Harry
2019-01-09 13:41:40 -08:00
committed by Kubernetes Prow Robot
parent d79d8688dd
commit 432f65a95f
8 changed files with 100 additions and 36 deletions
+4 -6
View File
@@ -1,8 +1,6 @@
apiVersion: v1
description: Kong is open-source API Gateway
and Microservices Management Layer,
delivering high performance and reliability that can be used as
Kubernetes Ingress.
description: The Cloud-Native Ingress and
Service Mesh for APIs and Microservices
engine: gotpl
home: https://KongHQ.com/
icon: https://s3.amazonaws.com/downloads.kong/universe/assets/icon-kong-inc-large.png
@@ -12,5 +10,5 @@ maintainers:
name: kong
sources:
- https://github.com/Kong/kong
version: 0.7.3
appVersion: 0.14.1
version: 0.8.0
appVersion: 1.0.0
+1 -5
View File
@@ -150,11 +150,7 @@ To deploy the ingress controller together with
kong run the following command:
```bash
helm install stable/kong \
--set ingressController.enabled=true \
--set admin.useTLS=false \
--set readinessProbe.httpGet.scheme=HTTP \
--set livenessProbe.httpGet.scheme=HTTP
helm install stable/kong --set ingressController.enabled=true
```
**Note**: Kong Ingress controller doesn't support custom SSL certificates
@@ -1,14 +1,3 @@
# CI test for Ingress controller basic installation
admin:
useTLS: false
readinessProbe:
httpGet:
scheme: HTTP
livenessProbe:
httpGet:
scheme: HTTP
ingressController:
enabled: true
@@ -114,8 +114,6 @@ spec:
- name: ingress-controller
args:
- /kong-ingress-controller
# the kong URL points to the kong admin api server
- --kong-url=http://localhost:{{ .Values.admin.containerPort }}
# the default service is the kong proxy service
- --default-backend-service={{ .Release.Namespace }}/{{ template "kong.fullname" . }}-proxy
# Service from were we extract the IP address/es to use in Ingress status
@@ -123,6 +121,13 @@ spec:
# Set the ingress class
- --ingress-class={{ .Values.ingressController.ingressClass }}
- --election-id=kong-ingress-controller-leader-{{ .Values.ingressController.ingressClass }}
# the kong URL points to the kong admin api server
{{- if .Values.admin.useTLS }}
- --kong-url=https://localhost:{{ .Values.admin.containerPort }}
- --admin-tls-skip-verify # TODO make this configurable
{{- else }}
- --kong-url=http://localhost:{{ .Values.admin.containerPort }}
{{- end }}
env:
- name: POD_NAME
valueFrom:
@@ -0,0 +1,76 @@
{{- if .Values.runMigrations }}
# Why is this Job duplicated and not using only helm hooks?
# See: https://github.com/helm/charts/pull/7362
apiVersion: batch/v1
kind: Job
metadata:
name: {{ template "kong.fullname" . }}-post-upgrade-migrations
labels:
app: {{ template "kong.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
component: post-upgrade-migrations
annotations:
helm.sh/hook: "post-upgrade"
helm.sh/hook-delete-policy: "before-hook-creation"
spec:
template:
metadata:
name: {{ template "kong.name" . }}-post-upgrade-migrations
labels:
app: {{ template "kong.name" . }}
release: "{{ .Release.Name }}"
component: post-upgrade-migrations
spec:
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
{{- if .Values.postgresql.enabled }}
initContainers:
- name: wait-for-postgres
image: busybox
env:
- name: KONG_PG_HOST
value: {{ template "kong.postgresql.fullname" . }}
- name: KONG_PG_PORT
value: "{{ .Values.postgresql.service.port }}"
- name: KONG_PG_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "kong.postgresql.fullname" . }}
key: postgres-password
command: [ "/bin/sh", "-c", "until nc -zv $KONG_PG_HOST $KONG_PG_PORT -w1; do echo 'waiting for db'; sleep 1; done" ]
{{- end }}
containers:
- name: {{ template "kong.name" . }}-post-upgrade-migrations
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: KONG_NGINX_DAEMON
value: "off"
{{- range $key, $val := .Values.env }}
- name: KONG_{{ $key | upper}}
value: {{ $val | quote }}
{{- end}}
{{- if .Values.postgresql.enabled }}
- name: KONG_PG_HOST
value: {{ template "kong.postgresql.fullname" . }}
- name: KONG_PG_PORT
value: "{{ .Values.postgresql.service.port }}"
- name: KONG_PG_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "kong.postgresql.fullname" . }}
key: postgres-password
{{- end }}
{{- if .Values.cassandra.enabled }}
- name: KONG_CASSANDRA_CONTACT_POINTS
value: {{ template "kong.cassandra.fullname" . }}
{{- end }}
command: [ "/bin/sh", "-c", "kong migrations finish" ]
restartPolicy: OnFailure
{{- end }}
@@ -4,24 +4,24 @@
apiVersion: batch/v1
kind: Job
metadata:
name: {{ template "kong.fullname" . }}-upgrade-migrations
name: {{ template "kong.fullname" . }}-pre-upgrade-migrations
labels:
app: {{ template "kong.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
component: migrations
component: pre-upgrade-migrations
annotations:
helm.sh/hook: "pre-upgrade"
helm.sh/hook-delete-policy: "before-hook-creation"
spec:
template:
metadata:
name: {{ template "kong.name" . }}-upgrade-migrations
name: {{ template "kong.name" . }}-pre-upgrade-migrations
labels:
app: {{ template "kong.name" . }}
release: "{{ .Release.Name }}"
component: migrations
component: pre-upgrade-migrations
spec:
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
+5 -5
View File
@@ -2,21 +2,21 @@
apiVersion: batch/v1
kind: Job
metadata:
name: {{ template "kong.fullname" . }}-migrations
name: {{ template "kong.fullname" . }}-init-migrations
labels:
app: {{ template "kong.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
component: migrations
component: init-migrations
spec:
template:
metadata:
name: {{ template "kong.name" . }}-migrations
name: {{ template "kong.name" . }}-init-migrations
labels:
app: {{ template "kong.name" . }}
release: "{{ .Release.Name }}"
component: migrations
component: init-migrations
spec:
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
@@ -66,6 +66,6 @@ spec:
- name: KONG_CASSANDRA_CONTACT_POINTS
value: {{ template "kong.cassandra.fullname" . }}
{{- end }}
command: [ "/bin/sh", "-c", "kong migrations up" ]
command: [ "/bin/sh", "-c", "kong migrations bootstrap" ]
restartPolicy: OnFailure
{{- end }}
+3 -3
View File
@@ -3,7 +3,7 @@
image:
repository: kong
tag: 0.14.1
tag: 1.0.0
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
@@ -170,7 +170,7 @@ ingressController:
enabled: false
image:
repository: kong-docker-kubernetes-ingress-controller.bintray.io/kong-ingress-controller
tag: 0.2.2
tag: 0.3.0
replicaCount: 1
livenessProbe:
failureThreshold: 3
@@ -206,4 +206,4 @@ ingressController:
# If not set and create is true, a name is generated using the fullname template
name:
ingressClass: nginx
ingressClass: kong