Add service.annotations support#9
Open
TJM wants to merge 1 commit into
Open
Conversation
Mirror the existing pattern used by serviceAccount.annotations and
podAnnotations so users can attach metadata.annotations to the Service.
Needed for GKE container-native LB (cloud.google.com/neg='{"ingress": true}')
when fronting a ClusterIP Service with a GCE Ingress.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add optional
service.annotationsrendering totemplates/service.yaml, mirroring the existing pattern used byserviceAccount.annotationsandpodAnnotations. Bumps chart version 0.1.2 → 0.1.3.Motivation
The Service rendered by this chart has no way to receive annotations, which blocks several real-world deployment patterns. The case that drove this: deploying the chart on GKE with a GCE Ingress fronting a ClusterIP Service requires the
cloud.google.com/neg: '{\"ingress\": true}'annotation for container-native load balancing. Withoutservice.annotations, the Ingress fails to translate with:service \"X\" is type \"ClusterIP\", expected \"NodePort\" or \"LoadBalancer\" when not using NEGs.Other use cases: AWS NLB target-type annotations, MetalLB shared-IP annotations, Linkerd/Istio mesh annotations, internal-LB hints for cloud LBs.
Changes
templates/service.yaml— rendermetadata.annotationsfrom.Values.service.annotationswhen non-empty (guarded bywith).values.yaml— addservice.annotations: {}default with a commented example.Chart.yaml— bumpversion: 0.1.2→0.1.3.Backward compatible: the block is omitted when the map is empty, so existing installs produce identical YAML.
Test plan
helm lintpasseshelm templatewith no annotations produces noannotations:block on the Service (identical to current behavior)helm templatewithservice.annotations.cloud.google.com/neg: '{"ingress": true}'renders the annotation correctly