Skip to content
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

Namespace stuck in Terminating due to Permission and User #786

Open
MonicaMagoniCom opened this issue Mar 28, 2024 · 3 comments
Open

Namespace stuck in Terminating due to Permission and User #786

MonicaMagoniCom opened this issue Mar 28, 2024 · 3 comments
Labels
bug Something isn't working stale

Comments

@MonicaMagoniCom
Copy link

MonicaMagoniCom commented Mar 28, 2024

When I delete the rabbitmq namespace, it gets stuck in Terminating state due to some user and permission that cannot be deleted from message-topology-operator. From the describe of the user I see:
'failed to retrieve cluster from reference: Secret "rabbitmq-quorum-default-user" not found'

I saw an issue #324 which is fixed and it seems related to the same problem I have, but I'm using message-topology-operator version 1.13.0 and still experiencing the issue.

The only way to delete users and permission is to patch finalizers.

@MonicaMagoniCom MonicaMagoniCom added the bug Something isn't working label Mar 28, 2024
@Zerpet
Copy link
Contributor

Zerpet commented Apr 8, 2024

Could you provide some YAML and steps to reproduce this issue?

We test a similar scenario in our integration tests, and we don't observe this problem. YAML manifests and some steps would be incredibly helpful.

@MonicaMagoniCom
Copy link
Author

MonicaMagoniCom commented Apr 8, 2024

---
apiVersion: rabbitmq.com/v1beta1
kind: User
metadata:
  name: admin
  namespace: rabbitmq-system-quorum
spec:
  rabbitmqClusterReference:
    name: rabbitmq-quorum
    namespace: rabbitmq-system-quorum
---

apiVersion: rabbitmq.com/v1beta1
kind: Permission
metadata:
  name: comelit-permission
  namespace: rabbitmq-system-quorum
spec:
  vhost: "/"
  userReference:
    name: "admin" 
  permissions:
    write: ".*"
    configure: ".*"
    read: ".*"
  rabbitmqClusterReference:
    name: rabbitmq-quorum
    namespace: rabbitmq-system-quorum
apiVersion: rabbitmq.com/v1beta1
kind: RabbitmqCluster
metadata:
  labels:
    app: rabbitmq-quorum
  finalizers: []
  name: rabbitmq-quorum
  namespace: rabbitmq-system-quorum
spec:
  replicas: 3
  image: rabbitmq:3.12.8-management
  service:
    type: ClusterIP
  persistence:
    storageClassName: standard
    storage: 5Gi
  resources:
    requests:
      cpu: 150m
      memory: 3Gi
    limits:
      cpu: 500m
      memory: 3Gi
  rabbitmq:
    additionalPlugins:
      - rabbitmq_management
      - rabbitmq_peer_discovery_k8s
      - rabbitmq_prometheus
    additionalConfig: |
      cluster_formation.peer_discovery_backend = rabbit_peer_discovery_k8s
      cluster_formation.k8s.host = kubernetes.default.svc.cluster.local
      cluster_formation.k8s.address_type = hostname
      cluster_formation.k8s.service_name = rabbitmq-test
      vm_memory_high_watermark.relative = 0.65
      cluster_formation.node_cleanup.interval = 10
      cluster_formation.discovery_retry_interval = 500
      cluster_partition_handling = autoheal
      queue_master_locator = min-masters
      loopback_users.guest = false
      disk_free_limit.absolute = 1GB
    advancedConfig: ""
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/component: rabbitmq-operator-quorum
    app.kubernetes.io/name: rabbitmq-cluster-operator-quorum
    app.kubernetes.io/part-of: rabbitmq-quorum
  name: rabbitmq-cluster-operator-quorum
  namespace: rabbitmq-system-quorum
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: rabbitmq-cluster-operator-quorum
  template:
    metadata:
      labels:
        app.kubernetes.io/component: rabbitmq-operator-quorum
        app.kubernetes.io/name: rabbitmq-cluster-operator-quorum
        app.kubernetes.io/part-of: rabbitmq-quorum
    spec:
      containers:
        - command:
            - /manager
          env:
            - name: OPERATOR_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: OPERATOR_SCOPE_NAMESPACE
              value: rabbitmq-system-quorum
          image: rabbitmqoperator/cluster-operator:2.7.0
          name: operator-quorum
          ports:
            - containerPort: 9782
              name: metrics
              protocol: TCP
          resources:
            limits:
              cpu: 200m
              memory: 100Mi
            requests:
              cpu: 50m
              memory: 100Mi
      serviceAccountName: rabbitmq-cluster-operator-quorum
      terminationGracePeriodSeconds: 10

Copy link

github-actions bot commented Jun 8, 2024

This issue has been marked as stale due to 60 days of inactivity. Stale issues will be closed after a further 30 days of inactivity; please remove the stale label in order to prevent this occurring.

@github-actions github-actions bot added the stale label Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

2 participants