본문 바로가기

728x90

kubernetes

쿠버네티스 네임스페이스를 생성하고 확인하고 삭제하는 방법(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.. 더보기
[kubernetes] helm 패키지 관리자 kubernetes helm 패키지 관리자 helm 패키지 설치 wget https://get.helm.sh/helm-v3.7.2-linux-amd64.tar.gz tar xvfz helm-v3.7.2-linux-amd64.tar.gz sudo mv linux-amd64/helm /usr/local/bin/. helm version $ helm version version.BuildInfo{Version:"v3.7.2", GitCommit:"663a896f4a815053445eec4153677ddc24a0a361", GitTreeState:"clean", GoVersion:"go1.16.10"} helm 사용법 helm search 명령 Search provides the ability to search.. 더보기
[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 .. 더보기
[kubernetes] kubectl create secret 명령 kubectl create secret 명령 Create a secret using specified subcommand. 사용법 Usage: kubectl create secret [flags] [options] Use "kubectl --help" for more information about a given command. Use "kubectl options" for a list of global command-line options (applies to all commands). yaml secret 생성 username 및 password base64로 인코딩 $ echo iacadmin | base64 aWFjYWRtaW4K $ echo MeH8KNZr71 | base64 TWVIOEtOWn.. 더보기
[kubernetes] kubectl run 명령 kubectl run 명령 Create and run a particular image in a pod. 사용법 Examples: # Start a nginx pod kubectl run nginx --image=nginx # Start a hazelcast pod and let the container expose port 5701 kubectl run hazelcast --image=hazelcast/hazelcast --port=5701 # Start a hazelcast pod and set environment variables "DNS_DOMAIN=cluster" and "POD_NAMESPACE=default" in the container kubectl run hazelcast --imag.. 더보기

728x90