kind: Deployment
apiVersion: apps/v1
metadata:
  name: traefik-ingress-controller
  namespace: ingress-traefik
  labels:
    k8s-app: traefik-ingress-lb
spec:
  replicas: 1
  selector:
    matchLabels:
      k8s-app: traefik-ingress-lb
  template:
    metadata:
      labels:
        k8s-app: traefik-ingress-lb
        name: traefik-ingress-lb
    spec:
      serviceAccountName: traefik-ingress-controller
      terminationGracePeriodSeconds: 60
      containers:
      - image: traefik:v2.0.2
        name: traefik-ingress-lb
        ports:
        - name: web
          containerPort: 80
          protocol: TCP
        - name: websecure
          containerPort: 443
          protocol: TCP
        - name: admin
          containerPort: 8080
          protocol: TCP
        volumeMounts:
          - mountPath: "/certs/flinstone/server.crt"
            name: my-cert
            subPath: server.crt
            readOnly: true
          - mountPath: "/certs/flinstone/server.key"
            name: my-key
            subPath: server.key
            readOnly: true
          - mountPath: "/etc/traefik/dynamic.toml"
            name: traefik-dynamic-configmap
            subPath: dynamic.toml
            readOnly: true
          - mountPath: "/etc/traefik/traefik.toml"
            name: traefik-toml-configmap
            subPath: traefik.toml
            readOnly: true
        #args:
        #- --configfile=/config/traefik.toml
        #- --logLevel=DEBUG
      volumes:
        - name: traefik-dynamic-configmap
          configMap:
            name: traefik-dynamic-configmap
        - name: traefik-toml-configmap
          configMap:
            name: traefik-toml-configmap
        - name: my-cert
          secret:
            secretName: my-cert
        - name: my-key
          secret:
            secretName: my-key
