Skip to content

Instantly share code, notes, and snippets.

@iamNoah1
Created June 10, 2021 14:13
Show Gist options
  • Save iamNoah1/0839203176d115646d58080c3c79521f to your computer and use it in GitHub Desktop.
Save iamNoah1/0839203176d115646d58080c3c79521f to your computer and use it in GitHub Desktop.
Kubernetes Manifest for exposing service 1 using Traefik on aks
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: service1
name: service1
spec:
replicas: 1
selector:
matchLabels:
app: service1
template:
metadata:
labels:
app: service1
spec:
containers:
- image: iamnoah4real/saywhat
name: say-what
env:
- name: RESPONSE_MESSAGE
value: "hello from service 1"
livenessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 30
periodSeconds: 60
timeoutSeconds: 30
failureThreshold: 2
ports:
- containerPort: 3000
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: service1
spec:
selector:
app: service1
ports:
- protocol: TCP
port: 80
targetPort: 3000
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: service1-ingress
spec:
routes:
- match: Path(`/service1`)
kind: Rule
middlewares:
- name: service1-stripprefix
services:
- name: service1
port: 80
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: service1-stripprefix
spec:
stripPrefix:
prefixes:
- /service1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment