---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: traefik
  namespace: traefik
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: traefik
  template:
    metadata:
      labels:
        app: traefik
    spec:
      serviceAccountName: traefik
      containers:
      - name: main
        image: traefik:v2.2
        imagePullPolicy: Always
        env:
        - name: TZ
          value: Europe/Berlin
        volumeMounts:
        - mountPath: /etc/traefik
          name: config
        - name: tz-config
          mountPath: /etc/localtime
        ports:
        - name: http
          containerPort: 80
          hostPort: 80
          protocol: TCP
        - name: https
          containerPort: 443
          hostPort: 443
          protocol: TCP
        - name: dashboard
          containerPort: 8080
          protocol: TCP
        - name: metrics
          containerPort: 8082
          protocol: TCP
        args:
        - --configfile=/config/traefik.yaml
      volumes:
      - name: config
        configMap:
          name: traefik
      - name: tz-config
        hostPath:
          path: /usr/share/zoneinfo/Europe/Berlin
