HOWOKACE
search
⌘Ctrlk
HOWOKACE
  • 🎇Network
  • 🛞System
  • ⚙️DevOps
    • Gitops란?
    • CI/CD
    • IaC
    • DevOps의 역할
    • DevOps 로드맵
    • DevOps ToolMap
    • 불변 vs 가변 인프라
    • Virtualization
    • 🛞kubernetes
      • Tips
      • Architecture
      • Networking
      • Kubectl
      • Add-on
      • CKA
        • 기본 콘셉트
        • 스케쥴링
        • 로깅 & 모니터링
        • 어플리케이션 생명 주기 관리
        • 팁
      • ArgoCD
  • 🔓Security
  • ☁️Cloud
  • TroubleShooting
gitbookPowered by GitBook
block-quoteOn this pagechevron-down
  1. ⚙️DevOpschevron-right
  2. 🛞kuberneteschevron-right
  3. CKA

팁

LogoCKA kubectl 정리 | 너구리는 라쿤이 아니다lcc3108.github.iochevron-right
Logokubectl 사용 규칙Kuberneteschevron-right
Logokubectl Quick ReferenceKuberneteschevron-right

hashtag
dry-run

hashtag
헤더 제거

PreviousCommandschevron-leftNextArgoCDchevron-right

Last updated 1 year ago

kubectl command command --dry-run=client -o yaml > file.ymal
# nginx pod 생성
kubectl run nginx --image=nginx

# 생성 시 yaml 내용 확인 (생성되지는 않음)
kubectl run nginx --image=nginx --dry-run=client -o yaml

# deployments 생성
kubectl create deployment --image=nginx nginx

# 생성 시 yaml 내용 확인 (생성되지는 않음)
kubectl create deployment --image=nginx nginx --dry-run=client -o yaml

# yaml 파일로 저장
kubectl create deployment --imgae=nginx nginx --dry-run=client -o yaml > nginx-deployment.yaml

kubectl create -f nginx-deployment.yaml

# --replicas 옵션을 이용해서 deployment의 pod 복제본을 지정할 수도 있음
kubectl create deployment --image=nginx nginx --replicas=4 --dry-run=client -o yaml > nginx-deployment.yaml
controlplane ~ ➜  kubectl get pods --no-headers
db-1-dsrnz    1/1   Running   0     3m18s
app-1-smx9c   1/1   Running   0     3m18s
app-1-tc8vm   1/1   Running   0     3m18s
app-1-l8g68   1/1   Running   0     3m18s
db-1-crx6c    1/1   Running   0     3m18s
db-1-89dwc    1/1   Running   0     3m18s
db-1-4zt7m    1/1   Running   0     3m18s