Skip to content

Logging solely to stdout without creating PVC for logs #1715

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
iilr-g opened this issue May 13, 2025 · 0 comments
Open

Logging solely to stdout without creating PVC for logs #1715

iilr-g opened this issue May 13, 2025 · 0 comments

Comments

@iilr-g
Copy link

iilr-g commented May 13, 2025

What did you do to encounter the bug?
Unable to:

  • Remove logs-volume PVC.

What did you expect?
I expected logging directed solely to stdout, without creating a logs-volume PVC.

What happened instead?
A log-volume is created every time for every pod.

Operator Information

  • v0.12.0
  • MongoDB - v8.0.5
    agent v107.0.7.8596-1

Kubernetes Cluster Information

  • private registry (proxy cache for air gapped environments)

My yaml:

 ```---
apiVersion: mongodbcommunity.mongodb.com/v1
kind: MongoDBCommunity
metadata:
  name: mongodb
  namespace: bbdd
spec:
  members: 2
  arbiters: 1
  type: ReplicaSet
  version: "8.0.5"
  additionalMongodConfig:
    systemLog:
      destination: "file"
      path: "/var/log/mongodb/mongod.log"
  statefulSet:
    spec:
      resources:
        requests:
          memory: 2Gi   #
          cpu: 1 # cambiar en prod a 4
        limits:
          memory: 2Gi  
          cpu: 1  # cambiar en prod a 4
      volumeClaimTemplates:
        - metadata:
            name: data-volume
          spec:
            resources:
              requests:
                storage: 2Gi 
            storageClassName: nfs-135
        # - metadata:
        #     name: logs-volume
        #   spec:
        #     storageClassName: nfs-135
        #     resources:
        #       requests:
        #         storage: 2G
      selector:
        matchLabels:
          app.kubernetes.io/name: mongodb
      template:
        metadata:
          # label the pod which is used by the "labelSelector" in podAntiAffinty
          # you can label it witch some other labels as well -- make sure it change the podAntiAffinity labelselector accordingly
          labels:
           app.kubernetes.io/name: mongodb
        spec:
          containers:
            - name: mongod
              image:my-repo/hub.docker.com/mongodb/mongodb-community-server:8.0.5-ubi8
          affinity:
            podAntiAffinity:
              preferredDuringSchedulingIgnoredDuringExecution:
                - weight: 100
                  podAffinityTerm:
                    labelSelector:
                      matchExpressions:
                        - key: app.kubernetes.io/name
                          operator: In
                          values:
                            - mongodb
                    topologyKey: kubernetes.io/hostname
  security:
    authentication:
      modes: ["SCRAM"]
    tls:
      enabled: false ``` 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant