How to add labels on statefulset and pvc

241 views
Skip to first unread message

Payal Sasmal

unread,
Apr 13, 2021, 5:43:53 AM4/13/21
to rabbitmq-users
Hi All,

I would like to add labels for Statefulset and PVC, I am using latest version of CRD 0.5.0, RabbitMQ operator version 1.6.0 and RabbitMQ version is 3.8.14.

Here is the cr.yaml file for reference

crYaml: |-
  apiVersion: rabbitmq.com/v1beta1
  kind: RabbitmqCluster
  metadata:
    name: rabbitmqcluster
  spec:
    replicas: 3
    image: gcr.io/<path>/rabbitmq:3.8.14
    service:
      type: LoadBalancer
      annotations:
        cloud.google.com/load-balancer-type: "Internal"
        cloud.google.com/neg: '{"ingress": true}'
    persistence:
      storageClassName: standard
      storage: 10Gi
    resources:
      requests:
        cpu: 1000m
        memory: 2Gi
      limits:
        cpu: 1000m
        memory: 2Gi
    rabbitmq:
      additionalPlugins:
        - rabbitmq_sharding
        - rabbitmq_stomp
        - rabbitmq_shovel
        - rabbitmq_federation
        - rabbitmq_federation_management
      additionalConfig: |
        cluster_formation.peer_discovery_backend = rabbit_peer_discovery_k8s
        log.console.level = debug
    override:
      statefulSet:  
        spec:  
          template:  
            spec:  
              terminationGracePeriodSeconds: 7200
                containers:  
                  - name: rabbitmq  
                    volumeMounts:  
                      - mountPath: /opt/rabbitmq/community-plugins  
                        name: community-plugins  
                volumes:  
                  - name: community-plugins  
                    emptyDir: {}  
                initContainers:  
                  - command:  
                      - sh  
                      - -c
                      - |
                        curl -H "Authorization: Bearer <token>" <link to download> --output <output path here>
                    image: curlimages/curl  
                    imagePullPolicy: IfNotPresent  
                    name: copy-community-plugins  
                    resources:  
                      limits:   
                        cpu: 500m  
                        memory: 1Gi  
                      requests:  
                        cpu: 500m  
                        memory: 1Gi 
                    terminationMessagePolicy: FallbackToLogsOnError  
                    volumeMounts:  
                      - mountPath: /community-plugins/  
                        name: community-plugins

Could anyone please advice on this how to processed? 

Michal Kuratczyk

unread,
Apr 13, 2021, 9:55:55 AM4/13/21
to rabbitm...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/3bf167c8-5a6d-4c6d-a85f-c9d15161021en%40googlegroups.com.


--
Michał
RabbitMQ team

Payal Sasmal

unread,
Apr 14, 2021, 4:47:23 AM4/14/21
to rabbitmq-users
Hi Michal,

Thank you so much for your response. I have tried as per the above link for RabbitMQ pods and it is working. But I couldn't find out the way to add labels in PVC for RabbitMQ pods.

 Capture1.PNG.

Could you please provide suggestion/advice on it? 

Michal Kuratczyk

unread,
Apr 14, 2021, 5:29:18 AM4/14/21
to rabbitm...@googlegroups.com
Hi,

Yes, right now the Operator only passes the labels and annotations to the StatefulSet level, not volumeClaimTemplate within that Stefulset. Can you explain what the use case is for this?

Feel free to submit a PR if you need this soon - you'd need to add this to https://github.com/rabbitmq/cluster-operator/blob/main/internal/resource/statefulset.go

Best,




--
Michał
RabbitMQ team

Payal Sasmal

unread,
Apr 15, 2021, 12:27:12 AM4/15/21
to rabbitm...@googlegroups.com
Hi Michal,

Thank you for your response. Labels should be used on Production for billing purposes.

Can this feature be added for future releases? 


Thanks & Regards,
Payal Sasmal

You received this message because you are subscribed to a topic in the Google Groups "rabbitmq-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rabbitmq-users/ZM_VGTfpOlM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/CAA81d0tBzQbjR_T6fWo3d3VXhpCmEh%3Dy_DWB0sPGZEOPP_QX6A%40mail.gmail.com.

Michal Kuratczyk

unread,
Apr 15, 2021, 3:29:09 AM4/15/21
to rabbitm...@googlegroups.com
Hi,

We are not opposed to this feature so it can be added but we are currently working on other things. Given it's an important feature for you, I'd recommend submitting a PR as mentioned above.

Best,



--
Michał
RabbitMQ team

Payal Sasmal

unread,
Apr 21, 2021, 9:27:16 PM4/21/21
to rabbitm...@googlegroups.com
Hi Michal,

Thank you so much. 

Thanks & Regards,
Payal Sasmal
Reply all
Reply to author
Forward
0 new messages