-
Notifications
You must be signed in to change notification settings - Fork 0
/
python-app-k8s.yaml
95 lines (94 loc) · 1.74 KB
/
python-app-k8s.yaml
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
apiVersion: apps/v1
kind: Deployment
metadata:
name: vote-back
namespace: python-app
spec:
replicas: 1
selector:
matchLabels:
app: vote-back
template:
metadata:
labels:
app: vote-back
spec:
containers:
- name: vote-back
image: bitnami/redis:6.0.8
env:
- name: ALLOW_EMPTY_PASSWORD
value: "yes"
ports:
- containerPort: 6379
name: redis
---
apiVersion: v1
kind: Service
metadata:
name: vote-back
namespace: python-app
spec:
ports:
- port: 6379
selector:
app: vote-back
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: vote-front
namespace: python-app
spec:
replicas: 1
selector:
matchLabels:
app: vote-front
template:
metadata:
labels:
app: vote-front
spec:
containers:
- name: vote-front
image: sampleregistry77.azurecr.io/myakscluster:latest
imagePullPolicy: Always
ports:
- containerPort: 80
env:
- name: REDIS
value: "vote-back"
---
apiVersion: v1
kind: Service
metadata:
name: vote-front
namespace: python-app
spec:
ports:
- port: 80
selector:
app: vote-front
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: webapp-ingress
namespace: python-app
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: frontend.52.186.47.151.nip.io
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: vote-front
port:
number: 80