nginx Pod 생성
kubectl run nginx \\
--generator=run-pod/v1 \\
--image=nginx \\
--port=80
pod/nginx created
pod 확인
kubectl get pods
NAME READY STATUS RESTARTS AGE
nginx 1/1 Running 0 45s
replicaset 확인
kubectl get replicasets
No resources found.
deployments 확인
kubectl get deployments
No resources found.
pod 제거
kubectl delete pod nginx
pod "nginx" deleted
nginx Deployment 생성
kubectl run nginx \\
--image=nginx \\
--port=80
deployment.apps/nginx created
pod 확인
kubectl get pods
NAME READY STATUS RESTARTS AGE
nginx-57867cc648-bxqfz 1/1 Running 0 24s
replicaset 확인
kubectl get replicasets
NAME DESIRED CURRENT READY AGE
nginx-57867cc648 1 1 1 54s
deployments 확인
kubectl get deployments
NAME READY UP-TO-DATE AVAILABLE AGE
nginx 1/1 1 1 67s
노드 확인
kubectl get nodes
Pod 확인
kubectl get pods
Deployment 확인
kubectl get deployments
Service 확인
kubectl get services
deployment 상세 정보 확인
kubectl describe deployments nginx
Name: nginx
Namespace: default
CreationTimestamp: Fri, 22 Feb 2019 13:52:43 +0000
Labels: run=nginx
Annotations: deployment.kubernetes.io/revision: 1
Selector: run=nginx
Replicas: 1 desired | 1 updated | 1 total | 1 available | 0 unavailable
StrategyType: RollingUpdate
MinReadySeconds: 0
RollingUpdateStrategy: 25% max unavailable, 25% max surge
Pod Template:
Labels: run=nginx
Containers:
nginx:
Image: nginx
Port: 80/TCP
Host Port: 0/TCP
Environment: <none>
Mounts: <none>
Volumes: <none>
Conditions:
Type Status Reason
---- ------ ------
Available True MinimumReplicasAvailable
Progressing True NewReplicaSetAvailable
OldReplicaSets: <none>
NewReplicaSet: nginx-57867cc648 (1/1 replicas created)
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ScalingReplicaSet 4m26s deployment-controller Scaled up replica set nginx-57867cc648 to 1