Skip to content

Instantly share code, notes, and snippets.

@chwaee
Created October 4, 2023 05:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chwaee/efdb3c4c499d26822b2d7c3ed7610c62 to your computer and use it in GitHub Desktop.
Save chwaee/efdb3c4c499d26822b2d7c3ed7610c62 to your computer and use it in GitHub Desktop.
K8s Nginx ingress controller updates for middleware logging service
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-app-ingress
annotations:
# Add annotations specific to your ingress controller, if any
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: myapp.example.com # Your domain
http:
paths:
- path: /log-this-1
pathType: Prefix
backend:
service:
name: logging-middleware-service
port:
number: 3000 # The port where the middleware listens on
- path: /log-this-2
pathType: Prefix
backend:
service:
name: logging-middleware-service
port:
number: 3000
- path: /normal-path-1
pathType: Prefix
backend:
service:
name: main-app-service
port:
number: 8080 # The port where the main application listens on
- path: /normal-path-2
pathType: Prefix
backend:
service:
name: main-app-service
port:
number: 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment