Kops와 eksctl 설치하기

Description: kubernetes 오케스트레이션 툴인 Kops와 AWS의 mangaed kubernets인 eksctl의 설치에 관한 내용입니다.

현재 노트: KR-020.10 c Kops와 eksctl 설치하기
상위 분류: KR-020.10 Docker,Kubernetes

#Docker #Kubernetes #EKS

kops_install.sh

# helm repo update and fetch
kubectl create ns gitlab
helm repo add gitlab https://charts.gitlab.io/
helm repo update
helm fetch gitlab/gitlab --untar --version major.minor.patch

# after edit value.yaml file or git clone it



# helm install
helm install gitlab gitlab/gitlab -f ~/gitlab/values.yaml --namespace gitlab --version major.minor.partch

# check root user password
kubectl get secrets -n gitlab gitlab-gitlab-initial-root-password --template={{.data.password}} | base64 -d


# delete GitLab
helm uninstall -n gitlab gitlab
kubectl delete pvc --all -n gitlab
kubectl delete ns gitlab

# Delete Resources
kops delete cluster --yes && aws cloudformation delete-stack --stack-name mykops

eksctl commands

#100#Infra#110#DevOps_Engineer_Infra#110.10#Kubernetes#110.10 b#eksctl_commands

Install Kubectl

# Download kubectl
    - echo "Downloading and installing kubectl version ${KUBECTL_VERSION}..."
    - curl -O https://s3.us-west-2.amazonaws.com/amazon-eks/${KUBECTL_VERSION}/2024-01-04/bin/linux/amd64/kubectl
    - chmod +x ./kubectl
    - mkdir -p $HOME/bin && cp ./kubectl $HOME/bin/kubectl && export PATH=$HOME/bin:$PATH
    - echo "Cheking kubectl successfully installed"
    - kubectl version --client

Install eksctl

# Download ekscxtl
    - echo "Download start eksctl"
    - ARCH=amd64
    - PLATFORM=$(uname -s)_$ARCH
    - curl -sLO "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_$PLATFORM.tar.gz"
    - tar -xzf eksctl_$PLATFORM.tar.gz -C /tmp && rm eksctl_$PLATFORM.tar.gz
    - mv /tmp/eksctl /usr/local/bin
    - echo "Checking eksctl successfully installed"
    - eksctl info

get kubeconfig from existing EKS Cluster
aws eks --region ap-northeast-2 update-kubeconfig --name <my-cluster>