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

Incorrect Pod Labels Applied by ArangoDB Kubernetes Operator #1847

Closed
Dibz15 opened this issue Mar 12, 2025 · 5 comments
Closed

Incorrect Pod Labels Applied by ArangoDB Kubernetes Operator #1847

Dibz15 opened this issue Mar 12, 2025 · 5 comments

Comments

@Dibz15
Copy link

Dibz15 commented Mar 12, 2025

Description:
When deploying an ArangoDeployment in Single mode, the created pods are labeled incorrectly. Despite explicitly specifying a pod label as role: single in the ArangoDeployment CRD, the operator consistently labels pods with role: id. This mismatch breaks service selectors and prevents the service from routing traffic correctly.

Affected Component:
ArangoDB Kubernetes Operator

Operator Version: 1.2.44

Kubernetes Distribution and Version:
K3s v1.32.1

Expected Behavior:
When specifying labels explicitly in the ArangoDeployment, pods created by the operator should use those labels. For example:

spec:
  mode: Single
  single:
    labels:
      role: single

Pods should have labels:

app=arangodb
arango_deployment=single-server
role=single

Actual Behavior:
Pods are incorrectly labeled with:

app=arangodb
arango_deployment=single-server
role=id

Steps to Reproduce:

  1. Deploy the ArangoDB Operator via Helm.
  2. Create an ArangoDeployment with explicit labels as shown above.
  3. Observe pod labels after deployment.

Workaround:
Manually creating a separate Kubernetes Service that matches the operator-generated pod labels:

apiVersion: v1
kind: Service
metadata:
  name: arango-single-server-custom
spec:
  type: LoadBalancer
  ports:
    - port: 8529
      targetPort: 8529
  selector:
    app: arangodb
    arango_deployment: single-server
    role: id

Suggested Fix:
Ensure the operator correctly applies labels specified in the ArangoDeployment resource definition.

Additional Information:

  • Kubernetes version:
    Client Version: v1.31.5+k3s1
    Kustomize Version: v5.4.2
    Server Version: v1.31.5+k3s1
@ajanikow
Copy link
Collaborator

Hello!

The ID Pod is temporary and used only for image discovery. It will be removed right after version discovery. If it has been active for longer, please check the Operator logs—there might be a connection issue between the Operator and the ID pod.

Then, the proper one with id=single will start.

Best Regards,
Adam.

@Dibz15
Copy link
Author

Dibz15 commented Mar 14, 2025

Hi, thanks for getting back to me.

Here are my logs from my operator. I'm not sure that I see anything suspicious, but that's just because I don't see any errors.

2025-03-06T09:46:11Z INF Accepted new spec name=single-server namespace=default operator-id=hj2cr
2025-03-06T09:46:11Z INF Accepted new spec name=single-server namespace=default operator-id=hj2cr
2025-03-06T09:46:12Z INF Updated condition condition=SpecAccepted hash=daeee8022a6e6132f7c9ea8e8d0493775cad2a418b49b2d59632014af4334466 name=single-server namespace=default operator-id=hj2cr reason="Spec Accepted" status=true
2025-03-06T09:46:12Z INF Kubernetes request has been send kind=Service name=single-server-single operator-id=hj2cr verb=create
2025-03-06T09:46:12Z INF Kubernetes request has been send kind=Service name=single-server-int operator-id=hj2cr verb=create
2025-03-06T09:46:12Z INF Kubernetes request has been send kind=Service name=single-server operator-id=hj2cr verb=create
2025-03-06T09:46:12Z INF Kubernetes request has been send kind=Service name=single-server-ea operator-id=hj2cr verb=create
2025-03-06T09:46:13Z INF Kubernetes request has been send kind=Secret name=single-server-jwt operator-id=hj2cr verb=create
2025-03-06T09:46:13Z INF Kubernetes request has been send kind=ArangoProfile name=single-server-int operator-id=hj2cr verb=create
2025-03-06T09:46:13Z INF Kubernetes request has been send kind=ArangoProfile name=single-server-int-authz-v0 operator-id=hj2cr verb=create
2025-03-06T09:46:13Z INF Kubernetes request has been send kind=ArangoProfile name=single-server-int-authn-v1 operator-id=hj2cr verb=create
2025-03-06T09:46:13Z INF Kubernetes request has been send kind=ArangoProfile name=single-server-int-sched-v1 operator-id=hj2cr verb=create
2025-03-06T09:46:14Z INF Kubernetes request has been send kind=ArangoProfile name=single-server-int-sched-v2 operator-id=hj2cr verb=create
2025-03-06T09:46:14Z INF Kubernetes request has been send kind=ArangoProfile name=single-server-int-shutdown-v1 operator-id=hj2cr verb=create
2025-03-06T09:46:14Z INF Kubernetes request has been send kind=ArangoProfile name=single-server-int-envoy-v3 operator-id=hj2cr verb=create
2025-03-06T09:46:17Z INF Kubernetes request has been send kind=Pod name=single-server-id-aca85a operator-id=hj2cr verb=create

If I create a new service spec to select for the role: id, then my endpoints work, and I'm able to load up the web GUI of the Arango pod. Are there any other logs or details that I could provide?

@ajanikow
Copy link
Collaborator

Hello!

It will work, but you will then be redirected to the ID Pod, which is just a dummy pod without any persistence.

Can you please increase the log level on Operator to Debug? As ImageDiscovery is not reported at the Info level.

Please add the argument '--log.level=debug' to the Operator args.

I have reproduced this when the Operator could not connect the ID Pod.

BR,
Adam.

@ajanikow
Copy link
Collaborator

Hello @Dibz15 !

Were you able to solve the issue with connectivity?

BR,
Adam.

@ajanikow
Copy link
Collaborator

Hello @Dibz15 !

Please reopen the ticket if it still affects your deployment.

Best Regards,
Adam.

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

2 participants