apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: traefik
  namespace: traefik-system
  labels:
    app: traefik
spec:
  replicas: 1
  selector:
    matchLabels:
      app: traefik
  serviceName: traefik
  template:
    metadata:
      labels:
        app: traefik
    spec:
      serviceAccountName: traefik-ingress-controller
      containers:
        - name: traefik
          image: traefik:v2.4
          ports:
            - name: web
              containerPort: 80
            - name: websecure
              containerPort: 443
          env:
            - name: TRAEFIK_ENTRYPOINTS_WEB_ADDRESS
              value: ":80"
            - name: TRAEFIK_ENTRYPOINTS_WEBSECURE_ADDRESS
              value: ":443"
            - name: TRAEFIK_ENTRYPOINTS_WEB_HTTP_REDIRECTIONS_ENTRYPOINT_TO
              value: "websecure"
            - name: TRAEFIK_ENTRYPOINTS_WEB_HTTP_REDIRECTIONS_ENTRYPOINT_SCHEME
              value: "https"
            - name: TRAEFIK_PROVIDERS_KUBERNETESINGRESS
              value: "true"
            - name: TRAEFIK_GLOBAL_SENDANONYMOUSUSAGE
              value: "false"
