-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeployment.yaml
More file actions
85 lines (82 loc) · 2.03 KB
/
deployment.yaml
File metadata and controls
85 lines (82 loc) · 2.03 KB
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
# Postgres wait + seed example
#
# This example shows a deployment that:
# 1. Waits for Postgres to be reachable
# 2. Seeds initial data
#
# Usage:
# kubectl apply -f examples/postgres-seed/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-with-seed
labels:
app: app-with-seed
spec:
replicas: 1
selector:
matchLabels:
app: app-with-seed
template:
metadata:
labels:
app: app-with-seed
spec:
initContainers:
- name: wait-for-postgres
image: ghcr.io/kitstream/initium:latest
args:
- wait-for
- --target
- tcp://postgres:5432
- --timeout
- "120s"
securityContext:
runAsNonRoot: true
runAsUser: 65534
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
- name: seed-data
image: ghcr.io/kitstream/initium:latest
args:
- seed
- --spec
- /seeds/seed.yaml
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: postgres-credentials
key: url
securityContext:
runAsNonRoot: true
runAsUser: 65534
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
volumeMounts:
- name: workdir
mountPath: /work
- name: seed-specs
mountPath: /seeds
readOnly: true
containers:
- name: app
image: myapp:latest
ports:
- containerPort: 8080
volumeMounts:
- name: workdir
mountPath: /work
readOnly: true
volumes:
- name: workdir
emptyDir: {}
- name: seed-specs
configMap:
name: seed-specs