---
kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: traefik
spec:
  selector:
    matchLabels:
      app: traefik
  serviceName: traefik-ingress-controller
  replicas: 1
  volumeClaimTemplates: []
  template:
    metadata:
      labels:
        app: traefik
    spec:
      hostNetwork: true
      serviceAccountName: traefik-ingress-controller
      containers:
        - name: traefik
          image: traefik:2.3.6
          imagePullPolicy: Always
          args:
            - --log.level=INFO
            - --api
            - --entrypoints.web.address=:80
            - --entrypoints.websecure.address=:443
            - --providers.kubernetescrd
            - --entrypoints.ping.address=:8082
            - --ping.entrypoint=ping
#          livenessProbe:
#            httpGet:
#              path: /ping
#              port: 80
#            initialDelaySeconds: 60
#            periodSeconds: 3
#          readinessProbe:
#            httpGet:
#              path: /ping
#              port: 80
#            initialDelaySeconds: 3
#            periodSeconds: 3
          ports:
            - name: web
              containerPort: 80
            - name: websecure
              containerPort: 443
            - name: admin
              containerPort: 8080
          resources:
            limits:
              cpu: 50m
              memory: 100Mi
            requests:
              cpu: 50m
              memory: 100Mi
          securityContext:
            capabilities:
              add:
                - NET_BIND_SERVICE
              drop:
                - ALL
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
