---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: traefik-ingress
  namespace: kube-system
  annotations:
    spec.ingressClassName: traefik
    traefik.ingress.kubernetes.io/router.middlewares: kube-system-traefik-basic-auth-middleware@kubernetescrd
spec:
  serviceAccountName: traefik-ingress
  env:
    name: OVH_ENDPOINT
      value: ovh-eu
    name: OVH_APPLICATION_KEY
      value: 3f8bdfed17f848d8
    name: OVH_APPLICATION_SECRET
      value: 6946758d7515ecef108aeb286bf3c7d0
    name: OVH_CONSUMER_KEY
      value: 94b2ddf482d36421a33aa6b3aa51595
  args:
  - --configFile=/config/traefik.toml
  volumeMounts:
  - name: traefik-config
      mountPath: /config/
  - name: traefik-custom
      mountPath: /custom/
  - name: traefik-certs
      mountPath: /certs/
  ports:
    name: http
      containerPort: 80
    name: https
      containerPort: 443
    name: dashboard
      containerPort: 8080
  volumes:
  - name: traefik-config
  configMap:
  - name: traefik-config
  - name: traefik-custom
  - name: traefik-certs
  persistentVolumeClaim:
    claimName: traefik-certsrules:
  - http:
      paths:
      - pathType: Prefix
        path: "/"
        backend:
          service:
            name: traefik-dashboard
            port:
              number: 8080

---
apiVersion: v1
kind: Service
metadata:
  name: traefik-dashboard
spec:
  ports:
  - name: http
    port: 8080
    targetPort: 8080
  selector:
    app: traefik-dashboard
  type: LoadBalancer

