# This Deployment manifest defines:
# - single-replica deployment of the container image, with label "app: go-hello-world"
# - Pod exposes port 8080
# - specify PORT environment variable to the container process
# Syntax reference https://kubernetes.io/docs/concepts/configuration/overview/
apiVersion: apps/v1
kind: Deployment
metadata:
  name: apikeystore
spec:
  replicas: 1
  selector:
    matchLabels:
      app: apikeystore
  template:
    metadata:
      labels:
        app: apikeystore
    spec:
      containers:
        - name: service
          image: apikeystore
          ports:
            - containerPort: 8401
            - containerPort: 8402

          env:
            - name: APIKEYSTORE_ADDRESS1
              valueFrom:
                configMapKeyRef:
                  name: apikeystore
                  key: APIKEYSTORE_ADDRESS1
            - name: APIKEYSTORE_ADDRESS2
              valueFrom:
                configMapKeyRef:
                  name: apikeystore
                  key: APIKEYSTORE_ADDRESS2

            - name: APIKEYSTORE_PROJECTID
              valueFrom:
                configMapKeyRef:
                  name: apikeystore
                  key: APIKEYSTORE_PROJECTID


            - name: APIKEYSTORE_PREFIX
              valueFrom:
                configMapKeyRef:
                  name: apikeystore
                  key: APIKEYSTORE_PREFIX

          readinessProbe:
            tcpSocket:
              port: 8401
            initialDelaySeconds: 5
