-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
ingress-sticky.yml
56 lines (56 loc) · 1023 Bytes
/
ingress-sticky.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
apiVersion: apps/v1
kind: Deployment
metadata:
name: sticky
spec:
selector:
matchLabels:
app: sticky
replicas: 5
template:
metadata:
labels:
app: sticky
svc: example
spec:
containers:
- name: main
image: ondrejsika/training-example
ports:
- containerPort: 80
resources:
requests:
cpu: 10m
memory: 10Mi
limits:
memory: 20Mi
cpu: 20m
---
apiVersion: v1
kind: Service
metadata:
name: sticky
spec:
selector:
app: sticky
ports:
- port: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: sticky
annotations:
nginx.ingress.kubernetes.io/affinity: cookie
spec:
rules:
- host: sticky.127.0.0.1.nip.io
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: sticky
port:
number: 80