started a Mongo cluster using the MongoDBCommunity custom resource
What did you expect?
The mongo service created mongod-svc to have a cluster-ip assigned to it, allowing for the creation of an ingress service.
What happened instead?
The service is created with no cluster-ip assigned
Screenshots
Kubernetes Cluster Information
EKS
v1.30.5-eks-ce1d5eb
Additional contextmongo_manifest.yaml:
---
apiVersion: mongodbcommunity.mongodb.com/v1
kind: MongoDBCommunity
metadata:
name: mongodb
spec:
members: 1
type: ReplicaSet
version: "8.0.0"
security:
authentication:
modes: ["SCRAM"]
users:
- name: my-user
db: admin
passwordSecretRef: # a reference to the secret that will be used to generate the user's password
name: my-user-password
roles:
- name: clusterAdmin
db: admin
- name: userAdminAnyDatabase
db: admin
scramCredentialsSecretName: my-scram
statefulSet:
spec:
# the storage class name must be the same as the one used in the volumeClaimTemplates, and this is where we define the use of our storage class
# https://github.com/mongodb/mongodb-kubernetes-operator/issues/961#issuecomment-1113549548
service:
spec:
type: ClusterIP
clusterIP: ""
volumeClaimTemplates:
- metadata:
name: data-volume
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: "dev-ebs-sc-hot-storage"
resources:
requests:
storage: 1Gi
- metadata:
name: logs-volume
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: "dev-ebs-sc-hot-storage"
resources:
requests:
storage: 1Gi
additionalMongodConfig:
storage.wiredTiger.engineConfig.journalCompressor: zlib
# the user credentials will be generated from this secret
# once the credentials are generated, this secret is no longer required
---
apiVersion: v1
kind: Secret
metadata:
name: my-user-password
type: Opaque
stringData:
password: <your-password-here>
After further investigation, I've found this to be the desired behaviour - as to coordinate access to a StatefulSet a headless service is created. This is working as intended.
What did you do to encounter the bug?
What did you expect? The mongo service created
mongod-svc
to have a cluster-ip assigned to it, allowing for the creation of an ingress service.What happened instead? The service is created with no cluster-ip assigned
Screenshots
Kubernetes Cluster Information
Additional context
mongo_manifest.yaml
: