Skip to content

Instantly share code, notes, and snippets.

@protometa
Last active October 24, 2018 20:18
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 protometa/77a45a2d7207cdfb6b4cc11f82c42def to your computer and use it in GitHub Desktop.
Save protometa/77a45a2d7207cdfb6b4cc11f82c42def to your computer and use it in GitHub Desktop.
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
run: nginx
name: nginx
spec:
replicas: 10
selector:
matchLabels:
run: nginx
template:
metadata:
labels:
run: nginx
spec:
containers:
- image: nginx
name: nginx
ports:
- containerPort: 80
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
run: nginx
sessionAffinity: None
type: ClusterIP
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: test-ingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/affinity: cookie
nginx.ingress.kubernetes.io/session-cookie-hash: sha1
nginx.ingress.kubernetes.io/session-cookie-name: sticky-01
spec:
rules:
# some domain that hits your nginx controller service lb
- host: nginx.example.com
http:
paths:
- backend:
serviceName: nginx
servicePort: 80
path: /
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment