apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
  name: traefik
  namespace: kube-system
spec:
  valuesContent: |-
    ingressClass:
      enabled: true
      isDefaultClass: true
    service:
      enabled: false
    hostNetwork: true
    ports:
      web:
        port: 80
        expose: true
        protocol: TCP
        exposePort: 80
        redirectTo: websecure
      websecure:
        port: 443
        expose: true
        protocol: TCP
        exposePort: 443
        tls:
          enable: true
      metrics:
        port: 9101
    ingressRoute:
      dashboard:
        enabled: false
    providers:
      kubernetesIngress:
        publishedService:
          enabled: true
    securityContext:
      capabilities:
        add:
          - NET_BIND_SERVICE
      runAsNonRoot: false
      runAsUser: 0
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: redirect-https
spec:
  redirectScheme:
    scheme: https
    permanent: true
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: traefik
  name: traefik-admin
spec:
  internalTrafficPolicy: Cluster
  ipFamilyPolicy: SingleStack
  ports:
  - name: 80-9000
    port: 80
    protocol: TCP
    targetPort: 9000
  selector:
    app.kubernetes.io/instance: traefik-kube-system
    app.kubernetes.io/name: traefik
  sessionAffinity: None
  type: ClusterIP
