Skip to content

Instantly share code, notes, and snippets.

@a1994sc
Created October 10, 2021 22:39
Show Gist options
  • Save a1994sc/3d3346055d7026f3337a6ce27380619f to your computer and use it in GitHub Desktop.
Save a1994sc/3d3346055d7026f3337a6ce27380619f to your computer and use it in GitHub Desktop.
Traefik Cross Namespace Issues
kind: Deployment
apiVersion: apps/v1
metadata:
namespace: tools
name: whoami
labels:
app: whoami
spec:
replicas: 6
selector:
matchLabels:
app: whoami
template:
metadata:
labels:
app: whoami
spec:
containers:
- name: whoami
image: containous/whoami
ports:
- name: web
containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: whoami-ext
# namespace: tools
spec:
externalName: whoami.tools.svc.cluster.local
ports:
- port: 80
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: whoami-route
namespace: default
spec:
entryPoints:
- web
- websecure
routes:
# - match: PathPrefix(`/whoami-app-api`)
- match: Host(`kub.example.com`)
kind: Rule
services:
- name: whoami-ext
namespace: default
port: 80
sticky:
cookie:
httpOnly: true
name: cookie
secure: true
tls:
secretName: tls-cert-example-com
apiVersion: v1
kind: Service
metadata:
name: whoami
namespace: tools
spec:
ports:
- protocol: TCP
name: web
port: 80
selector:
app: whoami
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment