Files
infrastructure/api-gateway/kong/k8s-deployment.yaml
2026-02-09 21:51:46 -08:00

90 lines
1.9 KiB
YAML

# Kong API Gateway Kubernetes Deployment
apiVersion: v1
kind: Namespace
metadata:
name: api-gateway
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: kong
namespace: api-gateway
spec:
replicas: 2
selector:
matchLabels:
app: kong
template:
metadata:
labels:
app: kong
spec:
containers:
- name: kong
image: kong:3.4
env:
- name: KONG_DATABASE
value: "off"
- name: KONG_DECLARATIVE_CONFIG
value: "/kong/kong.yaml"
- 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"
ports:
- name: proxy
containerPort: 8000
- name: admin
containerPort: 8001
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "500m"
volumeMounts:
- name: kong-config
mountPath: /kong/kong.yaml
subPath: kong.yaml
volumes:
- name: kong-config
configMap:
name: kong-config
---
apiVersion: v1
kind: Service
metadata:
name: kong-proxy
namespace: api-gateway
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 8000
protocol: TCP
name: http
- port: 443
targetPort: 8443
protocol: TCP
name: https
selector:
app: kong
---
apiVersion: v1
kind: ConfigMap
metadata:
name: kong-config
namespace: api-gateway
data:
kong.yaml: |
# Kong configuration will be loaded from kong.yaml file