istio.io/istio@v0.0.0-20240520182934-d79c90f27776/samples/health-check/liveness-command.yaml (about) 1 # Copyright Istio Authors 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 ################################################################################################## 16 # Liveness service 17 ################################################################################################## 18 apiVersion: v1 19 kind: Service 20 metadata: 21 name: liveness 22 labels: 23 app: liveness 24 service: liveness 25 spec: 26 ports: 27 - port: 80 28 name: http 29 selector: 30 app: liveness 31 --- 32 apiVersion: apps/v1 33 kind: Deployment 34 metadata: 35 name: liveness 36 spec: 37 selector: 38 matchLabels: 39 app: liveness 40 template: 41 metadata: 42 labels: 43 app: liveness 44 spec: 45 containers: 46 - name: liveness 47 image: registry.k8s.io/busybox 48 args: 49 - /bin/sh 50 - -c 51 - touch /tmp/healthy; sleep 3600 52 livenessProbe: 53 exec: 54 command: 55 - cat 56 - /tmp/healthy 57 initialDelaySeconds: 5 58 periodSeconds: 5