apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: cgw
  name: container-api
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cgw
  template:
    metadata:
      labels:
        app: cgw
    spec:
      serviceAccountName: job-admin
      containers:
      - image: takutakahashi/container-api-gateway
        command:
          - ./cgw
          - --config
          - /app/config/config.yaml
        imagePullPolicy: Always
        envFrom:
          - secretRef:
              name: container-env
        name: api
        volumeMounts:
        - mountPath: /app/config
          name: config
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP
        readinessProbe:
          httpGet:
            port: 8080
            path: /health
      volumes:
      - name: config
        configMap:
          name: api-config
          items:
          - key: config.yaml
            path: config.yaml
