35 lines
831 B
YAML
35 lines
831 B
YAML
|
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
|