Skip to content

Commit d3788f6

Browse files
authored
chore(injector): promote native sidecars to beta (#14587)
* chore(injector): promote native sidecars to beta - Advances native-sidecar feature from alpha to beta. - Deprecates `config.alpha.linkerd.io/proxy-enable-native-sidecar` annotation. - Introduces `config.beta.linkerd.io/proxy-enable-native-sidecar` as the new annotation. - GA planned after expanded automated test coverage.
1 parent 01f058e commit d3788f6

File tree

8 files changed

+39
-22
lines changed

8 files changed

+39
-22
lines changed

charts/linkerd-control-plane/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ proxy:
250250
# -- Configures the outbound transport mode. Valid values are "transport-header" and "transparent"
251251
outboundTransportMode: transport-header
252252
# -- Enable KEP-753 native sidecars
253-
# This is an experimental feature. It requires Kubernetes >= 1.29.
253+
# This is a beta feature. It requires Kubernetes >= 1.29.
254254
# If enabled, .proxy.waitBeforeExitSeconds should not be used.
255255
nativeSidecar: false
256256
# -- Native sidecar proxy startup probe parameters.

cli/cmd/doc.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,12 @@ func generateAnnotationsDocs() []annotationDoc {
289289
Description: "Grace period for graceful proxy shutdowns. If this timeout elapses before all open connections have completed, the proxy will terminate forcefully, closing any remaining connections.",
290290
},
291291
{
292-
Name: k8s.ProxyEnableNativeSidecarAnnotation,
293-
Description: "Enable KEP-753 native sidecars. This is an experimental feature. It requires Kubernetes >= 1.29. If enabled, .proxy.waitBeforeExitSeconds should not be used.",
292+
Name: k8s.ProxyEnableNativeSidecarAnnotationAlpha,
293+
Description: "Enable KEP-753 native sidecars. This is a beta feature. It requires Kubernetes >= 1.29. If enabled, .proxy.waitBeforeExitSeconds should not be used. Deprecated in favor of " + k8s.ProxyEnableNativeSidecarAnnotationBeta,
294+
},
295+
{
296+
Name: k8s.ProxyEnableNativeSidecarAnnotationBeta,
297+
Description: "Enable KEP-753 native sidecars. This is a beta feature. It requires Kubernetes >= 1.29. If enabled, .proxy.waitBeforeExitSeconds should not be used.",
294298
},
295299
}
296300
}

cli/cmd/inject.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ func getOverrideAnnotations(values *linkerd2.Values, base *linkerd2.Values) map[
505505
}
506506

507507
if proxy.NativeSidecar != baseProxy.NativeSidecar {
508-
overrideAnnotations[k8s.ProxyEnableNativeSidecarAnnotation] = strconv.FormatBool(proxy.NativeSidecar)
508+
overrideAnnotations[k8s.ProxyEnableNativeSidecarAnnotationBeta] = strconv.FormatBool(proxy.NativeSidecar)
509509
}
510510

511511
return overrideAnnotations

cli/cmd/inject_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -739,16 +739,16 @@ func TestProxyConfigurationAnnotations(t *testing.T) {
739739
k8s.ProxyLogLevelAnnotation: "debug",
740740
k8s.ProxyLogFormatAnnotation: "cool",
741741

742-
k8s.ProxyEnableExternalProfilesAnnotation: "true",
743-
k8s.ProxyCPURequestAnnotation: "10m",
744-
k8s.ProxyCPULimitAnnotation: "100m",
745-
k8s.ProxyMemoryRequestAnnotation: "10Mi",
746-
k8s.ProxyMemoryLimitAnnotation: "50Mi",
747-
k8s.ProxyWaitBeforeExitSecondsAnnotation: "10",
748-
k8s.ProxyAwait: "disabled",
749-
k8s.ProxyAccessLogAnnotation: "apache",
750-
k8s.ProxyShutdownGracePeriodAnnotation: "60s",
751-
k8s.ProxyEnableNativeSidecarAnnotation: "true",
742+
k8s.ProxyEnableExternalProfilesAnnotation: "true",
743+
k8s.ProxyCPURequestAnnotation: "10m",
744+
k8s.ProxyCPULimitAnnotation: "100m",
745+
k8s.ProxyMemoryRequestAnnotation: "10Mi",
746+
k8s.ProxyMemoryLimitAnnotation: "50Mi",
747+
k8s.ProxyWaitBeforeExitSecondsAnnotation: "10",
748+
k8s.ProxyAwait: "disabled",
749+
k8s.ProxyAccessLogAnnotation: "apache",
750+
k8s.ProxyShutdownGracePeriodAnnotation: "60s",
751+
k8s.ProxyEnableNativeSidecarAnnotationBeta: "true",
752752
}
753753

754754
overrides := getOverrideAnnotations(values, baseValues)

cli/cmd/testdata/inject_emojivoto_deployment_native_sidecar.golden.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/inject/inject.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ var (
3939
rTrail = regexp.MustCompile(`\},\s*\]`)
4040

4141
// ProxyAnnotations is the list of possible annotations that can be applied on a pod or namespace.
42-
// All these annotations should be prefixed with "config.linkerd.io"
4342
ProxyAnnotations = []string{
4443
k8s.ProxyAdminPortAnnotation,
4544
k8s.ProxyControlPortAnnotation,
@@ -81,12 +80,13 @@ var (
8180
k8s.ProxyInboundDiscoveryCacheUnusedTimeout,
8281
k8s.ProxyDisableOutboundProtocolDetectTimeout,
8382
k8s.ProxyDisableInboundProtocolDetectTimeout,
83+
k8s.ProxyEnableNativeSidecarAnnotationBeta,
8484
}
8585
// ProxyAlphaConfigAnnotations is the list of all alpha configuration
8686
// (config.alpha prefix) that can be applied to a pod or namespace.
8787
ProxyAlphaConfigAnnotations = []string{
8888
k8s.ProxyWaitBeforeExitSecondsAnnotation,
89-
k8s.ProxyEnableNativeSidecarAnnotation,
89+
k8s.ProxyEnableNativeSidecarAnnotationAlpha,
9090
}
9191
)
9292

@@ -372,7 +372,13 @@ func ApplyAnnotationOverrides(values *l5dcharts.Values, annotations map[string]s
372372
}
373373
}
374374

375-
if override, ok := annotations[k8s.ProxyEnableNativeSidecarAnnotation]; ok {
375+
// ProxyEnableNativeSidecarAnnotationBeta should take precedence over ProxyEnableNativeSidecarAnnotationAlpha
376+
if override, ok := annotations[k8s.ProxyEnableNativeSidecarAnnotationBeta]; ok {
377+
value, err := strconv.ParseBool(override)
378+
if err == nil {
379+
values.Proxy.NativeSidecar = value
380+
}
381+
} else if override, ok = annotations[k8s.ProxyEnableNativeSidecarAnnotationAlpha]; ok {
376382
value, err := strconv.ParseBool(override)
377383
if err == nil {
378384
values.Proxy.NativeSidecar = value

pkg/inject/inject_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func TestGetOverriddenValues(t *testing.T) {
7575
k8s.ProxyInboundDiscoveryCacheUnusedTimeout: "900s",
7676
k8s.ProxyDisableOutboundProtocolDetectTimeout: "true",
7777
k8s.ProxyDisableInboundProtocolDetectTimeout: "true",
78-
k8s.ProxyEnableNativeSidecarAnnotation: "true",
78+
k8s.ProxyEnableNativeSidecarAnnotationBeta: "true",
7979
},
8080
},
8181
Spec: corev1.PodSpec{},
@@ -179,7 +179,7 @@ func TestGetOverriddenValues(t *testing.T) {
179179
k8s.ProxyInboundDiscoveryCacheUnusedTimeout: "6000ms",
180180
k8s.ProxyDisableOutboundProtocolDetectTimeout: "true",
181181
k8s.ProxyDisableInboundProtocolDetectTimeout: "false",
182-
k8s.ProxyEnableNativeSidecarAnnotation: "true",
182+
k8s.ProxyEnableNativeSidecarAnnotationBeta: "true",
183183
},
184184
spec: appsv1.DeploymentSpec{
185185
Template: corev1.PodTemplateSpec{

pkg/k8s/labels.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ const (
127127
// ProxyConfigAnnotationsPrefixAlpha is the prefix of newly released config-related annotations
128128
ProxyConfigAnnotationsPrefixAlpha = "config.alpha.linkerd.io"
129129

130+
// ProxyConfigAnnotationsPrefixBeta is the prefix for config-related annotations more mature than alpha but not yet stable
131+
ProxyConfigAnnotationsPrefixBeta = "config.beta.linkerd.io"
132+
130133
// ProxyImageAnnotation can be used to override the proxyImage config.
131134
ProxyImageAnnotation = ProxyConfigAnnotationsPrefix + "/proxy-image"
132135

@@ -283,8 +286,12 @@ const (
283286
// configured for the Pod
284287
ProxyWaitBeforeExitSecondsAnnotation = ProxyConfigAnnotationsPrefixAlpha + "/proxy-wait-before-exit-seconds"
285288

286-
// ProxyEnableNativeSidecarAnnotation enables the new native initContainer sidecar
287-
ProxyEnableNativeSidecarAnnotation = ProxyConfigAnnotationsPrefixAlpha + "/proxy-enable-native-sidecar"
289+
// ProxyEnableNativeSidecarAnnotationAlpha enables the new native initContainer sidecar.
290+
// Deprecated: use ProxyEnableNativeSidecarAnnotationBeta instead.
291+
ProxyEnableNativeSidecarAnnotationAlpha = ProxyConfigAnnotationsPrefixAlpha + "/proxy-enable-native-sidecar"
292+
293+
// ProxyEnableNativeSidecarAnnotationBeta enables the new native initContainer sidecar
294+
ProxyEnableNativeSidecarAnnotationBeta = ProxyConfigAnnotationsPrefixBeta + "/proxy-enable-native-sidecar"
288295

289296
// ProxyAwait can be used to force the application to wait for the proxy
290297
// to be ready.

0 commit comments

Comments
 (0)