kubernetes-yaml/learn/learn-kubernetes-master/kiamol/ch07/timecheck/timecheck-with-logging.yaml

49 lines
1.3 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: timecheck
labels:
kiamol: ch07
spec:
selector:
matchLabels:
app: timecheck
template:
metadata:
labels:
app: timecheck
version: v3
spec:
initContainers:
- name: init-config
image: kiamol/ch03-sleep
command: ['sh', '-c', 'cp /config-in/appsettings.json /config-out/appsettings.json']
volumeMounts:
- name: config-map
mountPath: /config-in
- name: config-dir
mountPath: /config-out
containers:
- name: timecheck
image: kiamol/ch07-timecheck
volumeMounts:
- name: config-dir
mountPath: /config
readOnly: true
- name: logs-dir
mountPath: /logs
- name: logger
image: kiamol/ch03-sleep
command: ['sh', '-c', 'tail -f /logs-ro/timecheck.log']
volumeMounts:
- name: logs-dir
mountPath: /logs-ro
readOnly: true
volumes:
- name: config-map
configMap:
name: timecheck-config
- name: config-dir
emptyDir: {}
- name: logs-dir
emptyDir: {}