---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: dep-caddy
  namespace: codingbee
spec:
  replicas: 2 
  selector:
    matchLabels:
      component: caddy_pod
  template:
    metadata:
      labels:
        component: caddy_pod
    spec: 
      containers:
        - name: cntr-caddy
          image: abiosoft/caddy 
          ports:
            - containerPort: 2015
          command: ["/bin/sh", "-c"]
          args:
            - |
              apk add curl
              /bin/echo "You've hit caddy - $HOSTNAME" > /srv/index.html
              /bin/parent caddy --conf /etc/Caddyfile --log stdout --agree=$ACME_AGREE 