I am using Kong Ingress Controller 0.8.1 and trying to configure few plugins including custom ones. I am able to get them working however I would like to configure some of the plugin parameters using environment variables. E.g. provide a plugin parameter with value of the Kubernetes Node IP on which Kong Pod is running. Is this possible and if so how would I do it via declarative configuration?
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: ingress-kong
name: ingress-kong
namespace: kong
spec:
replicas: 1
selector:
matchLabels:
app: ingress-kong
template:
metadata:
annotations:
kuma.io/gateway: enabled
prometheus.io/port: "9542"
prometheus.io/scrape: "true"
traffic.sidecar.istio.io/includeInboundPorts: ""
labels:
app: ingress-kong
spec:
containers:
- env:
- name: POD_HOST_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
...
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: my-plugin
namespace: myns
config:
kongNodeIP: <POD_HOST_IP> # how to specify POD env variable here?
plugin: my-plugin
---