0
0

More than 1 year has passed since last update.

CKA試験、Node

Last updated at Posted at 2023-03-07

Node

  • ノードに新たなPodを作成できないようにする
kubectl cordon <ノード名>
  • ノードに新たなPodを作成できるようにする
kubectl uncordon <ノード名>
  • 特定のノードから実行中のPodをなくす
  • ノードに新たなPodを作成できないようにする
kubectl drain <ノード名> --ignore-daemonsets -force

Node Schedule

次の条件を持つPodを作りなさい

  • Pod名: eshop-store
  • image: nginx
  • Node selector: disktype=ssd
kubectl run eshop-store --image=nginx --dry-run=client -o yaml > 8.yaml

vi 8.yaml
(修正前) 8.yaml
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    run: eshop-store
  name: eshop-store
spec:
  containers:
  - image: nginx
    name: eshop-store
    resources: {}
  dnsPolicy: ClusterFirst
  restartPolicy: Always
status: {}
(修正後) 8.yaml
apiVersion: v1
kind: Pod
metadata:
  name: eshop-store
spec:
  nodeSelector:
    disktype: ssd
  containers:
  - image: nginx
    name: eshop-store

kubectl apply -f ./8.yaml
kubectl get pods eshop-store -L disktype
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0