ssh -v -o ServerAliveInterval=60 -i "~/.ssh/PEM-FILE-NAME.pem" [email protected]
Basic commands - https://github.com/diliplilaramani/kubernetes-template/blob/master/basic-commands.md
- Setup instance on AWS - use Amazon AMI Free Tier
- Install Kops (https://github.com/kubernetes/kops/blob/master/docs/install.md)
- Install kubectl (https://github.com/kubernetes/kops/blob/master/docs/install.md#kubectl)
- Follow K8S-AWS environment setup (https://github.com/kubernetes/kops/blob/master/docs/getting_started/aws.md)
1. Setup IAM user - directly on Amazon or use command line
2. Skip Configure DNS
3. Create cluster State storage
4. Creating your first cluster - For storage, setup StorageClass in storage-aws.yaml
- Copy-paste and run kubectl apply -f storage-aws.yaml
- Copy-paste and run kubectl apply -f mongo-stack.yaml
- In services-aws.yaml file:
1. Remove nodePort and replace type: NodePort with LoadBalancer on webapp
2. Remove nodePort and replace type: NodePort with ClusterIP on queue, api-gateway - Run kubectl apply -f services-aws.yaml
- Run kubectl apply -f workloads-aws.yaml
- Check with kubectl get all
export NAME=fleetman.k8s.local
export KOPS_STATE_STORE=s3://kops2020-state-storage
- kops delete cluster --name ${NAME} --yes
- Verify manually by visiting following pages - EC2, Volumes, Load Balancers, Auto-Scaling Group
- Stop the main k8s instance manually from where you were managing k8s
- Start the main k8s instance manually and click connect to get the ssh full url
- SSH to instance
- Run - history | grep export
- !50 - line number for export NAME and KOPS_STATE_STORE
- Press Ctlr+R to search commands - kops create cluster --zones us-east-2a ${NAME}
- kops edit ig --name ${NAME} and change minSize=3 and maxSize=5
- kops update cluster --name ${NAME} --yes
- kops validate cluster
- kubectl apply -f .
- kubectl get all -o wide - To verify with for node IP details
- For webapp url - Go to Load Balancers and select one node with random string chars and copy the public dns