kubectl create -f deployment-definition.yml
kubectl get deployments
kubectl get replicaset
kubectl get pods
kubectl get all
https://kubernetes.io/docs/reference/kubectl/conventions/
Create an NGINX Pod
kubectl run nginx --image=nginx
Generate POD Manifest YAML file (-o yaml). Don't create it(--dry-run)
kubectl run nginx --image=nginx --dry-run=client -o yaml
Create a deployment
kubectl create deployment --image=nginx nginx
Generate Deployment YAML file (-o yaml). Don't create it(--dry-run)
kubectl create deployment --image=nginx nginx --dry-run=client -o yaml
Generate Deployment YAML file (-o yaml). Don’t create it(–dry-run) and save it to a file.
kubectl create deployment --image=nginx nginx --dry-run=client -o yaml > nginx-deployment.yaml
Make necessary changes to the file (for example, adding more replicas) and then create the deployment.
kubectl create -f nginx-deployment.yaml
OR
In k8s version 1.19+, we can specify the --replicas option to create a deployment with 4 replicas.
kubectl create deployment --image=nginx nginx --replicas=4 --dry-run=client -o yaml > nginx-deployment.yaml
-----------------------------------------------------------------------------------------
kubectl get pods
kubectl get rs
kubectl get deployments
kubectl get rs
kubectl get pods
kubectl describe pod frontend-deployment-xxxxx-xxxx
kubectl create -f deployment-definition-1.yaml
-----------------------------------------------------------------------------------------
kubectl create deployment --help
kubectl create deployment httpd-frontend --image=httpd:2.4-alpine --replicas=3
kubectl get deploy
kubectl get deploy
-----------------------------------------------------------------------------------------
'개발 및 관리 > 클라우드' 카테고리의 다른 글
K8S Imperative / Declarative Commands (0) | 2023.09.04 |
---|---|
K8S, Services Command, Services-LoandBalancer (0) | 2023.09.01 |
K8S, Services Command (0) | 2023.08.29 |
K8S, ReplicaSets Command (0) | 2023.08.28 |
쿠버네티스 KCA 관련 자료 URL (0) | 2023.08.03 |