# Deployment for the main Kong container
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: kong
  name: kong
spec:
  replicas: 1
  selector:
    matchLabels:
      app: kong
  template:
    metadata:
      labels:
        app: kong
    spec:
      containers:
      - env:
        - name: KONG_ADMIN_ACCESS_LOG
          value: /dev/stdout
        - name: KONG_ADMIN_ERROR_LOG
          value: /dev/stderr
        - name: KONG_ADMIN_LISTEN
          value: 0.0.0.0:8001
        - name: KONG_CASSANDRA_CONTACT_POINTS
          value: kong-db
        - name: KONG_DATABASE
          value: postgres
        - name: KONG_PG_DATABASE
          value: kong
        - name: KONG_PG_HOST
          value: kong-db
        - name: KONG_PG_PASSWORD
          value: kong
        - name: KONG_PG_USER
          value: kong
        - name: KONG_PROXY_ACCESS_LOG
          value: /dev/stdout
        - name: KONG_PROXY_ERROR_LOG
          value: /dev/stderr
        image: kong:2.0.2
        livenessProbe:
          exec:
            command:
            - kong
            - health
          failureThreshold: 10
          periodSeconds: 10
          timeoutSeconds: 10
        name: kong
        ports:
        - containerPort: 8000
        - containerPort: 8001
        - containerPort: 8443
        - containerPort: 8444
