diff options
author | terminaldweller <thabogre@gmail.com> | 2021-10-31 01:44:00 +0000 |
---|---|---|
committer | terminaldweller <thabogre@gmail.com> | 2021-10-31 01:44:00 +0000 |
commit | 965a52ac2b20d0177719c86dc2a1d18903e9a017 (patch) | |
tree | 0ffdac57d934b761ec9230b5368cdf289d3fdd62 /kubernetes/mongodb | |
parent | opewrt,haproxy,nginx,ejabberd,.... (diff) | |
download | scripts-965a52ac2b20d0177719c86dc2a1d18903e9a017.tar.gz scripts-965a52ac2b20d0177719c86dc2a1d18903e9a017.zip |
updates
Diffstat (limited to 'kubernetes/mongodb')
-rw-r--r-- | kubernetes/mongodb/mongod.conf | 15 | ||||
-rw-r--r-- | kubernetes/mongodb/mongodb-configmap.yaml | 7 | ||||
-rw-r--r-- | kubernetes/mongodb/mongodb-data-volume.yaml | 12 | ||||
-rw-r--r-- | kubernetes/mongodb/mongodb-deployment.yaml | 66 | ||||
-rw-r--r-- | kubernetes/mongodb/mongodb-secret.yaml | 8 |
5 files changed, 108 insertions, 0 deletions
diff --git a/kubernetes/mongodb/mongod.conf b/kubernetes/mongodb/mongod.conf new file mode 100644 index 0000000..85d2bd9 --- /dev/null +++ b/kubernetes/mongodb/mongod.conf @@ -0,0 +1,15 @@ +# vim: ft=yaml +systemLog: + destination: file + path: "/var/log/mongodb/mongod.log" + logAppend: true +storage: + journal: + enabled: true +processManagement: + fork: true +net: + bindIp: 0.0.0.0 + port: 27017 +setParameter: + enableLocalhostAuthBypass: false diff --git a/kubernetes/mongodb/mongodb-configmap.yaml b/kubernetes/mongodb/mongodb-configmap.yaml new file mode 100644 index 0000000..19a484e --- /dev/null +++ b/kubernetes/mongodb/mongodb-configmap.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: mongodb-configmap +data: + mongodb_db__anime_name: anime + mongodb_db_manga_name: manga diff --git a/kubernetes/mongodb/mongodb-data-volume.yaml b/kubernetes/mongodb/mongodb-data-volume.yaml new file mode 100644 index 0000000..6b7d44b --- /dev/null +++ b/kubernetes/mongodb/mongodb-data-volume.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + name: mongo-data +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kubernetes/mongodb/mongodb-deployment.yaml b/kubernetes/mongodb/mongodb-deployment.yaml new file mode 100644 index 0000000..778fd60 --- /dev/null +++ b/kubernetes/mongodb/mongodb-deployment.yaml @@ -0,0 +1,66 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mongodb + labels: + app: mongodb +spec: + replicas: 1 + selector: + matchLabels: + app: mongodb + template: + metadata: + labels: + app: mongodb + spec: + containers: + - name: mongodb + image: mongo:4.4.10 + ports: + - containerPort: 27017 + - containerPort: 27018 + - containerPort: 27019 + env: + - name: MONGO_INITDB_ROOT_USERNAME + valueFrom: + secretKeyRef: + name: mongodb-secrets + key: mongodb-root-username + - name: MONGO_INITDB_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: mongodb-secrets + key: mongodb-root-password + volumeMounts: + - mountPath: /data/db + name: mongo-data + volumes: + - name: mongo-data + persistentVolumeClaim: + claimName: mongo-data +--- +apiVersion: v1 +kind: Service +metadata: + name: mongodb-service +spec: + selector: + app: mongodb + type: LoadBalancer + ports: + - protocol: TCP + name: "6617" + port: 27117 + targetPort: 27017 + nodePort: 30017 + - protocol: TCP + name: "6618" + port: 27118 + targetPort: 27018 + nodePort: 30018 + - protocol: TCP + name: "6619" + port: 27119 + targetPort: 27019 + nodePort: 30019 diff --git a/kubernetes/mongodb/mongodb-secret.yaml b/kubernetes/mongodb/mongodb-secret.yaml new file mode 100644 index 0000000..3a5fa46 --- /dev/null +++ b/kubernetes/mongodb/mongodb-secret.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Secret +metadata: + name: mongodb-secrets +type: Opaque +data: + mongodb-root-username: bW9uZ29hZG1pbgo= + mongodb-root-password: bW9uZ29hZG1pbgo= |