zkt22/sk1/mongo-deployment.yaml

35 lines
831 B
YAML
Raw Normal View History

2022-05-14 11:55:46 +00:00
apiVersion: apps/v1
kind: Deployment
metadata:
name: mongo-deployment
namespace: z2
labels:
app: mongodb
spec:
replicas: 1
selector:
matchLabels:
app: mongodb
template:
metadata:
labels:
app: mongodb
spec:
containers:
- name: mongodb
image: mongo:latest
ports:
- containerPort: 27017
env:
#mongo-secret.yaml poskytne meno a heslo, bezpecnejsie base64
- name: MONGO_INITDB_ROOT_USERNAME
valueFrom:
secretKeyRef:
name: mongo-secret
key: mongo-username
- name: MONGO_INITDB_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mongo-secret
key: mongo-password