Skip to content

Commit

Permalink
Updated to new MongoDB image
Browse files Browse the repository at this point in the history
Updated to Bitnami MongoDB image
  • Loading branch information
saintdle authored Aug 26, 2021
1 parent 387e9ec commit d11477b
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 11 deletions.
55 changes: 46 additions & 9 deletions deployments/mongo-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ metadata:
labels:
name: mongo
name: mongo
annotations:
source: "https://github.com/saintdle/pacman-tanzu"
spec:
replicas: 1
selector:
Expand All @@ -14,20 +16,56 @@ spec:
labels:
name: mongo
spec:
initContainers:
- args:
- |
mkdir -p /bitnami/mongodb
chown -R "1001:1001" "/bitnami/mongodb"
command:
- /bin/bash
- -ec
image: docker.io/bitnami/bitnami-shell:10-debian-10-r158
imagePullPolicy: Always
name: volume-permissions
resources: {}
securityContext:
runAsUser: 0
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /bitnami/mongodb
name: mongo-db
restartPolicy: Always
schedulerName: default-scheduler
securityContext:
fsGroup: 1001
serviceAccount: default
serviceAccountName: default
terminationGracePeriodSeconds: 30
volumes:
- name: mongo-db
persistentVolumeClaim:
claimName: mongo-storage
containers:
- image: centos/mongodb-36-centos7
- image: bitnami/mongodb:4.4.8
name: mongo
env:
- name: MONGODB_ADMIN_PASSWORD
value: clyde
- name: MONGODB_ROOT_PASSWORD
valueFrom:
secretKeyRef:
key: database-admin-password
name: mongodb-users-secret
- name: MONGODB_DATABASE
value: pacman
valueFrom:
secretKeyRef:
key: database-name
name: mongodb-users-secret
- name: MONGODB_PASSWORD
valueFrom:
secretKeyRef:
key: database-password
name: mongodb-users-secret
- name: MONGODB_USER
- name: MONGODB_USERNAME
valueFrom:
secretKeyRef:
key: database-user
Expand All @@ -38,16 +76,15 @@ spec:
- /bin/sh
- -i
- -c
- mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USER -p $MONGODB_PASSWORD
- mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USERNAME -p $MONGODB_PASSWORD
--eval="quit()"
ports:
- name: mongo
containerPort: 27017
volumeMounts:
- name: mongo-db
mountPath: /data/db
mountPath: /bitnami/mongodb/
volumes:
- name: mongo-db
persistentVolumeClaim:
claimName: mongo-storage

claimName: mongo-storage
4 changes: 3 additions & 1 deletion deployments/pacman-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ metadata:
labels:
name: pacman
name: pacman
annotations:
source: "https://github.com/saintdle/pacman-tanzu"
spec:
replicas: 1
selector:
Expand Down Expand Up @@ -46,4 +48,4 @@ spec:
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
fieldPath: spec.nodeName
1 change: 1 addition & 0 deletions persistentvolumeclaim/mongo-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: mongo-storage
namespace: pacman
spec:
accessModes:
- ReadWriteOnce
Expand Down
3 changes: 2 additions & 1 deletion security/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ apiVersion: v1
kind: Secret
metadata:
name: mongodb-users-secret
namespace: pacman
namespace: pacman-052
type: Opaque
data:
database-admin-name: Y2x5ZGU=
database-admin-password: Y2x5ZGU=
database-name: cGFjbWFu
database-password: cGlua3k=
Expand Down

0 comments on commit d11477b

Please sign in to comment.