Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sudo apt install curl -y
- curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.19.0/bin/linux/amd64/kubectl
- chmod +x ./kubectl
- sudo mv ./kubectl /usr/local/bin/kubectl
- #On AWS Console
- #Go to IAM
- #Create new user:
- #Programmatic Access
- #Create group with access : AdministratorAccess
- #Save aside the newly created user keys
- sudo apt install awscli -y
- aws configure
- #Add previously created keys : Client Key Id / Client Secret Key
- #To confirm you are successfully logged in : aws s3 ls
- curl -LO https://github.com/kubernetes/kops/releases/download/$(curl -s https://api.github.com/repos/kubernetes/kops/releases/latest | grep tag_name | cut -d '"' -f 4)/kops-linux-amd64
- chmod +x kops-linux-amd64
- sudo mv kops-linux-amd64 /usr/local/bin/kops
- aws iam create-group --group-name kops
- aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonEC2FullAccess --group-name kops
- aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonRoute53FullAccess --group-name kops
- aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonS3FullAccess --group-name kops
- aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/IAMFullAccess --group-name kops
- aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonVPCFullAccess --group-name kops
- aws iam create-user --user-name kops
- aws iam add-user-to-group --user-name kops --group-name kops
- aws iam create-access-key --user-name kops
- #Create s3 bucket, be careful not using "_" in the bucket name
- aws s3api create-bucket --bucket pso-kubernetes-state-demo --region us-east-1
- #Create your hosted DNS zone
- #Go to Route53 and create a subdomain for your dns record
- #Add the 4 route to your DNS console (cloudflare/ovh/alibaba etc.)
- host -t NS my.domain.com
- # Modifier .bashrc
- export KOPS_STATE_STORE="s3://pso-kubernetes-state-demo"
- export EDITOR=nano
- #Ressourcer le fichier .bashrc pour prendre les modifications en compte
- source ~/.bashrc
- ssh-keygen -t rsa
- #When generating keys, rename them to be easily recognizable
- kops create cluster --name=kubernetes.safecorp.fr --zones=us-east-1a --node-count=2 --node-size=t2.micro --master-size=t2.micro --dns-zone=kubernetes.safecorp.fr --ssh-public-key=/home/fitec/.ssh/kuber.pub --kubernetes-version=1.18.0
- kops update cluster --name kubernetes.safecorp.fr --yes
- #To check if your cluster is up and running
- kops validate cluster
- #Connect with private peer key
- ssh -i ~/.ssh/kuber ubuntu@x.x.x.x
- #upgrade cluster
- kops edit cluster --name kubernetes.safecorp.fr
- #Modifier la ligne kubernetesVersion par la version souhaitée
- kops update cluster --name kubernetes.safecorp.fr --yes
- kops rolling-update --name kubernetes.safecorp.fr --yes
Add Comment
Please, Sign In to add comment