113 lines
3.2 KiB
YAML
113 lines
3.2 KiB
YAML
# Traefik v2.11 LTS as the cluster edge: hostNetwork 80/443, global http->https redirect.
|
|
# TLS: entrypoint terminates TLS; certificates provisioned by cert-manager
|
|
# (Let's Encrypt DNS-01 via Cloudflare) into the Ingress TLS secrets.
|
|
# NOTE: --entrypoints.websecure.http.tls=true is REQUIRED — without it TLS
|
|
# routers never engage the mux and every HTTPS request 404s.
|
|
apiVersion: v1
|
|
kind: ServiceAccount
|
|
metadata:
|
|
name: traefik
|
|
namespace: kube-system
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRole
|
|
metadata:
|
|
name: traefik
|
|
rules:
|
|
- apiGroups: [""]
|
|
resources: ["services", "endpoints", "secrets", "namespaces", "nodes"]
|
|
verbs: ["get", "list", "watch"]
|
|
- apiGroups: ["discovery.k8s.io"]
|
|
resources: ["endpointslices"]
|
|
verbs: ["get", "list", "watch"]
|
|
- apiGroups: ["networking.k8s.io"]
|
|
resources: ["ingresses", "ingressclasses"]
|
|
verbs: ["get", "list", "watch"]
|
|
- apiGroups: ["networking.k8s.io"]
|
|
resources: ["ingresses/status"]
|
|
verbs: ["update"]
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRoleBinding
|
|
metadata:
|
|
name: traefik
|
|
roleRef:
|
|
apiGroup: rbac.authorization.k8s.io
|
|
kind: ClusterRole
|
|
name: traefik
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: traefik
|
|
namespace: kube-system
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: DaemonSet
|
|
metadata:
|
|
name: traefik
|
|
namespace: kube-system
|
|
labels:
|
|
app: traefik
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: traefik
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: traefik
|
|
spec:
|
|
serviceAccountName: traefik
|
|
hostNetwork: true
|
|
dnsPolicy: ClusterFirstWithHostNet
|
|
nodeSelector:
|
|
kubernetes.io/hostname: djg-oracle-sl
|
|
tolerations:
|
|
- key: node-role.kubernetes.io/master
|
|
operator: Exists
|
|
effect: NoSchedule
|
|
- key: node-role.kubernetes.io/control-plane
|
|
operator: Exists
|
|
effect: NoSchedule
|
|
containers:
|
|
- name: traefik
|
|
image: traefik:v2.11.2
|
|
args:
|
|
- --providers.kubernetesingress
|
|
- --providers.kubernetescrd=false
|
|
- --entrypoints.web.address=:80
|
|
- --entrypoints.web.http.redirections.entrypoint.to=websecure
|
|
- --entrypoints.web.http.redirections.entrypoint.scheme=https
|
|
- --entrypoints.websecure.address=:443
|
|
- --entrypoints.websecure.http.tls=true
|
|
- --log.level=WARN
|
|
ports:
|
|
- containerPort: 80
|
|
hostPort: 80
|
|
protocol: TCP
|
|
- containerPort: 443
|
|
hostPort: 443
|
|
protocol: TCP
|
|
resources:
|
|
requests:
|
|
cpu: 50m
|
|
memory: 64Mi
|
|
limits:
|
|
memory: 256Mi
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 80
|
|
httpHeaders:
|
|
- name: Host
|
|
value: bestdadjokes.lol
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 15
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 80
|
|
httpHeaders:
|
|
- name: Host
|
|
value: bestdadjokes.lol
|
|
initialDelaySeconds: 15
|
|
periodSeconds: 30
|