apiVersion: v1 kind: Service metadata: name: traefik spec: ports: # - protocol: TCP # name: web # port: 80 #- protocol: TCP #name: admin #port: 8080 - protocol: TCP name: websecure port: 8443 targetPort: 443 type: LoadBalancer selector: app: traefik --- apiVersion: v1 kind: ServiceAccount metadata: namespace: default name: traefik-ingress-controller --- apiVersion: apps/v1 kind: Deployment metadata: namespace: default name: traefik labels: app: traefik spec: replicas: 1 selector: matchLabels: app: traefik template: metadata: labels: app: traefik spec: serviceAccountName: traefik-ingress-controller containers: - name: traefik image: traefik:v2.3.6 args: - --api.insecure - --accesslog - --entrypoints.web.Address=:80 - --entrypoints.websecure.Address=:443 - --providers.kubernetescrd - --certificatesresolvers.myresolver.acme.dnschallenge=true - --certificatesresolvers.myresolver.acme.dnschallenge.provider=cloudflare - --certificatesresolvers.myresolver.acme.email={EMAIL} - --certificatesresolvers.myresolver.acme.storage=acme.json env: - name: CLOUDFLARE_EMAIL value: {CF_API_EMAIL} - name: CLOUDFLARE_API_KEY value: {CF_API_KEY} ports: - name: web containerPort: 80 - name: websecure containerPort: 443 - name: admin containerPort: 8080