Skip to content

Commit

Permalink
Add default proxy startupProbe parameters to values.yaml
Browse files Browse the repository at this point in the history
Signed-off-by: TJ Miller <[email protected]>
  • Loading branch information
teejaded committed Nov 20, 2023
1 parent ebda49a commit 65891f5
Show file tree
Hide file tree
Showing 22 changed files with 95 additions and 2 deletions.
1 change: 1 addition & 0 deletions charts/linkerd-control-plane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ Kubernetes: `>=1.21.0-0`
| proxy.resources.memory.limit | string | `""` | Maximum amount of memory that the proxy can use |
| proxy.resources.memory.request | string | `""` | Maximum amount of memory that the proxy requests |
| proxy.shutdownGracePeriod | string | `""` | 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. |
| proxy.startupProbe | object | `{"failureThreshold":120,"initialDelaySeconds":0,"periodSeconds":1}` | Native sidecar proxy startup probe parameters. |
| proxy.uid | int | `2102` | User id under which the proxy runs |
| proxy.waitBeforeExitSeconds | int | `0` | If set the injected proxy sidecars in the data plane will stay alive for at least the given period before receiving the SIGTERM signal from Kubernetes but no longer than the pod's `terminationGracePeriodSeconds`. See [Lifecycle hooks](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks) for more info on container lifecycle hooks. |
| proxyInit.closeWaitTimeoutSecs | int | `0` | |
Expand Down
5 changes: 5 additions & 0 deletions charts/linkerd-control-plane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ proxy:
# This is an experimental feature. It requires Kubernetes >= 1.29.
# If enabled, .proxy.waitBeforeExitSeconds should not be used.
nativeSidecar: false
# -- Native sidecar proxy startup probe parameters.
startupProbe:
initialDelaySeconds: 0
periodSeconds: 1
failureThreshold: 120

# proxy-init configuration
proxyInit:
Expand Down
11 changes: 10 additions & 1 deletion charts/patch/templates/patch.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{{ $prefix := .Values.pathPrefix -}}
{{ $initIndex := ternary "0" "-" (dig "proxy" "nativeSidecar" false (merge (dict) .Values)) -}}
{{/*
$initIndex represents the patch insertion index of the next initContainer when
proxy.nativeSidecar is true. If enabled, the proxy-init or network-validator
should run first, immediately followed by the proxy. This ordering allows us
to proxy traffic in subsequent initContainers.

Note: dig is not used directly on .Values because it rejects chartutil.Values
structs.
*/}}
{{- $initIndex := ternary "0" "-" (.Values.proxy | default (dict) | dig "nativeSidecar" false) -}}
[
{{- if .Values.addRootMetadata }}
{
Expand Down
4 changes: 4 additions & 0 deletions cli/cmd/testdata/install_controlplane_tracing_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cli/cmd/testdata/install_custom_domain.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cli/cmd/testdata/install_custom_registry.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cli/cmd/testdata/install_default.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cli/cmd/testdata/install_default_override_dst_get_nets.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cli/cmd/testdata/install_default_token.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cli/cmd/testdata/install_ha_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cli/cmd/testdata/install_ha_with_overrides_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cli/cmd/testdata/install_heartbeat_disabled_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cli/cmd/testdata/install_helm_control_plane_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cli/cmd/testdata/install_helm_control_plane_output_ha.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cli/cmd/testdata/install_helm_output_ha_labels.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cli/cmd/testdata/install_no_init_container.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cli/cmd/testdata/install_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cli/cmd/testdata/install_proxy_ignores.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cli/cmd/testdata/install_values_file.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions pkg/charts/linkerd2/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ type (
AccessLog string `json:"accessLog"`
ShutdownGracePeriod string `json:"shutdownGracePeriod"`
NativeSidecar bool `json:"nativeSidecar"`
StartupProbe *StartupProbe `json:"startupProbe"`
}

// ProxyInit contains the fields to set the proxy-init container
Expand Down Expand Up @@ -227,6 +228,13 @@ type (
EphemeralStorage Constraints `json:"ephemeral-storage"`
}

// StartupProbe represents the initContainer startup probe parameters for the proxy
StartupProbe struct {
InitialDelaySeconds uint `json:"initialDelaySeconds"`
PeriodSeconds uint `json:"periodSeconds"`
FailureThreshold uint `json:"failureThreshold"`
}

// Identity contains the fields to set the identity variables in the proxy
// sidecar container
Identity struct {
Expand Down
5 changes: 5 additions & 0 deletions pkg/charts/linkerd2/values_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ func TestNewValues(t *testing.T) {
InboundDiscoveryCacheUnusedTimeout: "90s",
DisableOutboundProtocolDetectTimeout: false,
DisableInboundProtocolDetectTimeout: false,
StartupProbe: &StartupProbe{
FailureThreshold: 120,
InitialDelaySeconds: 0,
PeriodSeconds: 1,
},
},
ProxyInit: &ProxyInit{
IptablesMode: "legacy",
Expand Down

0 comments on commit 65891f5

Please sign in to comment.