Final Project - kubernetes - Prometheus & Grafana
- Download
curl -o max-pods-calculator.sh https://raw.githubusercontent.com/awslabs/amazon-eks-ami/master/files/max-pods-calculator.sh
- usage
./max-pods-calculator.sh --instance-type <instance-type> --cni-version 1.11.3-eksbuild.1
kubectl apply -k <kustomization_directory>
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.6.1/components.yaml
- Create Cluster
$ eksctl create cluster --name EKS-CLUSTER --region ap-northeast-2 --version 1.21 --vpc-public-subnets subnet-05ad9b35153354dbc,subnet-0ab239ec58982fb8c --without-nodegroup
$ eksctl create cluster --name EKS-CLUSTER --region ap-northeast-2 --version 1.21 --without-nodegroup
- Create NodeGroup
$ eksctl create nodegroup \
--cluster EKS-CLUSTER \
--region ap-northeast-2 \
--name NODEGROUP \
--node-type t3.small \
--nodes 2 \
--nodes-min 2 \
--nodes-max 4 \
--ssh-access \
--ssh-public-key my-key \
--managed
- Create Cluster & NodeGroup
$ eksctl create cluster --name MY-EKS-CLUSTER --version 1.21 --region ap-northeast-2 --nodegroup-name MY-NODEGROUP --node-type t3.medium --nodes 2 --nodes-min 2 --nodes-max 2 --ssh-access --ssh-public-key my-key --managed
-
--managed
: -
--unmanaged
: -
Delete NodeGroup
eksctl delete nodegroup --cluster=MY-EKS-CLUSTER --name=MY-NODEGROUP
- Delete Cluster
$ eksctl delete cluster MY-EKS-CLUSTER --region ap-northeast-2
- t2.micro = 4 (1/1) $ 0.0144/h
- t3.micro = 4 (2/1) $ 0.0130/h
- t2.small = 11 (1/2) $ 0.0288/h
- t3.small = 11 (2/2) $ 0.0260/h -> 2022-08-24 실습 채택 -> Eviction
- t3.medium = 17 (2/4) $ 0.0520/h -> 2022-08-24 실습 채택2 -> 2022-08-24 성공 -> 2022-08-25 2개 도전
- t3.large = 35 (2/8) $ 0.1040/h 5g
- c4.large = 29 (2/3.75) $ 0.1140/h
- c4.xlarge = 58 (4/7.5) $ 0.2270/h
- m5.large = 29 (2/8) $ 0.1180/h 10g
kubectl exec --stdin --tty shell-demo -- /bin/bash
kubectl exec -i -t my-pod --container main-app -- /bin/bash
- nginx test
echo "Hello" > /usr/share/nginx/html/index.html
kubectl exec my-nginx-3800858182-e9ihh -- printenv | grep SERVICE