Y.Baek
Learning Archive of Baek
Y.Baek
전체 방문자
오늘
어제
  • 분류 전체보기 (8)
    • 소개 (0)
    • Machine Learning (0)
    • MLOps (0)
    • 개발, 인프라 (4)
    • 알고리즘 & 코딩테스트 (1)
    • 책 리뷰 (3)
    • 생각과 경험 (0)

태그

  • 책 리뷰
  • undo
  • OKR
  • 알고리즘
  • Kubectl
  • 책리뷰
  • udemy
  • 뇌 과학
  • 프로그래밍 언어
  • 리뷰
  • Python
  • 강의
  • Update
  • Til
  • History
  • Kubernetes
  • 일잘하는법
  • 코딩테스트
  • 수학
  • 짧은 후기

인기 글

최근 글

티스토리

hELLO · Designed By 정상우.
Y.Baek

Learning Archive of Baek

개발, 인프라

[kubernetes] kubectl create vs apply ... and edit

2022. 1. 31. 15:07

요약하자면 kubectl create와 kubectl apply는 모두 생성을 위해 사용될 수 있다.
하지만 생성하고자하는 대상이 이미 존재할 때 kubectl create는 에러를 발생시키며 kubectl apply는 이미 존재하는 대상을 apply 하는 내용으로 수정시킨다.

 

자세한 내용은 아래 내용을 참고해보자

https://stackoverflow.com/questions/47369351/kubectl-apply-vs-kubectl-create

 

kubectl apply vs kubectl create?

What I understood by the documentation is that: kubectl create Creates a new k8s resource in the cluster kubectl replace Updates a resource in the live cluster kubectl apply If I want to do c...

stackoverflow.com

 

위에서 언급했듯이 apply는 생성과 수정 모두 할 수 있다. edit으로도 실행중인 리소스에 변경을 취할 수 있으며 apply가 수정 사항을 yaml 등으로 전달하는 대신 edit은 에디터가 열려서 바로 수정하고 저장하면 변경 사항이 적용된다.

 

사실 나도 뉴비라 얼마나 더 다양한 옵션이 가능할지는 모르고 내가 아는 용례 한에서 기록한 내용이다.

 

수정과 관련한 명령어들(apply, edit, replace, patch)에 관한 상세한 내용은 아래 링크에서 확인할 수 있을 것 같다.

https://blog.atomist.com/kubernetes-apply-replace-patch/

 

Kubernetes Apply vs. Replace vs. Patch

Kubernetes offers several ways to update resources: apply, edit, patch, and replace. Unfortunately, there seems to be some confusion about what each does and when to use them. This post explains the various approaches and when to use each.

blog.atomist.com

 

Reference

- Udemy lecture: Kubernetes for the Absolute Beginners - Hands-on

- https://shelling203.tistory.com/61

'개발, 인프라' 카테고리의 다른 글

[Python] Iterable, Iterator, Generator, yield. [i for i in a]와 (i for i in a)가 다른 이유  (0) 2022.02.21
[kubernetes] kubectl --record, kubectl rollout undo  (0) 2022.02.08
[kubernetes] Udemy "Kubernetes for the Absolute Beginners - Hands-on" 강의 리뷰  (0) 2022.02.07
    '개발, 인프라' 카테고리의 다른 글
    • [Python] Iterable, Iterator, Generator, yield. [i for i in a]와 (i for i in a)가 다른 이유
    • [kubernetes] kubectl --record, kubectl rollout undo
    • [kubernetes] Udemy "Kubernetes for the Absolute Beginners - Hands-on" 강의 리뷰
    Y.Baek
    Y.Baek
    ML Engineer 더 잘 기억하기 위해 기록합니다.

    티스토리툴바