Skip to content

Commit

Permalink
K8SPSMDB-1101: fix usage of custom tls certificate
Browse files Browse the repository at this point in the history
  • Loading branch information
pooknull committed Jun 5, 2024
1 parent 5f7f7f7 commit 9d789ff
Show file tree
Hide file tree
Showing 9 changed files with 1,329 additions and 7 deletions.
206 changes: 206 additions & 0 deletions e2e-tests/custom-tls/compare/statefulset_some-name-cfg-oc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
annotations: {}
generation: 1
labels:
app.kubernetes.io/component: cfg
app.kubernetes.io/instance: some-name
app.kubernetes.io/managed-by: percona-server-mongodb-operator
app.kubernetes.io/name: percona-server-mongodb
app.kubernetes.io/part-of: percona-server-mongodb
app.kubernetes.io/replset: cfg
name: some-name-cfg
ownerReferences:
- controller: true
kind: PerconaServerMongoDB
name: some-name
spec:
podManagementPolicy: OrderedReady
replicas: 3
revisionHistoryLimit: 10
selector:
matchLabels:
app.kubernetes.io/component: cfg
app.kubernetes.io/instance: some-name
app.kubernetes.io/managed-by: percona-server-mongodb-operator
app.kubernetes.io/name: percona-server-mongodb
app.kubernetes.io/part-of: percona-server-mongodb
app.kubernetes.io/replset: cfg
serviceName: some-name-cfg
template:
metadata:
annotations: {}
labels:
app.kubernetes.io/component: cfg
app.kubernetes.io/instance: some-name
app.kubernetes.io/managed-by: percona-server-mongodb-operator
app.kubernetes.io/name: percona-server-mongodb
app.kubernetes.io/part-of: percona-server-mongodb
app.kubernetes.io/replset: cfg
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app.kubernetes.io/component: cfg
app.kubernetes.io/instance: some-name
app.kubernetes.io/managed-by: percona-server-mongodb-operator
app.kubernetes.io/name: percona-server-mongodb
app.kubernetes.io/part-of: percona-server-mongodb
app.kubernetes.io/replset: cfg
topologyKey: kubernetes.io/hostname
containers:
- args:
- --bind_ip_all
- --auth
- --dbpath=/data/db
- --port=27017
- --replSet=cfg
- --storageEngine=wiredTiger
- --relaxPermChecks
- --sslAllowInvalidCertificates
- --clusterAuthMode=x509
- --tlsMode=preferTLS
- --configsvr
- --enableEncryption
- --encryptionKeyFile=/etc/mongodb-encryption/encryption-key
- --wiredTigerIndexPrefixCompression=true
- --quiet
command:
- /opt/percona/ps-entry.sh
env:
- name: SERVICE_NAME
value: some-name
- name: MONGODB_PORT
value: "27017"
- name: MONGODB_REPLSET
value: cfg
envFrom:
- secretRef:
name: internal-some-name-users
optional: false
imagePullPolicy: Always
livenessProbe:
exec:
command:
- /opt/percona/mongodb-healthcheck
- k8s
- liveness
- --ssl
- --sslInsecure
- --sslCAFile
- /etc/mongodb-ssl/ca.crt
- --sslPEMKeyFile
- /tmp/tls.pem
- --startupDelaySeconds
- "7200"
failureThreshold: 4
initialDelaySeconds: 60
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 10
name: mongod
ports:
- containerPort: 27017
name: mongodb
protocol: TCP
readinessProbe:
exec:
command:
- /opt/percona/mongodb-healthcheck
- k8s
- readiness
- --component
- mongod
failureThreshold: 3
initialDelaySeconds: 10
periodSeconds: 3
successThreshold: 1
timeoutSeconds: 2
resources: {}
securityContext:
runAsNonRoot: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /data/db
name: mongod-data
- mountPath: /etc/mongodb-secrets
name: some-name-mongodb-keyfile
readOnly: true
- mountPath: /etc/mongodb-ssl
name: ssl
readOnly: true
- mountPath: /etc/mongodb-ssl-internal
name: ssl-internal
readOnly: true
- mountPath: /opt/percona
name: bin
- mountPath: /etc/mongodb-encryption
name: some-name-mongodb-encryption-key
readOnly: true
- mountPath: /etc/users-secret
name: users-secret-file
workingDir: /data/db
dnsPolicy: ClusterFirst
initContainers:
- command:
- /init-entrypoint.sh
imagePullPolicy: Always
name: mongo-init
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /data/db
name: mongod-data
- mountPath: /opt/percona
name: bin
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
serviceAccount: default
serviceAccountName: default
terminationGracePeriodSeconds: 60
volumes:
- name: some-name-mongodb-keyfile
secret:
defaultMode: 288
optional: false
secretName: some-name-mongodb-keyfile
- emptyDir: {}
name: bin
- name: some-name-mongodb-encryption-key
secret:
defaultMode: 288
optional: false
secretName: some-name-mongodb-encryption-key
- name: ssl
secret:
defaultMode: 288
optional: false
secretName: some-name-ssl
- name: ssl-internal
secret:
defaultMode: 288
optional: true
secretName: some-name-ssl-internal
- name: users-secret-file
secret:
defaultMode: 420
secretName: internal-some-name-users
updateStrategy:
type: OnDelete
volumeClaimTemplates:
- metadata:
name: mongod-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 3Gi
status:
phase: Pending
Loading

0 comments on commit 9d789ff

Please sign in to comment.