[bugfix] works

This commit is contained in:
Klesh Wong 2021-01-15 02:34:53 +08:00
parent 97625f5560
commit 34e5ffe614
2 changed files with 61 additions and 5 deletions

View File

@ -4,15 +4,16 @@ metadata:
name: traefik name: traefik
spec: spec:
ports: ports:
#- protocol: TCP # - protocol: TCP
#name: web # name: web
#port: 80 # port: 80
#- protocol: TCP #- protocol: TCP
#name: admin #name: admin
#port: 8080 #port: 8080
- protocol: TCP - protocol: TCP
name: websecure name: websecure
port: 8443 port: 8443
targetPort: 443
type: LoadBalancer type: LoadBalancer
selector: selector:
app: traefik app: traefik
@ -57,9 +58,9 @@ spec:
- --certificatesresolvers.myresolver.acme.email={EMAIL} - --certificatesresolvers.myresolver.acme.email={EMAIL}
- --certificatesresolvers.myresolver.acme.storage=acme.json - --certificatesresolvers.myresolver.acme.storage=acme.json
env: env:
- name: CF_API_EMAIL - name: CLOUDFLARE_EMAIL
value: {CF_API_EMAIL} value: {CF_API_EMAIL}
- name: CF_API_Key - name: CLOUDFLARE_API_KEY
value: {CF_API_KEY} value: {CF_API_KEY}
ports: ports:
- name: web - name: web

55
devel/k3s/whomai-cf.yaml Normal file
View File

@ -0,0 +1,55 @@
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: gitea
namespace: default
spec:
entryPoints:
- websecure
# - web
routes:
- match: Host(`example.com`)
kind: Rule
services:
- name: whoami
port: 80
tls:
certResolver: myresolver
---
apiVersion: v1
kind: Service
metadata:
name: whoami
spec:
ports:
- protocol: TCP
name: web
port: 80
selector:
app: whoami
---
kind: Deployment
apiVersion: apps/v1
metadata:
namespace: default
name: whoami
labels:
app: whoami
spec:
replicas: 2
selector:
matchLabels:
app: whoami
template:
metadata:
labels:
app: whoami
spec:
containers:
- name: whoami
image: traefik/whoami
ports:
- name: web
containerPort: 80