Hello @rick,
Thanks for your reply 
Im working on deploying the kong with help of helm chart in Kubernetes running non root user(not allow to run as root)
I was able to run 3.7 version without any issues. I’m trying to upgrade the image to use 3.9.1.
I will attach the deployment yaml here.
apiVersion: apps/v1
kind: Deployment
metadata:
name: kong
namespace: dev-dna-kong
labels:
app.kubernetes.io/component: app
app.kubernetes.io/instance: dev-dna-kong-gw
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kong
app.kubernetes.io/version: '382.0'
argocd.argoproj.io/instance: dev-dna-kong-gw
helm.sh/chart: kong-2.49.0
k8slens-edit-resource-version: v1
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/instance: dev-dna-kong-gw
app.kubernetes.io/name: kong
template:
metadata:
creationTimestamp: null
labels:
app: kong
app.kubernetes.io/component: app
app.kubernetes.io/instance: dev-dna-kong-gw
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kong
app.kubernetes.io/version: '382.0'
helm.sh/chart: kong-2.49.0
version: '382.0'
annotations:
argocd.argoproj.io/hook: PreSync
kuma.io/gateway: enabled
kuma.io/service-account-token-volume: kong-token
traffic.sidecar.istio.io/includeInboundPorts: ''
spec:
volumes:
- name: kong-prefix-dir
emptyDir:
sizeLimit: 256Mi
- name: kong-tmp
emptyDir:
sizeLimit: 1Gi
- name: kong-token
projected:
sources:
- serviceAccountToken:
expirationSeconds: 3607
path: token
- configMap:
name: kube-root-ca.crt
items:
- key: ca.crt
path: ca.crt
- downwardAPI:
items:
- path: namespace
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
defaultMode: 420
initContainers:
- name: clear-stale-pid
image: kong:382
command:
- rm
- '-vrf'
- $KONG_PREFIX/pids
env:
- name: KONG_ADMIN_ACCESS_LOG
value: /dev/stdout
- name: KONG_ADMIN_ERROR_LOG
value: /dev/stderr
- name: KONG_ADMIN_GUI_ACCESS_LOG
value: /dev/stdout
- name: KONG_ADMIN_GUI_ERROR_LOG
value: /dev/stderr
- name: KONG_ADMIN_LISTEN
value: 0.0.0.0:8001, [::]:8001
- name: KONG_CLUSTER_LISTEN
value: 'off'
- name: KONG_DATABASE
value: postgres
- name: KONG_LOG_LEVEL
value: debug
- name: KONG_LUA_PACKAGE_PATH
value: /opt/?.lua;/opt/?/init.lua;;
- name: KONG_NGINX_PROXY_LARGE_CLIENT_HEADER_BUFFERS
value: 8 24k
- name: KONG_NGINX_WORKER_PROCESSES
value: '5'
- name: KONG_ONEAPI_GATEWAY_KEY
value:
- name: KONG_ONEAPI_GATEWAY_SECRET
value:
- name: KONG_ONEAPI_HTTPS_PROXY
value: http://:3128
- name: KONG_PG_DATABASE
value: kong
- name: KONG_PG_HOST
value: kong-db
- name: KONG_PG_PASSWORD
value:
- name: KONG_PG_PORT
value: '64000'
- name: KONG_PG_SCHEMA
value: public
- name: KONG_PG_SSL
value: 'off'
- name: KONG_PG_SSL_VERIFY
value: 'off'
- name: KONG_PG_USER
value: kong
- name: KONG_PLUGINS
value: >-
bundled,oneapi,jwt,oidc,jwtissuer,appauthoriser,apiauthoriser,pathfinder,fcjwtissuer,cookies-to-headers,opentelemetry
- name: KONG_PLUGINSERVER_JS_QUERY_CMD
value: >-
/usr/bin/kong-js-pluginserver --plugins-directory
/usr/local/kong/js-plugins --dump-all-plugins
- name: KONG_PLUGINSERVER_JS_SOCKET
value: /usr/local/kong/js_pluginserver.sock
- name: KONG_PLUGINSERVER_JS_START_CMD
value: >-
/usr/bin/kong-js-pluginserver -v --plugins-directory
/usr/local/kong/js-plugins
- name: KONG_PLUGINSERVER_NAMES
value: js
- name: KONG_PORTAL_API_ACCESS_LOG
value: /dev/stdout
- name: KONG_PORTAL_API_ERROR_LOG
value: /dev/stderr
- name: KONG_PORT_MAPS
value: '80:8000'
- name: KONG_PREFIX
value: /kong_prefix/
- name: KONG_PROXY_ACCESS_LOG
value: /dev/stdout
- name: KONG_PROXY_ERROR_LOG
value: /dev/stderr
- name: KONG_PROXY_LISTEN
value: 0.0.0.0:8000, [::]:8000
- name: KONG_PROXY_STREAM_ACCESS_LOG
value: /dev/stdout basic
- name: KONG_PROXY_STREAM_ERROR_LOG
value: /dev/stderr
- name: KONG_ROUTER_FLAVOR
value: traditional
- name: KONG_STATUS_ACCESS_LOG
value: 'off'
- name: KONG_STATUS_ERROR_LOG
value: /dev/stderr
- name: KONG_STATUS_LISTEN
value: 0.0.0.0:8100, [::]:8100
- name: KONG_STREAM_LISTEN
value: 'off'
- name: KONG_TRACING_INSTRUMENTATIONS
value: all
- name: KONG_TRACING_SAMPLING_RATE
value: '1.0'
- name: KONG_UNTRUSTED_LUA_SANDBOX_REQUIRES
value: resty.http,cjson,ngx.base64
resources:
limits:
memory: 1019Mi
requests:
cpu: 17m
memory: 1019Mi
volumeMounts:
- name: kong-prefix-dir
mountPath: /kong_prefix/
- name: kong-tmp
mountPath: /tmp
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: IfNotPresent
- name: wait-for-db
image: kong:382
args:
- /bin/bash
- '-c'
- >-
export KONG_NGINX_DAEMON=on KONG_PREFIX=`mktemp -d`
KONG_KEYRING_ENABLED=off; until kong start; do echo 'waiting for
db'; sleep 1; done; kong stop
env:
- name: KONG_ADMIN_ACCESS_LOG
value: /dev/stdout
- name: KONG_ADMIN_ERROR_LOG
value: /dev/stderr
- name: KONG_ADMIN_GUI_ACCESS_LOG
value: /dev/stdout
- name: KONG_ADMIN_GUI_ERROR_LOG
value: /dev/stderr
- name: KONG_ADMIN_LISTEN
value: 0.0.0.0:8001, [::]:8001
- name: KONG_CLUSTER_LISTEN
value: 'off'
- name: KONG_DATABASE
value: postgres
- name: KONG_LOG_LEVEL
value: notice
- name: KONG_NGINX_PROXY_LARGE_CLIENT_HEADER_BUFFERS
value: 8 24k
- name: KONG_LUA_PACKAGE_PATH
value: /opt/?.lua;/opt/?/init.lua;;
- name: KONG_NGINX_WORKER_PROCESSES
value: '5'
- name: KONG_ONEAPI_GATEWAY_KEY
value:
- name: KONG_ONEAPI_GATEWAY_SECRET
value:
- name: KONG_ONEAPI_HTTPS_PROXY
value: http://:3128
- name: KONG_PG_DATABASE
value: kong
- name: KONG_PG_HOST
value: kong-db
- name: KONG_PG_PASSWORD
value:
- name: KONG_PG_PORT
value: '64000'
- name: KONG_PG_SCHEMA
value: public
- name: KONG_PG_SSL
value: 'off'
- name: KONG_PG_SSL_VERIFY
value: 'off'
- name: KONG_PG_USER
value: kong
- name: KONG_PLUGINS
value: >-
bundled,oneapi,jwt,jwtissuer,appauthoriser,apiauthoriser,pathfinder,fcjwtissuer,opentelemetry
- name: KONG_PLUGINSERVER_JS_QUERY_CMD
value: >-
/usr/bin/kong-js-pluginserver --plugins-directory
/usr/local/kong/js-plugins --dump-all-plugins
- name: KONG_PLUGINSERVER_JS_SOCKET
value: /usr/local/kong/js_pluginserver.sock
- name: KONG_PLUGINSERVER_JS_START_CMD
value: >-
/usr/bin/kong-js-pluginserver -v --plugins-directory
/usr/local/kong/js-plugins
- name: KONG_PLUGINSERVER_NAMES
value: js
- name: KONG_PORTAL_API_ACCESS_LOG
value: /dev/stdout
- name: KONG_PORTAL_API_ERROR_LOG
value: /dev/stderr
- name: KONG_PORT_MAPS
value: '80:8000'
- name: KONG_PREFIX
value: /kong_prefix/
- name: KONG_PROXY_ACCESS_LOG
value: /dev/stdout
- name: KONG_PROXY_ERROR_LOG
value: /dev/stderr
- name: KONG_PROXY_LISTEN
value: 0.0.0.0:8000, [::]:8000
- name: KONG_PROXY_STREAM_ACCESS_LOG
value: /dev/stdout basic
- name: KONG_PROXY_STREAM_ERROR_LOG
value: /dev/stderr
- name: KONG_ROUTER_FLAVOR
value: traditional
- name: KONG_STATUS_ACCESS_LOG
value: 'off'
- name: KONG_STATUS_ERROR_LOG
value: /dev/stderr
- name: KONG_STATUS_LISTEN
value: 0.0.0.0:8100, [::]:8100
- name: KONG_STREAM_LISTEN
value: 'off'
- name: KONG_TRACING_INSTRUMENTATIONS
value: all
- name: KONG_TRACING_SAMPLING_RATE
value: '1.0'
- name: KONG_UNTRUSTED_LUA_SANDBOX_REQUIRES
value: resty.http,cjson,ngx.base64
resources:
limits:
memory: 1019Mi
requests:
cpu: 17m
memory: 1019Mi
volumeMounts:
- name: kong-prefix-dir
mountPath: /kong_prefix/
- name: kong-tmp
mountPath: /tmp
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: IfNotPresent
containers:
- name: simple-rp
image: kong-reverse-proxy:2
ports:
- containerPort: 8080
protocol: TCP
env:
- name: HTTPS_PROXY
value: http://:3128
- name: HTTP_PROXY
value: http://:3128
- name: NO_PROXY
value: >-
resources:
limits:
memory: 100Mi
requests:
cpu: 10m
memory: 100Mi
livenessProbe:
httpGet:
path: /alive
port: 8080
scheme: HTTP
httpHeaders:
- name: x-alive
value: healthcheck
initialDelaySeconds: 10
timeoutSeconds: 1
periodSeconds: 5
successThreshold: 1
failureThreshold: 3
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: IfNotPresent
- name: proxy
image: kong:382
ports:
- name: admin
containerPort: 8001
protocol: TCP
- name: proxy
containerPort: 8000
protocol: TCP
- name: status
containerPort: 8100
protocol: TCP
env:
- name: KONG_ADMIN_ACCESS_LOG
value: /dev/stdout
- name: KONG_ADMIN_ERROR_LOG
value: /dev/stderr
- name: KONG_ADMIN_GUI_ACCESS_LOG
value: /dev/stdout
- name: KONG_ADMIN_GUI_ERROR_LOG
value: /dev/stderr
- name: KONG_ADMIN_LISTEN
value: 0.0.0.0:8001, [::]:8001
- name: KONG_CLUSTER_LISTEN
value: 'off'
- name: KONG_DATABASE
value: postgres
- name: KONG_LOG_LEVEL
value: debug
- name: KONG_LUA_PACKAGE_PATH
value: /opt/?.lua;/opt/?/init.lua;;
- name: KONG_NGINX_PROXY_LARGE_CLIENT_HEADER_BUFFERS
value: 8 24k
- name: KONG_NGINX_WORKER_PROCESSES
value: '5'
- name: KONG_ONEAPI_GATEWAY_KEY
value:
- name: KONG_ONEAPI_GATEWAY_SECRET
value:
- name: KONG_ONEAPI_HTTPS_PROXY
value: http://:3128
- name: KONG_PG_DATABASE
value: kong
- name: KONG_PG_HOST
value: kong-db
- name: KONG_PG_PASSWORD
value:
- name: KONG_PG_PORT
value: '64000'
- name: KONG_PG_SCHEMA
value: public
- name: KONG_PG_SSL
value: 'off'
- name: KONG_PG_SSL_VERIFY
value: 'off'
- name: KONG_PG_USER
value: kong
- name: KONG_PLUGINS
value: >-
bundled,oneapi,jwt,oidc,jwtissuer,appauthoriser,apiauthoriser,pathfinder,fcjwtissuer,cookies-to-headers,opentelemetry
- name: KONG_PLUGINSERVER_JS_QUERY_CMD
value: >-
/usr/bin/kong-js-pluginserver --plugins-directory
/usr/local/kong/js-plugins --dump-all-plugins
- name: KONG_PLUGINSERVER_JS_SOCKET
value: /usr/local/kong/js_pluginserver.sock
- name: KONG_PLUGINSERVER_JS_START_CMD
value: >-
/usr/bin/kong-js-pluginserver -v --plugins-directory
/usr/local/kong/js-plugins
- name: KONG_PLUGINSERVER_NAMES
value: js
- name: KONG_PORTAL_API_ACCESS_LOG
value: /dev/stdout
- name: KONG_PORTAL_API_ERROR_LOG
value: /dev/stderr
- name: KONG_PORT_MAPS
value: '80:8000'
- name: KONG_PREFIX
value: /kong_prefix/
- name: KONG_PROXY_ACCESS_LOG
value: /dev/stdout
- name: KONG_PROXY_ERROR_LOG
value: /dev/stderr
- name: KONG_PROXY_LISTEN
value: 0.0.0.0:8000, [::]:8000
- name: KONG_PROXY_STREAM_ACCESS_LOG
value: /dev/stdout basic
- name: KONG_PROXY_STREAM_ERROR_LOG
value: /dev/stderr
- name: KONG_ROUTER_FLAVOR
value: traditional
- name: KONG_STATUS_ACCESS_LOG
value: 'off'
- name: KONG_STATUS_ERROR_LOG
value: /dev/stderr
- name: KONG_STATUS_LISTEN
value: 0.0.0.0:8100, [::]:8100
- name: KONG_STREAM_LISTEN
value: 'off'
- name: KONG_TRACING_INSTRUMENTATIONS
value: all
- name: KONG_TRACING_SAMPLING_RATE
value: '1.0'
- name: KONG_UNTRUSTED_LUA_SANDBOX_REQUIRES
value: resty.http,cjson,ngx.base64
- name: KONG_NGINX_DAEMON
value: 'off'
resources:
limits:
memory: 1019Mi
requests:
cpu: 17m
memory: 1019Mi
volumeMounts:
- name: kong-prefix-dir
mountPath: /kong_prefix/
- name: kong-tmp
mountPath: /tmp
livenessProbe:
httpGet:
path: /status
port: status
scheme: HTTP
initialDelaySeconds: 5
timeoutSeconds: 5
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
readinessProbe:
httpGet:
path: /status/ready
port: status
scheme: HTTP
initialDelaySeconds: 5
timeoutSeconds: 5
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
lifecycle:
preStop:
exec:
command:
- kong
- quit
- '--wait=15'
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: IfNotPresent
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
serviceAccountName: kong
serviceAccount: kong
automountServiceAccountToken: false
securityContext:
runAsUser: 1001
runAsGroup: 1001
fsGroup: 1001
seccompProfile:
type: RuntimeDefault
imagePullSecrets:
- name: imagepullsecret
schedulerName: default-scheduler
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 25%
maxSurge: 25%
revisionHistoryLimit: 10
progressDeadlineSeconds: 600