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

Config for timeouts and delays in probes #11458

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion charts/linkerd-control-plane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ Kubernetes: `>=1.22.0-0`
| proxy.image.version | string | linkerdVersion | Tag for the proxy container image |
| proxy.inboundConnectTimeout | string | `"100ms"` | Maximum time allowed for the proxy to establish an inbound TCP connection |
| proxy.inboundDiscoveryCacheUnusedTimeout | string | `"90s"` | Maximum time allowed before an unused inbound discovery result is evicted from the cache |
| proxy.livenessProbe | object | `{"initialDelaySeconds":10,"timeoutSeconds":1}` | LivenessProbe timeout and delay configuration |
| proxy.logFormat | string | `"plain"` | Log format (`plain` or `json`) for the proxy |
| proxy.logLevel | string | `"warn,linkerd=info,trust_dns=error"` | Log level for the proxy |
| proxy.nativeSidecar | bool | `false` | Enable KEP-753 native sidecars This is an experimental feature. It requires Kubernetes >= 1.29. If enabled, .proxy.waitBeforeExitSeconds should not be used. |
Expand All @@ -254,6 +255,7 @@ Kubernetes: `>=1.22.0-0`
| proxy.ports.control | int | `4190` | Control port for the proxy container |
| proxy.ports.inbound | int | `4143` | Inbound port for the proxy container |
| proxy.ports.outbound | int | `4140` | Outbound port for the proxy container |
| proxy.readinessProbe | object | `{"initialDelaySeconds":2,"timeoutSeconds":1}` | ReadinessProbe timeout and delay configuration |
| proxy.requireIdentityOnInboundPorts | string | `""` | |
| proxy.resources.cpu.limit | string | `""` | Maximum amount of CPU units that the proxy can use |
| proxy.resources.cpu.request | string | `""` | Amount of CPU units that the proxy requests |
Expand All @@ -262,7 +264,9 @@ Kubernetes: `>=1.22.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.startupProbe.failureThreshold | int | `120` | |
| proxy.startupProbe.initialDelaySeconds | int | `0` | |
| proxy.startupProbe.periodSeconds | int | `1` | |
| 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
8 changes: 8 additions & 0 deletions charts/linkerd-control-plane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,14 @@ proxy:
# If enabled, .proxy.waitBeforeExitSeconds should not be used.
nativeSidecar: false
# -- Native sidecar proxy startup probe parameters.
# -- LivenessProbe timeout and delay configuration
livenessProbe:
initialDelaySeconds: 10
Copy link
Member

Choose a reason for hiding this comment

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

So the default here used to be zero? Setting the new default to 10 is going to significantly delay the startup time for pods. How about leaving the default as it was? Pathological cases would still have an escape hatch with this new setting.

Copy link
Member

@mateiidavid mateiidavid Dec 5, 2023

Choose a reason for hiding this comment

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

it was hardcoded in to 10, see the _proxy.tpl change. The default did not change. The only defaults we have changed are timeouts since we've added them in.

Copy link
Member

Choose a reason for hiding this comment

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

😊

timeoutSeconds: 1
# -- ReadinessProbe timeout and delay configuration
readinessProbe:
initialDelaySeconds: 2
timeoutSeconds: 1
startupProbe:
initialDelaySeconds: 0
periodSeconds: 1
Expand Down
6 changes: 4 additions & 2 deletions charts/partials/templates/_proxy.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ livenessProbe:
httpGet:
path: /live
port: {{.Values.proxy.ports.admin}}
initialDelaySeconds: 10
initialDelaySeconds: {{.Values.proxy.livenessProbe.initialDelaySeconds }}
timeoutSeconds: {{.Values.proxy.livenessProbe.timeoutSeconds }}
name: linkerd-proxy
ports:
- containerPort: {{.Values.proxy.ports.inbound}}
Expand All @@ -180,7 +181,8 @@ readinessProbe:
httpGet:
path: /ready
port: {{.Values.proxy.ports.admin}}
initialDelaySeconds: 2
initialDelaySeconds: {{.Values.proxy.readinessProbe.initialDelaySeconds }}
timeoutSeconds: {{.Values.proxy.readinessProbe.timeoutSeconds }}
{{- if and .Values.proxy.nativeSidecar .Values.proxy.await }}
startupProbe:
httpGet:
Expand Down
8 changes: 8 additions & 0 deletions cli/cmd/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ func TestRender(t *testing.T) {
OpaquePorts: "25,443,587,3306,5432,11211",
Await: true,
DefaultInboundPolicy: "default-allow-policy",
LivenessProbe: &charts.Probe{
InitialDelaySeconds: 10,
TimeoutSeconds: 1,
},
ReadinessProbe: &charts.Probe{
InitialDelaySeconds: 2,
TimeoutSeconds: 1,
},
},
ProxyInit: &charts.ProxyInit{
IptablesMode: "legacy",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ spec:
path: /live
port: 4191
initialDelaySeconds: 10
timeoutSeconds: 1
name: linkerd-proxy
ports:
- containerPort: 4143
Expand All @@ -148,6 +149,7 @@ spec:
path: /ready
port: 4191
initialDelaySeconds: 2
timeoutSeconds: 1
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ spec:
path: /live
port: 4191
initialDelaySeconds: 10
timeoutSeconds: 1
name: linkerd-proxy
ports:
- containerPort: 4143
Expand All @@ -148,6 +149,7 @@ spec:
path: /ready
port: 4191
initialDelaySeconds: 2
timeoutSeconds: 1
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
Expand Down Expand Up @@ -357,6 +359,7 @@ spec:
path: /live
port: 4191
initialDelaySeconds: 10
timeoutSeconds: 1
name: linkerd-proxy
ports:
- containerPort: 4143
Expand All @@ -368,6 +371,7 @@ spec:
path: /ready
port: 4191
initialDelaySeconds: 2
timeoutSeconds: 1
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ spec:
path: /live
port: 4191
initialDelaySeconds: 10
timeoutSeconds: 1
name: linkerd-proxy
ports:
- containerPort: 4143
Expand All @@ -148,6 +149,7 @@ spec:
path: /ready
port: 4191
initialDelaySeconds: 2
timeoutSeconds: 1
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
Expand Down
2 changes: 2 additions & 0 deletions cli/cmd/testdata/inject_contour.golden.yml

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.

2 changes: 2 additions & 0 deletions cli/cmd/testdata/inject_emojivoto_deployment.golden.yml

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.

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.

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.

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.

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.

Loading
Loading