Open kbreit-insight opened 1 month ago
I tried to set my cluster-server
service to have only a single port and it continued to exhibit this behavior.
2024-07-11T16:06:32.475Z [ERROR] There are multiple Consul services registered for this pod when there must only be one. Check if there are multiple Kubernetes services selecting this pod and add the label `consul.hashicorp.com/service-ignore: "true"` to all services except the one used by Consul for handling requests.
on aiocp2(rabbitmq) ~
➜ kubectl get svc --show-labels
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE LABELS
cluster ClusterIP 172.30.237.192 <none> 15672/TCP,15692/TCP,5672/TCP 64d app.kubernetes.io/component=rabbitmq,app.kubernetes.io/name=cluster,app.kubernetes.io/part-of=rabbitmq,consul.hashicorp.com/service-ignore=true
cluster-nodes ClusterIP None <none> 4369/TCP,25672/TCP 64d app.kubernetes.io/component=rabbitmq,app.kubernetes.io/name=cluster,app.kubernetes.io/part-of=rabbitmq,consul.hashicorp.com/service-ignore=true
cluster-server ClusterIP 172.30.99.122 <none> 5672/TCP 2d1h app.kubernetes.io/component=rabbitmq,app.kubernetes.io/name=cluster-server,app.kubernetes.io/part-of=rabbitmq
Community Note
Overview of the Issue
I am deploying RabbitMQ and integrating it into a Consul service mesh. RabbitMQ ships with multiple services pointing towards it server. The
consul-connect-inject-init
init container is giving errors that there are multiple services pointing to the pod and I should set theconsul.hashicorp.com/service-ignore=true
label. All but one of the services has this label assigned but it's still giving the error.Reproduction Steps
Deploy RabbitMQ operator using the instructions at https://www.rabbitmq.com/kubernetes/operator/operator-overview. Alternatively, a statefulset could be deployed with a similar configuration for POC, but I haven't tested it with that setup. Deploy the operator controller with the following manifest. Note, some of this may be populated automatically.
Logs
Expected behavior
The pod should come up as it should not see the services which have this label.
Environment details
consul-k8s
version: v1.18.2values.yaml
used to deploy the helm chart:Kubernetes version: v1.28.10
Cloud Provider (If self-hosted, the Kubernetes provider utilized): OpenShift 4.15.17 on vSphere
Networking CNI plugin in use: Multus