---
  apiVersion: apps/v1
  kind: Deployment                 # Type of Kubernetes resource
  metadata:
    name: cipher-bin-server        # Name of the Kubernetes resource
  spec:
    replicas: 3                    # Number of pods to run at any given time
    selector:
      matchLabels:
        app: cipher-bin-server     # This deployment applies to any Pods matching the specified label
    template:                      # This deployment will create a set of pods using the configurations in this template
      metadata:
        labels:                    # The labels that will be applied to all of the pods in this deployment
          app: cipher-bin-server 
      spec:                        # Spec for the container which will run in the Pod
        containers:
        - name: cipher-bin-server
          image: bradfordhamilton/cipher-bin-server:latest
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 4000  # Should match the port number that the Go application listens on
          livenessProbe:           # To check the health of the Pod
            httpGet:
              path: /ping
              port: 4000
              scheme: HTTP
            initialDelaySeconds: 5
            periodSeconds: 15
            timeoutSeconds: 5
