This repository has been archived by the owner on Jul 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathk8s.yml
118 lines (118 loc) · 2.29 KB
/
k8s.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
110
111
112
113
114
115
116
117
118
---
apiVersion: v1
kind: Service
metadata:
name: toolbox
annotations:
dev.okteto.com/auto-ingress: "true"
spec:
type: ClusterIP
ports:
- name: toolbox
port: 1312
selector:
app: toolbox
---
apiVersion: v1
kind: Service
metadata:
name: db
spec:
type: ClusterIP
ports:
- name: db
port: 5432
selector:
app: db
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: toolbox
spec:
replicas: 2
serviceName: toolbox
selector:
matchLabels:
app: toolbox
template:
metadata:
labels:
app: toolbox
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: "app"
operator: In
values:
- toolbox
topologyKey: "kubernetes.io/hostname"
imagePullSecrets:
- name: docker
containers:
- name: toolbox
imagePullPolicy: Always
image: docker.pkg.github.com/distributeaid/toolbox/toolbox:latest
ports:
- name: toolbox
containerPort: 1312
protocol: TCP
envFrom:
- secretRef:
name: secrets
env:
- name: TOOLBOX_VERSION
value: "{{VERSION}}"
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: db
spec:
replicas: 1
serviceName: db
selector:
matchLabels:
app: db
template:
metadata:
labels:
app: db
spec:
volumes:
- name: data
persistentVolumeClaim:
claimName: data
containers:
- name: db
image: postgres:11.2
imagePullPolicy: "IfNotPresent"
ports:
- name: http
containerPort: 5432
protocol: TCP
envFrom:
- secretRef:
name: secrets
env:
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: data
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: data
labels:
app: db
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 3Gi