Dedicated mongo for inventory
This commit is contained in:
@@ -32,7 +32,7 @@ spec:
|
|||||||
- secretRef:
|
- secretRef:
|
||||||
name: inventory-cookies
|
name: inventory-cookies
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: inventory-mongodb
|
name: mongodb-user-password
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: inventory-s3
|
name: inventory-s3
|
||||||
name: inventory-app
|
name: inventory-app
|
||||||
|
|||||||
@@ -11,3 +11,4 @@ resources:
|
|||||||
- ./inventory-extras.yaml
|
- ./inventory-extras.yaml
|
||||||
- ./inventory-redirects.yaml
|
- ./inventory-redirects.yaml
|
||||||
- ./goredirect.yaml
|
- ./goredirect.yaml
|
||||||
|
- ./mongo.yaml
|
||||||
|
|||||||
89
hackerspace/mongo.yaml
Normal file
89
hackerspace/mongo.yaml
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: mongodb
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: mongodb
|
||||||
|
replicas: 1
|
||||||
|
minReadySeconds: 10
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: mongodb
|
||||||
|
spec:
|
||||||
|
terminationGracePeriodSeconds: 10
|
||||||
|
containers:
|
||||||
|
- name: mongodb
|
||||||
|
image: mongo:8
|
||||||
|
ports:
|
||||||
|
- containerPort: 27017
|
||||||
|
name: mongo
|
||||||
|
env:
|
||||||
|
- name: MONGO_INITDB_ROOT_USERNAME
|
||||||
|
value: "root"
|
||||||
|
- name: MONGO_INITDB_ROOT_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: mongodb-root-password
|
||||||
|
key: MONGO_INITDB_ROOT_PASSWORD
|
||||||
|
- name: MONGO_DBNAME
|
||||||
|
value: application
|
||||||
|
- name: MONGO_USER
|
||||||
|
value: application
|
||||||
|
- name: MONGO_PASS
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: mongodb-user-password
|
||||||
|
key: MONGO_PASS
|
||||||
|
- name: MONGO_AUTHSOURCE
|
||||||
|
value: "admin"
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /data/db
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: data
|
||||||
|
spec:
|
||||||
|
accessModes: [ "ReadWriteOnce" ]
|
||||||
|
storageClassName: ceph-rbd
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
|
---
|
||||||
|
apiVersion: codemowers.cloud/v1beta1
|
||||||
|
kind: SecretClaim
|
||||||
|
metadata:
|
||||||
|
name: mongodb-root-password
|
||||||
|
spec:
|
||||||
|
size: 32
|
||||||
|
mapping:
|
||||||
|
- key: MONGO_INITDB_ROOT_PASSWORD
|
||||||
|
value: "%(plaintext)s"
|
||||||
|
---
|
||||||
|
apiVersion: codemowers.cloud/v1beta1
|
||||||
|
kind: SecretClaim
|
||||||
|
metadata:
|
||||||
|
name: mongodb-user-password
|
||||||
|
spec:
|
||||||
|
size: 32
|
||||||
|
mapping:
|
||||||
|
- key: MONGO_PASS
|
||||||
|
value: "%(plaintext)s"
|
||||||
|
- key: MONGO_URI
|
||||||
|
value: "mongodb://application:%(plaintext)s@mongodb/application&authSource=admin"
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: mongodb
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 27017
|
||||||
|
name: mongo
|
||||||
|
targetPort: 27017
|
||||||
|
selector:
|
||||||
|
app: mongodb
|
||||||
|
type: ClusterIP
|
||||||
Reference in New Issue
Block a user