2021-01-14 09:10:32 +00:00
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
|
|
|
name: traefik
|
|
|
|
spec:
|
|
|
|
ports:
|
2021-01-14 18:34:53 +00:00
|
|
|
# - protocol: TCP
|
|
|
|
# name: web
|
|
|
|
# port: 80
|
2021-01-14 09:10:32 +00:00
|
|
|
#- protocol: TCP
|
|
|
|
#name: admin
|
|
|
|
#port: 8080
|
|
|
|
- protocol: TCP
|
|
|
|
name: websecure
|
|
|
|
port: 8443
|
2021-01-14 18:34:53 +00:00
|
|
|
targetPort: 443
|
2021-01-14 09:10:32 +00:00
|
|
|
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:
|
2021-01-14 18:34:53 +00:00
|
|
|
- name: CLOUDFLARE_EMAIL
|
2021-01-14 09:10:32 +00:00
|
|
|
value: {CF_API_EMAIL}
|
2021-01-14 18:34:53 +00:00
|
|
|
- name: CLOUDFLARE_API_KEY
|
2021-01-14 09:10:32 +00:00
|
|
|
value: {CF_API_KEY}
|
|
|
|
ports:
|
|
|
|
- name: web
|
|
|
|
containerPort: 80
|
|
|
|
- name: websecure
|
|
|
|
containerPort: 443
|
|
|
|
- name: admin
|
|
|
|
containerPort: 8080
|