个人学习笔记
保持POD健康
- 存活探针
1.HTTP GET
apiVersion: v1
kind: Pod
metadata:
name: kubia-manual
spec:
containers:
- image: charliejiang233/kubia-manual
name: kubia
ports:
- containerPort: 8080
protocol: TCP
livenessProbe:
httpGet:
path: /
port: 8080
initialDelaySeconds: 15
2.TCP套接字
3.Exec探针
- 就绪探针
rc的管理操作
- 修改rc的配置,例如想修改副本数量
k edit rc kubia
- 删除rc,但不删除其管理的pod
k delete rc kubia --cascala=false
ReplicaSet
- 创建rs
apiVersion: apps/v1beta2
kind: ReplicaSet
metadata:
name: kubia
spec:
replicas: 3
selector:
matchLabels:
env: dev
template:
metadata:
labels:
env: dev
spec:
containers:
- name: kubia
image: charliejiang233/kubia
ports:
- containerPort: 8080
- DeamonSet,在每个工作节点只会启动一个POD
- 向节点添加所需标签
k label node minikube disk=ssd
- 从节点删除所需标签
k label node minikube disk=ssd --overwrite