57 lines
1.2 KiB
YAML
57 lines
1.2 KiB
YAML
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: mongo
|
|
labels:
|
|
app: mongo
|
|
spec:
|
|
clusterIP: None
|
|
selector:
|
|
app: mongo
|
|
ports:
|
|
- port: 27017
|
|
name: mongo
|
|
protocol: TCP
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: mongo
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: mongo
|
|
serviceName: mongo
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: mongo
|
|
spec:
|
|
restartPolicy: Always
|
|
terminationGracePeriodSeconds: 0
|
|
containers:
|
|
- name: mongo
|
|
image: mongo:latest
|
|
env:
|
|
- name: MONGO_INITDB_ROOT_USERNAME
|
|
value: root
|
|
- name: MONGO_INITDB_ROOT_PASSWORD
|
|
value: example
|
|
readinessProbe:
|
|
tcpSocket:
|
|
port: 27017
|
|
periodSeconds: 1
|
|
failureThreshold: 300
|
|
ports:
|
|
- containerPort: 27017
|
|
name: mongo
|
|
protocol: TCP
|
|
volumeMounts:
|
|
- name: wormhole-explorer-mongo-data-dir
|
|
mountPath: /data/db
|
|
volumes:
|
|
- name: wormhole-explorer-mongo-data-dir
|
|
persistentVolumeClaim:
|
|
claimName: wormhole-explorer-mongo-pvc
|