Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
[stable/kong] add nginx custom template feature via config map (#15079)
Browse files Browse the repository at this point in the history
* [stable/kong] added custom nginx template injection capability via config map

Signed-off-by: Amath Sarr <[email protected]>

* [stable/kong] bump version

Signed-off-by: Amath Sarr <[email protected]>

* [stable/kong] added missing space in comment

Signed-off-by: Amath Sarr <[email protected]>

* [stable/kong] bump app version to 0.14.0

Signed-off-by: Amath Sarr <[email protected]>

* [stable/kong] removed configurable configmap and extra pod ports not necessary anymore

Signed-off-by: Amath Sarr <[email protected]>

* [stable/kong] remove metrics for controller cause it's hardly used and expose metric port in other kong pods

Signed-off-by: Amath Sarr <[email protected]>
  • Loading branch information
Mattzr authored and k8s-ci-robot committed Jul 3, 2019
1 parent 9bf18f5 commit 9799f20
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stable/kong/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ maintainers:
name: kong
sources:
- https://github.com/Kong/kong
version: 0.13.0
version: 0.14.0
appVersion: 1.2
29 changes: 29 additions & 0 deletions stable/kong/templates/config-custom-server-blocks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: kong-default-custom-server-blocks
labels:
app: {{ template "kong.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
data:
servers.conf: |
# Prometheus metrics server
server {
server_name kong_prometheus_exporter;
listen 0.0.0.0:9542; # can be any other port as well
access_log off;
location /metrics {
default_type text/plain;
content_by_lua_block {
local prometheus = require "kong.plugins.prometheus.exporter"
prometheus:collect()
}
}
location /nginx_status {
internal;
access_log off;
stub_status;
}
}
13 changes: 13 additions & 0 deletions stable/kong/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ spec:
{{- 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" . }}
Expand Down Expand Up @@ -174,6 +176,9 @@ spec:
{{- end}}
protocol: TCP
{{- end }}
- name: metrics
containerPort: 9542
protocol: TCP
{{- if .Values.enterprise.enabled }}
{{- if .Values.manager.http.enabled }}
- name: manager
Expand Down Expand Up @@ -224,6 +229,9 @@ spec:
protocol: TCP
{{- end }}
{{- end }}
volumeMounts:
- name: custom-nginx-template-volume
mountPath: /kong
readinessProbe:
{{ toYaml .Values.readinessProbe | indent 10 }}
livenessProbe:
Expand All @@ -240,3 +248,8 @@ spec:
{{- end }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
volumes:
- name: custom-nginx-template-volume
configMap:
name: kong-default-custom-server-blocks

0 comments on commit 9799f20

Please sign in to comment.