Skip to content

Commit

Permalink
Merge pull request #1706 from percona/dev/K8SPSMDB-675
Browse files Browse the repository at this point in the history
K8SPSMDB-675: allow enabling/disabling sharding on a running cluster
  • Loading branch information
hors authored Dec 3, 2024
2 parents 43f0939 + eeb9cc6 commit dc110de
Show file tree
Hide file tree
Showing 25 changed files with 1,553 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,58 @@ spec:
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
- args:
- pbm-agent-entrypoint
command:
- /opt/percona/pbm-entry.sh
env:
- name: PBM_AGENT_MONGODB_USERNAME
valueFrom:
secretKeyRef:
key: MONGODB_BACKUP_USER
name: internal-some-name-users
optional: false
- name: PBM_AGENT_MONGODB_PASSWORD
valueFrom:
secretKeyRef:
key: MONGODB_BACKUP_PASSWORD
name: internal-some-name-users
optional: false
- name: PBM_MONGODB_REPLSET
value: cfg
- name: PBM_MONGODB_PORT
value: "27017"
- name: PBM_AGENT_SIDECAR
value: "true"
- name: PBM_AGENT_SIDECAR_SLEEP
value: "5"
- name: SHARDED
value: "TRUE"
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: PBM_MONGODB_URI
value: mongodb://$(PBM_AGENT_MONGODB_USERNAME):$(PBM_AGENT_MONGODB_PASSWORD)@$(POD_NAME)
- name: PBM_AGENT_TLS_ENABLED
value: "true"
imagePullPolicy: Always
name: backup-agent
resources: {}
securityContext:
runAsNonRoot: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /etc/mongodb-ssl
name: ssl
readOnly: true
- mountPath: /opt/percona
name: bin
readOnly: true
- mountPath: /data/db
name: mongod-data
dnsPolicy: ClusterFirst
initContainers:
- command:
Expand Down
52 changes: 52 additions & 0 deletions e2e-tests/expose-sharded/compare/statefulset_some-name-cfg-oc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,58 @@ spec:
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
- args:
- pbm-agent-entrypoint
command:
- /opt/percona/pbm-entry.sh
env:
- name: PBM_AGENT_MONGODB_USERNAME
valueFrom:
secretKeyRef:
key: MONGODB_BACKUP_USER
name: internal-some-name-users
optional: false
- name: PBM_AGENT_MONGODB_PASSWORD
valueFrom:
secretKeyRef:
key: MONGODB_BACKUP_PASSWORD
name: internal-some-name-users
optional: false
- name: PBM_MONGODB_REPLSET
value: cfg
- name: PBM_MONGODB_PORT
value: "27017"
- name: PBM_AGENT_SIDECAR
value: "true"
- name: PBM_AGENT_SIDECAR_SLEEP
value: "5"
- name: SHARDED
value: "TRUE"
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: PBM_MONGODB_URI
value: mongodb://$(PBM_AGENT_MONGODB_USERNAME):$(PBM_AGENT_MONGODB_PASSWORD)@$(POD_NAME)
- name: PBM_AGENT_TLS_ENABLED
value: "true"
imagePullPolicy: Always
name: backup-agent
resources: {}
securityContext:
runAsNonRoot: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /etc/mongodb-ssl
name: ssl
readOnly: true
- mountPath: /opt/percona
name: bin
readOnly: true
- mountPath: /data/db
name: mongod-data
dnsPolicy: ClusterFirst
initContainers:
- command:
Expand Down
53 changes: 53 additions & 0 deletions e2e-tests/expose-sharded/compare/statefulset_some-name-cfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,59 @@ spec:
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
- args:
- pbm-agent-entrypoint
command:
- /opt/percona/pbm-entry.sh
env:
- name: PBM_AGENT_MONGODB_USERNAME
valueFrom:
secretKeyRef:
key: MONGODB_BACKUP_USER
name: internal-some-name-users
optional: false
- name: PBM_AGENT_MONGODB_PASSWORD
valueFrom:
secretKeyRef:
key: MONGODB_BACKUP_PASSWORD
name: internal-some-name-users
optional: false
- name: PBM_MONGODB_REPLSET
value: cfg
- name: PBM_MONGODB_PORT
value: "27017"
- name: PBM_AGENT_SIDECAR
value: "true"
- name: PBM_AGENT_SIDECAR_SLEEP
value: "5"
- name: SHARDED
value: "TRUE"
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: PBM_MONGODB_URI
value: mongodb://$(PBM_AGENT_MONGODB_USERNAME):$(PBM_AGENT_MONGODB_PASSWORD)@$(POD_NAME)
- name: PBM_AGENT_TLS_ENABLED
value: "true"
imagePullPolicy: Always
name: backup-agent
resources: {}
securityContext:
runAsNonRoot: true
runAsUser: 1001
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /etc/mongodb-ssl
name: ssl
readOnly: true
- mountPath: /opt/percona
name: bin
readOnly: true
- mountPath: /data/db
name: mongod-data
dnsPolicy: ClusterFirst
initContainers:
- command:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,58 @@ spec:
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
- args:
- pbm-agent-entrypoint
command:
- /opt/percona/pbm-entry.sh
env:
- name: PBM_AGENT_MONGODB_USERNAME
valueFrom:
secretKeyRef:
key: MONGODB_BACKUP_USER
name: internal-some-name-users
optional: false
- name: PBM_AGENT_MONGODB_PASSWORD
valueFrom:
secretKeyRef:
key: MONGODB_BACKUP_PASSWORD
name: internal-some-name-users
optional: false
- name: PBM_MONGODB_REPLSET
value: rs0
- name: PBM_MONGODB_PORT
value: "27017"
- name: PBM_AGENT_SIDECAR
value: "true"
- name: PBM_AGENT_SIDECAR_SLEEP
value: "5"
- name: SHARDED
value: "TRUE"
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: PBM_MONGODB_URI
value: mongodb://$(PBM_AGENT_MONGODB_USERNAME):$(PBM_AGENT_MONGODB_PASSWORD)@$(POD_NAME)
- name: PBM_AGENT_TLS_ENABLED
value: "true"
imagePullPolicy: Always
name: backup-agent
resources: {}
securityContext:
runAsNonRoot: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /etc/mongodb-ssl
name: ssl
readOnly: true
- mountPath: /opt/percona
name: bin
readOnly: true
- mountPath: /data/db
name: mongod-data
dnsPolicy: ClusterFirst
initContainers:
- command:
Expand Down
52 changes: 52 additions & 0 deletions e2e-tests/expose-sharded/compare/statefulset_some-name-rs0-oc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,58 @@ spec:
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
- args:
- pbm-agent-entrypoint
command:
- /opt/percona/pbm-entry.sh
env:
- name: PBM_AGENT_MONGODB_USERNAME
valueFrom:
secretKeyRef:
key: MONGODB_BACKUP_USER
name: internal-some-name-users
optional: false
- name: PBM_AGENT_MONGODB_PASSWORD
valueFrom:
secretKeyRef:
key: MONGODB_BACKUP_PASSWORD
name: internal-some-name-users
optional: false
- name: PBM_MONGODB_REPLSET
value: rs0
- name: PBM_MONGODB_PORT
value: "27017"
- name: PBM_AGENT_SIDECAR
value: "true"
- name: PBM_AGENT_SIDECAR_SLEEP
value: "5"
- name: SHARDED
value: "TRUE"
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: PBM_MONGODB_URI
value: mongodb://$(PBM_AGENT_MONGODB_USERNAME):$(PBM_AGENT_MONGODB_PASSWORD)@$(POD_NAME)
- name: PBM_AGENT_TLS_ENABLED
value: "true"
imagePullPolicy: Always
name: backup-agent
resources: {}
securityContext:
runAsNonRoot: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /etc/mongodb-ssl
name: ssl
readOnly: true
- mountPath: /opt/percona
name: bin
readOnly: true
- mountPath: /data/db
name: mongod-data
dnsPolicy: ClusterFirst
initContainers:
- command:
Expand Down
Loading

0 comments on commit dc110de

Please sign in to comment.