apiVersion: apps/v1
kind: Deployment
metadata:
  name: kong
spec:
  replicas: 1
  selector:
    matchLabels:
      app: kong
  template:
    metadata:
      labels:
        app: kong
    spec:
      volumes:
        - name: kong-config
          configMap:
            name: kong
      containers:
        - name: kong
          image: kong
          volumeMounts:
            - name: kong-config
              mountPath: /kong/declarative/kong.yml
              subPath: kong.yml
          ports:
          - name: admin
            containerPort: 8001
          - name: http
            containerPort: 8000
          env:
            - name: KONG_DATABASE
              value: "off"
            - name: KONG_DECLARATIVE_CONFIG
              value: "/kong/declarative/kong.yml"
            - name: KONG_PROXY_ACCESS_LOG
              value: "/dev/stdout"
            - name: KONG_ADMIN_ACCESS_LOG
              value: "/dev/stdout"
            - name: KONG_PROXY_ERROR_LOG
              value: "/dev/stderr"
            - name: KONG_ADMIN_ERROR_LOG
              value: "/dev/stderr"
            - name: KONG_ADMIN_LISTEN
              value: "0.0.0.0:8001"
            - name: KONG_ADMIN_GUI_URL
              value: "http://localhost:8002"
            - name: KONG_LICENSE_DATA
