ARCH=amd64 PLATFORM=$(uname -s)_$ARCH
curl -sLO "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_$PLATFORM.tar.gz"
curl -sL "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_checksums.txt" | grep $PLATFORM | sha256sum --check
tar -xzf eksctl_$PLATFORM.tar.gz -C /tmp && rm eksctl_$PLATFORM.tar.gz
sudo mv /tmp/eksctl /usr/local/bin
sudo apt install unzip curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
sudo apt-get update sudo apt-get install ca-certificates curl gnupg sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" |
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
#Configure AWS CLI
sudo usermod -aG docker $USER
sudo chmod 666 /var/run/docker.sock
sudo docker bulid -t santa .
docker images docker run -d -p 8080:8080 --name santa 24a19d8b6e76
docker tag 24a19d8b6e76 rahulukey123/santa:latest
docker images
docker push rahulukey123/santa:latest
aws eks update-kubeconfig --region us-west-2 --name pc-eks
cluster_name=pc-eks
oidc_id=$(aws eks describe-cluster --name pc-eks --query "cluster.identity.oidc.issuer" --output text | cut -d '/' -f 5)
aws iam list-open-id-connect-providers | grep $oidc_id
eksctl utils associate-iam-oidc-provider --cluster pc-eks --approve
curl -o iam_policy.json https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.4/docs/install/iam_policy.json
aws iam create-policy
--policy-name AWSLoadBalancerControllerIAMPolicy
--policy-document file://iam_policy.json
kubectl create serviceaccount aws-load-balancer-controller -n kube-system
eksctl create iamserviceaccount
--cluster=pc-eks
--region=us-west-2
--namespace=kube-system
--name=aws-load-balancer-controller
--role-name "AmazonEKSLoadBalancerControllerRole"
--attach-policy-arn=arn:aws:iam::226567608757:policy/AWSLoadBalancerControllerIAMPolicy
--approve
--override-existing-serviceaccounts
sudo apt install openssl -y
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 > get_helm.sh chmod 700 get_helm.sh ./get_helm.sh
helm repo add eks https://aws.github.io/eks-charts
helm repo update
helm install aws-load-balancer-controller eks/aws-load-balancer-controller
-n kube-system
--set clusterName=pc-eks
--set serviceAccount.create=false
--set serviceAccount.name=aws-load-balancer-controller
kubectl get deployment -n kube-system aws-load-balancer-controller
git clone https://github.com/Rahul-ukey/santa
kubectl events deployment -n kube-system aws-load-balancer-controller
helm create java-chart Charts folder Template folder Chart.yaml Values.yaml deployment.yaml service.yaml
helm install java-chart eks-charts/java-chart -f eks-charts/java-chart/values.yaml
helm install java ./java-chart
kubectl get svc
kubectl get deployment
kubectl get events -n kube-system
cd java-chart
helm list
helm delete java
kubectl get events