forked from jmbharathram/executeoncommand
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackend.yaml
More file actions
25 lines (25 loc) · 686 Bytes
/
backend.yaml
File metadata and controls
25 lines (25 loc) · 686 Bytes
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
apiVersion: v1
kind: Pod
metadata:
labels:
env: qa
name: my-application
spec:
containers:
- image: busybox
name: myapp-container
command: ['sh', '-c', 'echo The app is running! && sleep 3600']
initContainers:
- image: python:3.8-slim
name: init-database
command: ['sh', '-c', 'pip install mysql-connector-python && until python /tmp/mysql-program.py; do echo waiting for db initialization; sleep 2; done']
volumeMounts:
- name: mysqlprogram
mountPath: /tmp
volumes:
- name: mysqlprogram
configMap:
name: mysql-program
items:
- key: mysql-program.py
path: mysql-program.py