https://kubernetes.io/docs/concepts/workloads/pods/
ctel + F kind: 하면
mkdir yaml
cd yaml/
4.gedit go-http-pod.yaml
apiVersion: v1
kind: pod
metadata:
name: http-go
spec:
containers:
- name: http-go
image: gasbugs/http-go
ports:
- containerProt: 8080
apiVersion: v1
kind: Pod
metadata:
labels:
test: liveness
name: liveness-exec
spec:
containers:
- name: liveness
image: registry.k8s.io/busybox
args:
- /bin/sh
- -c
- touch /tmp/healthy; sleep 30; rm -f /tmp/healthy; sleep 600
livenessProbe:
exec:
command:
- cat
- /tmp/healthy
initialDelaySeconds: 5
periodSeconds: 5
kubectl create -f exec-liveness.yaml
kubectl get pod
kubectl describe pod liveness-exec 로 확인가능
gedit http-liveness.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
test: liveness
name: liveness-http
spec:
containers:
- name: liveness
image: registry.k8s.io/liveness
args:
- /server
livenessProbe:
httpGet:
path: /healthz
port: 8080
httpHeaders:
- name: Custom-Header
value: Awesome
initialDelaySeconds: 3
periodSeconds: 3
kubectl create -f http-liveness.yaml
kubectl get pod -w 계속 볼수있음
kubectl describe pod liveness-http 로 확인가능
kubectl apply -f https://k8s.io/examples/pods/probe/http-liveness.yaml
kubectl describe pod goproxy