Created
October 10, 2021 22:39
-
-
Save a1994sc/3d3346055d7026f3337a6ce27380619f to your computer and use it in GitHub Desktop.
Traefik Cross Namespace Issues
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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