You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2023/03/07 01:05:30 UTC

[skywalking-kubernetes] branch master updated: Use startup probe option for first initialization of application (#108)

This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-kubernetes.git


The following commit(s) were added to refs/heads/master by this push:
     new 9ddb4b4  Use startup probe option for first initialization of application (#108)
9ddb4b4 is described below

commit 9ddb4b441635b5758dc756d569ce7c44bf1a5f66
Author: Rahul Bajaj <ra...@gmail.com>
AuthorDate: Mon Mar 6 20:05:25 2023 -0500

    Use startup probe option for first initialization of application (#108)
    
    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.
---
 chart/skywalking/README.md                     |  5 +++--
 chart/skywalking/templates/oap-deployment.yaml | 12 ++++++++----
 chart/skywalking/values.yaml                   | 11 +++++++++--
 3 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/chart/skywalking/README.md b/chart/skywalking/README.md
index b83520c..2f4b245 100644
--- a/chart/skywalking/README.md
+++ b/chart/skywalking/README.md
@@ -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`                                                                                     |
diff --git a/chart/skywalking/templates/oap-deployment.yaml b/chart/skywalking/templates/oap-deployment.yaml
index 8dc05a9..ee2d24b 100644
--- a/chart/skywalking/templates/oap-deployment.yaml
+++ b/chart/skywalking/templates/oap-deployment.yaml
@@ -96,8 +96,12 @@ 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}}
@@ -105,8 +109,8 @@ spec:
 {{ else }}
           tcpSocket:
             port: 12800
-          initialDelaySeconds: 15
-          periodSeconds: 20
+          initialDelaySeconds: 5
+          periodSeconds: 10
 {{ end }}
         ports:
         {{- range $key, $value :=  .Values.oap.ports }}
diff --git a/chart/skywalking/values.yaml b/chart/skywalking/values.yaml
index ee5d425..15435ba 100644
--- a/chart/skywalking/values.yaml
+++ b/chart/skywalking/values.yaml
@@ -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