apiVersion: apps/v1
kind: Deployment
metadata:
  name: kanary-tunnel
  namespace: kanary-tunnel
  labels:
    name: kanary-tunnel
spec:
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  selector:
    matchLabels:
      app: kanary-tunnel
  template:
    metadata:
      labels:
        app: kanary-tunnel
    spec:
      containers:
        - image: code4clouds/canary-tunnel:202103132220
          name: canary-tunnel
          resources:
            requests:
              cpu: "20m"
              memory: "16M"
            limits:
              cpu: "32m"
              memory: "32M"
          env:
            - name: TRAEFIK_IP
              value: 10.cluster.ip
            - name: VM_IP
              value: 40.azure.vm.ip
          volumeMounts:
            - name: kanary-tunnel
              mountPath: /home/kanary-tunnel/pem
              readOnly: true
      imagePullSecrets:
        - name: code4clouds
      volumes:
        - name: kanary-tunnel
          secret:
            secretName: kanary-tunnel
            items:
              - key: kanary-container_key.pem
                path: ./kanary-container_key.pem
                mode: 0400
      restartPolicy: Always
