본문 바로가기

728x90

리눅스

쿠버네티스 네임스페이스를 생성하고 확인하고 삭제하는 방법(namespaces) 쿠버네티스 네임스페이스를 생성하고 확인하고 삭제하는 방법(namespaces) 쿠버네티스에서는 네임스페이스를 통해 리소스를 격리하고 조직화할 수 있습니다. 네임스페이스 확인 kubectl get namespaces $ kubectl get namespaces NAME STATUS AGE default Active 2d1h ingress-nginx Active 2d1h kube-node-lease Active 2d1h kube-public Active 2d1h kube-system Active 2d1h metallb-system Active 2d1h kubectl get pods --namespace kube-system kubectl get all --namespace kube-system 네임스페이스 .. 더보기
[kubernetes] 쿠버네티스 워크로드 - 파드(pods) 워크로드 - 파드(pods) myapp-pod-nginx.yaml 파일 작성 apiVersion: v1 kind: Pod metadata: name: myapp-pod-nginx labels: name: myapp-pod-nginx spec: containers: - name: myapp-pod-nginx image: nginx:latest resources: limits: memory: "128Mi" cpu: "500m" ports: - containerPort: 80 protocol: TCP 파드 생성 kubectl create -f myapp-pod-nginx.yaml $ kubectl create -f myapp-pod-nginx.yaml pod/myapp-pod-nginx created 파드 목.. 더보기
[kubernetes] 쿠버네티스 디플로이먼트 쿠버네티스 디플로이먼트(kubernetes deployment) 디플로이먼트(Deployment) 는 파드와 레플리카셋(ReplicaSet)에 대한 선언적 업데이트를 제공한다. 디플로이먼트에서 의도하는 상태 를 설명하고, 디플로이먼트 컨트롤러(Controller)는 현재 상태에서 의도하는 상태로 비율을 조정하며 변경한다. 새 레플리카셋을 생성하는 디플로이먼트를 정의하거나 기존 디플로이먼트를 제거하고, 모든 리소스를 새 디플로이먼트에 적용할 수 있다. 디플로이먼트 생성(kubectl create deployment) kubectl create deployment myapp --image=nginx $ kubectl create deployment myapp --image=nginx deployment.ap.. 더보기
Vim에서 YAML 파일을 편집하기 위한 설정(vi/vim 환경 설정) Vim에서 YAML 파일을 편집하기 위한 설정(vi/vim 환경 설정) 1. Vim 설정 파일 열기 또는 생성 vim 에디터로 yaml 파일 작성 시 인덴트 및 하이라이팅, 들여쓰기 등 기능을 사용하여 효율적으로 작성할 수 있다. .vimrc 파일 편집 ~/.vimrc 파일이 이미 있는 경우 해당 파일을 엽니다. 그렇지 않으면 새로 생성할 수 있습니다. vim ~/.vimrc 2. YAML 문법 강조 설정 YAML 파일의 문법을 강조하기 위해 filetype 플러그인을 활성화합니다. autocmd FileType yaml setlocal ts=2 sw=2 expandtab au FileType yaml noremap f :!python -c "import sys,yaml;yaml.safe_load(sys.. 더보기
[kubernetes] kubectl config 명령 - 1 쿠버네티스 kubectl config 명령 Modify kubeconfig files using subcommands like "kubectl config set current-context my-context" 사용법 The loading order follows these rules: 1. If the --kubeconfig flag is set, then only that file is loaded. The flag may only be set once and no merging takes place. 2. If $KUBECONFIG environment variable is set, then it is used as a list of paths (normal path delimiting rules.. 더보기
[draft] Kubernetes Helm 패키지 관리자 Kubernetes Helm 패키지 관리자Helm은 Kubernetes의 패키지 관리자로 애플리케이션을 배포하고 관리하는 데 유용한 도구입니다. Helm을 사용하면 애플리케이션과 관련된 모든 Kubernetes 리소스를 패키지화하여 배포하고 버전 관리를 하며 재사용할 수 있습니다.Helm 패키지 설치Helm 스크립트 설치curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3chmod 700 get_helm.sh./get_helm.sh(또는) Helm 바이너리 다운로드curl -fsSL -o helm.tar.gz https://get.helm.sh/helm-v3.7.2-linux-amd64.ta.. 더보기
[kubernetes] 커든 및 드레인 커든 및 드레인 커든(cordon) kubectl get nodes $ kubectl get nodes NAME STATUS ROLES AGE VERSION ip-192-168-27-248.ap-northeast-2.compute.internal Ready 17h v1.22.12-eks-ba74326 ip-192-168-42-8.ap-northeast-2.compute.internal Ready 17h v1.22.12-eks-ba74326 ip-192-168-67-156.ap-northeast-2.compute.internal Ready 17h v1.22.12-eks-ba74326 kubectl cordon ip-192-168-67-156.ap-northeast-2.compute.internal $ ku.. 더보기
[kubernetes] 애플리케이션 배포 전략 애플리케이션 배포 전략 Recreate Rolling-Update(Ramped) Blue/Green Canary A/B testing Shadow kubectl explain deploy.spec.strategy $ kubectl explain deploy.spec.strategy KIND: Deployment VERSION: apps/v1 RESOURCE: strategy DESCRIPTION: The deployment strategy to use to replace existing pods with new ones. DeploymentStrategy describes how to replace existing pods with new ones. FIELDS: rollingUpdate Rolling .. 더보기

728x90