You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
873 B
YAML
46 lines
873 B
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: mongodb-deployment
|
|
labels:
|
|
app: mongodb
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: mongodb
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: mongodb
|
|
spec:
|
|
containers:
|
|
- name: mongodb
|
|
image: mongo
|
|
ports:
|
|
- containerPort: 27017
|
|
env:
|
|
- name: MONGO_INITDB_ROOT_USERNAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: mongodb-secret
|
|
key: mongo-root-username
|
|
- name: MONGO_INITDB_ROOT_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: mongodb-secret
|
|
key: mongo-root-password
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: mongodb-service
|
|
spec:
|
|
selector:
|
|
app: mongodb
|
|
ports:
|
|
- protocol: TCP
|
|
port: 27017
|
|
targetPort: 27017
|
|
|
|
|