Pod Discovery 기능: Label이 "type: front-end" 인 Pod만 Select
Code Block
selector:
matchLabels:
type: front-end
replicas
유지할 Pod갯수
Code Block
replicas: 3
Code Block
sansae@sansaeAir15m2 ~ % k apply -f nginx-rs.yaml
replicaset.apps/nginx-rs created
Code Block
sansae@sansaeAir15m2 ~ % k get all
NAME READY STATUS RESTARTS AGE
pod/nginx-rs-6dzx9 1/1 Running 0 91s
pod/nginx-rs-kbkn8 1/1 Running 0 91s
pod/nginx-rs-ml42r 1/1 Running 0 91s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.0.0.1 <none> 443/TCP 6h13m
NAME DESIRED CURRENT READY AGE
Scale
Code Block
$k replace -f nginx-rs.yaml
$k scale --replicas=6 -f nginx-rs.yaml
$k scale --replicas=6 rs nginx-rs
sansae@sansaeAir15m2 ~ % k scale --replicas=6 rs nginx-rs
replicaset.apps/nginx-rs scaled
sansae@sansaeAir15m2 ~ % k get pod
NAME READY STATUS RESTARTS AGE
nginx-rs-6dzx9 1/1 Running 0 15m
nginx-rs-7mrz2 1/1 Running 0 9s
nginx-rs-hm85w 1/1 Running 0 9s
nginx-rs-kbkn8 1/1 Running 0 15m
nginx-rs-ml42r 1/1 Running 0 15m
nginx-rs-shljn 1/1 Running 0 9s