apiVersion: v1
kind: Pod
metadata:
  name: kuard-pod-api-secret
  labels:
    app: kuard
    role: introspection
    tier: frontend
spec:
  containers:
  - name: kuard
    imagePullPolicy: IfNotPresent
    # Tag can be 1, 2 or 3
    image: gcr.io/kuar-demo/kuard-amd64:1

    ports:
      - name: app
        containerPort: 8080

    env:
       - name: API_KEY
         valueFrom:
           secretKeyRef:
             name: api-token
             key: API_TOKEN

    resources:
      requests:
        memory: "200Mi"
        cpu: "250m"
      limits:
        memory: "400Mi"
        cpu: "500m"

    # Liveness Check: Is your application alive?
    livenessProbe:
      httpGet:
        path: /healthy
        port: app
      initialDelaySeconds: 5
      timeoutSeconds: 3
      periodSeconds: 5
      failureThreshold: 3
    #
    # Readiness Check: Is your app ready to serve traffic
    #
    # Use this if there is something your container needs to do on
    # startup (e.g. compute and load large data-set into memory)
    # before it can be considered ready to receive traffic.
    #
    readinessProbe:
      httpGet:
        path: /ready
        port: app
      initialDelaySeconds: 10
      timeoutSeconds: 3
      periodSeconds: 5
      failureThreshold: 3
