Skip to content

Deploy kubernetes cluster with VPC, IAM, CSI with other configurations

Notifications You must be signed in to change notification settings

TareqMonwer/k8s-deployment-iac

Repository files navigation

Deploy Services on EKS

  1. Create IAM Role with EKSClusterPolicy
  2. Create VPC with 2 public & private subnets
  3. Create a cluster (control plane gets created)
  4. Create Security group from ec2
  5. Create key-pair from ec2
  6. Create a nodegroup - another security group is created
  7. Based on nodegroup config, number of EC2 will be created
  8. Configure bastion host EC2 instance with public subnet
  9. Login in bastion host using public ip via ssh ssh -i night-owl-dev-cluster.pem ec2-user@<bastion-ec2-public-ip, use pem from step 5
  10. configure terminal (remote) to access aws aws configure
  11. install kubectl inside bastion host: https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html#linux_amd64_kubectl
  12. Create kubeconfig file for the cluster: https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html | aws eks update-kubeconfig --region ap-southeast-1 --name night-owl-dev-cluster
  13. To make kubectl commands work, update cluster Networking > network security group
  14. add/update inbound rule, add https from bastion-host-scgrop
  15. at this point, we can run kubectl get ... and other kubectl commands.

Manual Setup: EBS Storage with K8S Cluster:

eksctl utils associate-iam-oidc-provider --region ap-southeast-1 --cluster owl-cluster --approve eksctl create iamserviceaccount
--name ebs-csi-controller-sa
--namespace kube-system
--cluster owl-cluster
--attach-policy-arn arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy
--approve
--region ap-southeast-1 kubectl apply -k "github.com/kubernetes-sigs/aws-ebs-csi-driver/deploy/kubernetes/overlays/stable/?ref=release-1.38"

Check available addon versions for aws cluster addons.

aws eks describe-addon-versions
--kubernetes-version=1.31
--addon-name=aws-ebs-csi-driver
--query='addons[].addonVersions[].addonVersion'

Deploy Infra

terraform apply -var-file="secrets.tfvars"

About

Deploy kubernetes cluster with VPC, IAM, CSI with other configurations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages