Hello together,
I’ve been using the community-operator for quite a while now. It used to be working fine with kubernetes 1.25. After upgrading our cluster to kubernetes 1.26, I’m not able to launch a mongodb any more. The two nodes come up, are getting green, and seconds later, the cluster is shutting down.
What really irritates me is, that in line 118, the log states:
“ctx”:“ReplCoord-0”,“msg”:“Member is in new state”,“attr”:{“hostAndPort”:“basys-mongodb-d-0.basys-mongodb-d-svc.ophq-jhi.svc.cluster.local:27017”,“newState”:“PRIMARY”}}
So in general everything should be fine - the two nodes are talking to each other.
The mongodb-agent takes about 4-5 minutes to get ready, stating only this:
cat: /mongodb-automation/agent-api-key/agentApiKey: No such file or directory
2024-01-24T15:26:50.263410344Z [2024-01-24T15:26:50.263+0000] [.debug] [util/distros/distros.go:LinuxFlavorAndVersionUncached:142] Detected linux flavor ubuntu version 20.4
→ I assume, that the /mongodb-automation folder is optional and not required. If required, please help how to get that…
Thanks in advance for any help
Here is the crd:
apiVersion: mongodbcommunity.mongodb.com/v1
kind: MongoDBCommunity
metadata:
annotations:
meta.helm.sh/release-name: ophq-jhi
meta.helm.sh/release-namespace: ophq-jhi
mongodb.com/v1.lastAppliedMongoDBVersion: 4.4.0
mongodb.com/v1.lastSuccessfulConfiguration: >-
{"members":2,"type":"ReplicaSet","version":"4.4.0","arbiters":0,"security":{"authentication":{"modes":["SCRAM"],"ignoreUnknownUsers":true},"tls":{"enabled":false,"optional":false,"certificateKeySecretRef":{}}},"users":[{"name":"basys","db":"admin","passwordSecretRef":{"name":"basys-mongodb-secret","key":""},"roles":[{"db":"admin","name":"clusterAdmin"},{"db":"admin","name":"userAdminAnyDatabase"},{"db":"admin","name":"readWriteAnyDatabase"}],"scramCredentialsSecretName":"basys-scram","additionalConnectionStringConfig":null}],"statefulSet":{"spec":{},"metadata":{}},"agent":{"logLevel":"","logFile":"","maxLogFileDurationHours":0},"additionalMongodConfig":{},"additionalConnectionStringConfig":{}}
creationTimestamp: '2024-01-24T13:19:08Z'
generation: 1
labels:
app.kubernetes.io/managed-by: Helm
managedFields:
- apiVersion: mongodbcommunity.mongodb.com/v1
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
.: {}
f:meta.helm.sh/release-name: {}
f:meta.helm.sh/release-namespace: {}
f:labels:
.: {}
f:app.kubernetes.io/managed-by: {}
f:spec:
.: {}
f:additionalMongodConfig:
.: {}
f:storage.wiredTiger.engineConfig.journalCompressor: {}
f:members: {}
f:security:
.: {}
f:authentication:
.: {}
f:ignoreUnknownUsers: {}
f:modes: {}
f:statefulSet:
.: {}
f:spec:
.: {}
f:template:
.: {}
f:spec:
.: {}
f:containers: {}
f:type: {}
f:users: {}
f:version: {}
manager: helm
operation: Update
time: '2024-01-24T13:19:08Z'
- apiVersion: mongodbcommunity.mongodb.com/v1
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
f:mongodb.com/v1.lastAppliedMongoDBVersion: {}
f:mongodb.com/v1.lastSuccessfulConfiguration: {}
manager: manager
operation: Update
time: '2024-01-24T14:14:27Z'
- apiVersion: mongodbcommunity.mongodb.com/v1
fieldsType: FieldsV1
fieldsV1:
f:status:
.: {}
f:currentMongoDBMembers: {}
f:currentStatefulSetReplicas: {}
f:message: {}
f:mongoUri: {}
f:phase: {}
f:version: {}
manager: manager
operation: Update
subresource: status
time: '2024-01-24T15:22:29Z'
name: basys-mongodb-d
namespace: ophq-jhi
resourceVersion: '89591055'
uid: eec6d4de-6f54-4ef3-bea5-0f473bc22323
spec:
additionalMongodConfig:
storage.wiredTiger.engineConfig.journalCompressor: zlib
members: 2
security:
authentication:
ignoreUnknownUsers: true
modes:
- SCRAM
statefulSet:
spec:
template:
spec:
containers:
- name: mongod
resources:
limits:
cpu: '10'
memory: 2000M
requests:
cpu: '0.1'
memory: 200M
- name: mongodb-agent
readinessProbe:
exec:
command:
- /opt/scripts/readinessprobe
failureThreshold: 40
initialDelaySeconds: 60
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
cpu: '2'
memory: 2000M
requests:
cpu: '0.1'
memory: 200M
type: ReplicaSet
users:
- db: admin
name: basys
passwordSecretRef:
name: basys-mongodb-secret
roles:
- db: admin
name: clusterAdmin
- db: admin
name: userAdminAnyDatabase
- db: admin
name: readWriteAnyDatabase
scramCredentialsSecretName: basys-scram
version: 4.4.0
status:
currentMongoDBMembers: 2
currentStatefulSetReplicas: 2
message: ReplicaSet is not yet ready, retrying in 10 seconds
mongoUri: >-
mongodb://basys-mongodb-d-0.basys-mongodb-d-svc.ophq-jhi.svc.cluster.local:27017,basys-mongodb-d-1.basys-mongodb-d-svc.ophq-jhi.svc.cluster.local:27017/?replicaSet=basys-mongodb-d
phase: Pending
version: 4.4.0