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

Argo CD Helm chart: StatefulSet serviceName refers to missing service. #2302

Open
harryw opened this issue Oct 18, 2023 · 4 comments
Open

Argo CD Helm chart: StatefulSet serviceName refers to missing service. #2302

harryw opened this issue Oct 18, 2023 · 4 comments

Comments

@harryw
Copy link

harryw commented Oct 18, 2023

Describe the bug

I found that the serviceName in the StatefulSet argocd-application-controller refers to a Service that doesn't exist.

Essentially this StatefulSet template points to a Service with the same name, but there's no matching Service template. I'm not familiar enough with Argo CD's setup to guess what the intention is, but it seems like an error.

This issue does not actually exhibit any symptoms for me. I discovered this while testing out K8sGPT, which highlighted the issue:

0 argocd/argocd-application-controller(argocd-application-controller)
- Error: StatefulSet uses the service argocd/argocd-application-controller which does not exist.
Error: The StatefulSet is using a service called argocd/argocd-application-controller which does not exist.

Solution: 

1. Verify that the service argocd/argocd-application-controller is actually missing.
2. If it is missing, create the service using the correct configuration.
3. Update the StatefulSet to use the newly created service.

At first I thought K8sGPT might be wrong but on investigation it seems to be telling the truth.

Related helm chart

argo-cd

Helm chart version

5.46.8

To Reproduce

Install the Argo CD helm chart with default values.

Examine the argocd-application-controller stateful set. The serviceName is argocd-application-controller.

There is no service named argocd-application-controller. There's one named argocd-applicationset-controller, and I didn't see the difference at first.

Expected behavior

serviceName should refer to a service that exists.

Screenshots

No response

Additional context

No response

@DrFaust92
Copy link
Contributor

FYI, While you are right and this is unused, it seems that its a breaking change to remove that field

@pdrastil
Copy link
Member

Hi - this might be wrong and is caused by switch from Deployment to StatefulSet that happened in upstream a year ago. The manifest contains TODO that there are more things from that era that should be fixed when we do next breaking release. Anyway good catch - thank you.

@ForbiddenEra
Copy link

This confused the heck out of me since the k8s docs say:

StatefulSets currently require a [Headless Service](https://kubernetes.io/docs/concepts/services-networking/service/#headless-services) to be responsible for the network identity of the Pods. You are responsible for creating this Service.

Surprised it not broke-ing stuffs.

@aleMaqueda
Copy link

I inspected the statefulset and only create the service with the port defined in the statefulset (8082)
kubectl get statefulset argocd-application-controller -n argocd -o yaml

apiVersion: v1
kind: Service
metadata:
  labels:
    app.kubernetes.io/component: applicationset-controller
    app.kubernetes.io/name: argocd-application-controller
    app.kubernetes.io/part-of: argocd
  name: argocd-application-controller
  namespace: argocd
spec:
  ports:
  - port: 8082
    protocol: TCP
  selector:
    app.kubernetes.io/name: argocd-application-controller
  sessionAffinity: None
  type: ClusterIP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants