2019-10-24
1、給節(jié)點打標簽
kubectl label nodes k8snode-03 slave=3
2念恍、部署時指定標簽
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: test
spec:
serviceName: "test"
replicas: 2
selector:
matchLabels:
app: test
template:
metadata:
labels:
app: test
spec:
containers:
- name: test
imagePullPolicy: IfNotPresent
image: registry/test-image:1.0.1
nodeSelector:
slave: "3"