-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
init_containers.yml
109 lines (109 loc) · 2 KB
/
init_containers.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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: redis
spec:
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
initContainers:
- name: wait
image: busybox:1.28
command:
- sleep
args:
- "20"
containers:
- name: main
image: redis
resources:
requests:
cpu: 30m
memory: 50Mi
limits:
cpu: 50m
memory: 80Mi
ports:
- containerPort: 6379
---
apiVersion: v1
kind: Service
metadata:
name: redis
spec:
selector:
app: redis
ports:
- port: 6379
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: counter
annotations:
app.openshift.io/connects-to: |
[{"apiVersion":"apps/v1","kind":"StatefulSet","name":"redis"}]
spec:
selector:
matchLabels:
app: counter
replicas: 2
template:
metadata:
labels:
app: counter
spec:
initContainers:
- name: wait-for-redis
image: sikalabs/slu:v0.80.0
args:
- /bin/sh
- -c
- slu wait-for tcp -a redis:6379
containers:
- name: main
image: ghcr.io/ondrejsika/counter
resources:
requests:
cpu: 20m
memory: 30Mi
limits:
cpu: 50m
memory: 60Mi
env:
- name: REDIS
value: redis
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: counter
spec:
selector:
app: counter
ports:
- port: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: counter
spec:
rules:
- host: counter.127.0.0.1.nip.io
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: counter
port:
number: 80