Skip to content

Commit

Permalink
Feature-#10481 - use startup probe option for first initialization of…
Browse files Browse the repository at this point in the history
… application

Applications take longer to start up the first time. In these situations, setting up liveness probe parameters might be challenging without sacrificing the quick response time that led to the probe's creation. Setting up a startup probe with the same command, HTTP or TCP check, and a failureThreshold* periodSeconds long enough to account for the worst-case startup delay is therefore a good idea.
  • Loading branch information
rabajaj0509 committed Mar 7, 2023
1 parent f9218e4 commit 54ddf63
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
5 changes: 3 additions & 2 deletions chart/skywalking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ The following table lists the configurable parameters of the Skywalking chart an
| `oap.nodeSelector` | OAP labels for master pod assignment | `{}` |
| `oap.tolerations` | OAP tolerations | `[]` |
| `oap.resources` | OAP node resources requests & limits | `{} - cpu limit must be an integer` |
| `oap.livenessProbe` | Configuration fields for the [livenessProbe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/) | `tcpSocket.port: 12800` <br> `initialDelaySeconds: 15` <br> `periodSeconds: 20`
| `oap.readinessProbe` | Configuration fields for the [readinessProbe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/) | `tcpSocket.port: 12800` <br> `initialDelaySeconds: 15` <br> `periodSeconds: 20`
| `oap.startupProbe` | Configuration fields for the [startupProbe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) | `tcpSocket.port: 12800` <br> `failureThreshold: 9` <br> `periodSeconds: 10`
| `oap.livenessProbe` | Configuration fields for the [livenessProbe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) | `tcpSocket.port: 12800` <br> `initialDelaySeconds: 5` <br> `periodSeconds: 10`
| `oap.readinessProbe` | Configuration fields for the [readinessProbe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) | `tcpSocket.port: 12800` <br> `initialDelaySeconds: 5` <br> `periodSeconds: 10`
| `oap.envoy.als.enabled` | Open envoy als | `false` |
| `oap.env` | OAP environment variables | `[]` |
| `oap.securityContext` | Allows you to set the [securityContext](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) for the pod | `fsGroup: 1000`<br>`runAsUser: 1000` |
Expand Down
12 changes: 8 additions & 4 deletions chart/skywalking/templates/oap-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,21 @@ spec:
{{ else }}
tcpSocket:
port: 12800
initialDelaySeconds: 15
periodSeconds: 20
initialDelaySeconds: 5
periodSeconds: 10
{{ end }}
startupProbe:
{{- if .Values.oap.startupProbe}}
{{ toYaml .Values.oap.startupProbe | indent 10 }}
{{ end }}
readinessProbe:
{{- if .Values.oap.readinessProbe}}
{{ toYaml .Values.oap.readinessProbe | indent 10 }}
{{ else }}
tcpSocket:
port: 12800
initialDelaySeconds: 15
periodSeconds: 20
initialDelaySeconds: 5
periodSeconds: 10
{{ end }}
ports:
{{- range $key, $value := .Values.oap.ports }}
Expand Down
11 changes: 9 additions & 2 deletions chart/skywalking/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,19 @@ oap:
livenessProbe: {}
# tcpSocket:
# port: 12800
# initialDelaySeconds: 15
# initialDelaySeconds: 5
# periodSeconds: 20
startupProbe:
# Time to boot the applciation is set to:
# 9 (failureThreshold) * 10 (periodSeconds) = 90 seconds in this case.
tcpSocket:
port: 12800
failureThreshold: 9
periodSeconds: 10
readinessProbe: {}
# tcpSocket:
# port: 12800
# initialDelaySeconds: 15
# initialDelaySeconds: 5
# periodSeconds: 20
# podAnnotations:
# example: oap-foo
Expand Down

0 comments on commit 54ddf63

Please sign in to comment.