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

helm: add headless service #3831

Merged
merged 6 commits into from
May 11, 2023
Merged

Conversation

tpaschalis
Copy link
Member

@tpaschalis tpaschalis commented May 10, 2023

PR Description

This PR adds a headless service to our helm chart. Its main use case is for use with clustering, so that new pods can use it for an SRV lookup to fins the rest of the cluster peers to connect to.

It is a copy of the existing service definition but with a -headless suffix to the name and ClusterIP set explicitly to None.

Comparing the previous manifests (exported with helm template .) and the new ones gives:

$ diff manifests-old.yaml manifests-new.yaml
156a157,178
> # Source: grafana-agent/templates/service-headless.yaml
> apiVersion: v1
> kind: Service
> metadata:
>   name: RELEASE-NAME-grafana-agent-headless
>   labels:
>     helm.sh/chart: grafana-agent-0.13.0
>     app.kubernetes.io/name: grafana-agent
>     app.kubernetes.io/instance: RELEASE-NAME
>     app.kubernetes.io/version: "v0.33.1"
>     app.kubernetes.io/managed-by: Helm
> spec:
>   clusterIP: 'None'
>   selector:
>     app.kubernetes.io/name: grafana-agent
>     app.kubernetes.io/instance: RELEASE-NAME
>   ports:
>     - name: http-headless-service
>       port: 80
>       targetPort: 80
>       protocol: "TCP"
> ---

Which issue(s) this PR fixes

Related to #2861 and ease-of-use.

Notes to the Reviewer

Nothing to note.

PR Checklist

  • CHANGELOG updated
  • Documentation added
  • Tests updated

Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
@tpaschalis tpaschalis force-pushed the helm-headless-service branch from 62e0b7d to 5347382 Compare May 10, 2023 11:31
@tpaschalis tpaschalis marked this pull request as ready for review May 10, 2023 11:55
@rfratto rfratto self-requested a review May 10, 2023 12:13
@@ -0,0 +1,29 @@
apiVersion: v1
Copy link
Member

@rfratto rfratto May 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep the amount of deployed resources small, can you make this optional by adding a new setting to the values.yaml?

I also think it should be opt-in for now rather than opt-out, since you only really need this when you're clustering and when you're not using go-discover to do the clustering.

Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
@tpaschalis tpaschalis requested a review from rfratto May 11, 2023 14:11
Copy link
Member

@rfratto rfratto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about this more: what if we made the service toggleable and then just relied on turning the primary service into a headless service instead of adding a new service?

Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
@rfratto rfratto merged commit 30fc025 into grafana:main May 11, 2023
tpaschalis added a commit to tpaschalis/agent that referenced this pull request May 16, 2023
Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
clayton-cornell pushed a commit that referenced this pull request Aug 14, 2023
Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
clayton-cornell pushed a commit that referenced this pull request Aug 14, 2023
Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Feb 26, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants