github.com/oam-dev/kubevela@v1.9.11/docs/examples/app-with-probe/README.md (about) 1 # How to probe application's status 2 3 In this section, I'll illustrate by an example how to declare a probe to test if an application is alive. 4 5 ## Prerequisites 6 7 1. You can access a Kubernetes cluster(remotely or locally like `kind` or `minikube`) 8 2. You have installed KubeVela 9 10 ## Steps 11 12 ### Check application yaml 13 14 in [app-with-probe.yaml](./app-with-probe.yaml), you'll see a `livenessProbe` field in `properties`, which shows how to test if a component is alive. 15 16 `path` is the health check path your web server is exposed and `port` is the port your server is listening to. 17 18 In this example, we use `httpGet` method to check the application. It's a common method in web service. Besides the `httpGet` probe method, you can also change it into `exec` or `tcpSocket` method. 19 20 ### Apply the application 21 22 Just apply the file in cluster. 23 ```shell 24 kubectl apply -f app-with-probe.yaml 25 ``` 26 27 ### Check the status 28 29 the application in the cluster is rendered into resources like `pod`. 30 31 Try to describe the pod: 32 ```shell 33 $ kubectl get pod 34 NAME READY STATUS RESTARTS AGE 35 frontend-86bc89d8f5-xgrnc 1/1 Running 0 18s 36 37 $ kubectl describe pod frontend-86bc89d8f5-xgrnc 38 ... 39 Liveness: http-get http://:8080/ delay=0s timeout=1s period=10s #success=1 #failure=3 40 ...(other infomation) 41 ``` 42 You'll see the pod is running without any errors. If this component is unusable reported by livenessProbe, it will restart automatically.