66 lines
1.4 KiB
YAML
66 lines
1.4 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: guestbook
|
|
labels:
|
|
app: &app frontend
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: *app
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: *app
|
|
spec:
|
|
containers:
|
|
- name: guestbook-app
|
|
image: nginx
|
|
resources:
|
|
requests:
|
|
cpu: 100m
|
|
memory: 100Mi
|
|
env:
|
|
- name: DB_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: secret
|
|
key: DB_PASSWORD
|
|
- name: FRUIT
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: secret
|
|
key: FRUIT
|
|
- name: ROUTER_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: secret
|
|
key: ROUTER_PASSWORD
|
|
- name: VEGETABLE
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: secret
|
|
key: VEGETABLE
|
|
ports:
|
|
- containerPort: 80
|
|
volumeMounts:
|
|
- name: config
|
|
mountPath: /mnt/config/config.ini
|
|
subPath: config.ini
|
|
readOnly: true
|
|
- name: secret
|
|
mountPath: /mnt/secret
|
|
readOnly: true
|
|
volumes:
|
|
- name: config
|
|
configMap:
|
|
name: config
|
|
defaultMode: 420
|
|
- name: secret
|
|
secret:
|
|
secretName: secret
|
|
items:
|
|
- key: longsecret.txt
|
|
path: longsecret.txt
|