mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Support for TLS connections in MongoDB StatefulSet
This commit is contained in:
parent
06f0f8d95e
commit
cf10d3199e
@ -4,10 +4,9 @@ WORKDIR /
|
|||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get -y upgrade \
|
&& apt-get -y upgrade \
|
||||||
&& apt-get autoremove \
|
&& apt-get autoremove \
|
||||||
&& apt-get clean \
|
&& apt-get clean
|
||||||
&& mkdir /mongo-ssl
|
|
||||||
COPY mongod.conf.template /etc/mongod.conf
|
COPY mongod.conf.template /etc/mongod.conf
|
||||||
COPY mongod_entrypoint.bash /
|
COPY mongod_entrypoint.bash /
|
||||||
VOLUME /data/db /data/configdb /mongo-ssl
|
VOLUME /data/db /data/configdb /etc/mongod/ssl
|
||||||
EXPOSE 27017
|
EXPOSE 27017
|
||||||
ENTRYPOINT ["/mongod_entrypoint.bash"]
|
ENTRYPOINT ["/mongod_entrypoint.bash"]
|
||||||
|
@ -21,23 +21,37 @@ spec:
|
|||||||
terminationGracePeriodSeconds: 10
|
terminationGracePeriodSeconds: 10
|
||||||
containers:
|
containers:
|
||||||
- name: mongodb
|
- name: mongodb
|
||||||
image: bigchaindb/mongodb:3.4.3
|
image: bigchaindb/mongodb:3.4.4
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: Always
|
||||||
env:
|
env:
|
||||||
- name: MONGODB_FQDN
|
- name: MONGODB_FQDN
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
name: mdb-fqdn
|
name: vars
|
||||||
key: fqdn
|
key: mdb-instance-name
|
||||||
- name: MONGODB_POD_IP
|
- name: MONGODB_POD_IP
|
||||||
valueFrom:
|
valueFrom:
|
||||||
fieldRef:
|
fieldRef:
|
||||||
fieldPath: status.podIP
|
fieldPath: status.podIP
|
||||||
|
- name: MONGODB_REPLICA_SET_NAME
|
||||||
|
value: bigchain-rs
|
||||||
|
- name: MONGODB_PORT
|
||||||
|
value: "27017"
|
||||||
args:
|
args:
|
||||||
- --replica-set-name=bigchain-rs
|
- --mongodb-port
|
||||||
- --fqdn=$(MONGODB_FQDN)
|
- $(MONGODB_PORT)
|
||||||
- --port=27017
|
- --mongodb-key-file-path
|
||||||
- --ip=$(MONGODB_POD_IP)
|
- /etc/mongod/ssl/mdb-instance.pem
|
||||||
|
- --mongodb-ca-file-path
|
||||||
|
- /etc/mongod/ssl/ca.pem
|
||||||
|
- --mongodb-crl-file-path
|
||||||
|
- /etc/mongod/ssl/mdb-crl.pem
|
||||||
|
- --replica-set-name
|
||||||
|
- $(MONGODB_REPLICA_SET_NAME)
|
||||||
|
- --mongodb-fqdn
|
||||||
|
- $(MONGODB_FQDN)
|
||||||
|
- --mongodb-ip
|
||||||
|
- $(MONGODB_POD_IP)
|
||||||
securityContext:
|
securityContext:
|
||||||
capabilities:
|
capabilities:
|
||||||
add:
|
add:
|
||||||
@ -52,6 +66,9 @@ spec:
|
|||||||
mountPath: /data/db
|
mountPath: /data/db
|
||||||
- name: mdb-configdb
|
- name: mdb-configdb
|
||||||
mountPath: /data/configdb
|
mountPath: /data/configdb
|
||||||
|
- name: mdb-certs
|
||||||
|
mountPath: /etc/mongod/ssl/
|
||||||
|
readOnly: true
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpu: 200m
|
cpu: 200m
|
||||||
@ -71,3 +88,7 @@ spec:
|
|||||||
- name: mdb-configdb
|
- name: mdb-configdb
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: mongo-configdb-claim
|
claimName: mongo-configdb-claim
|
||||||
|
- name: mdb-certs
|
||||||
|
secret:
|
||||||
|
secretName: mdb-certs
|
||||||
|
defaultMode: 0400
|
||||||
|
Loading…
x
Reference in New Issue
Block a user