-
create ec2 bootstrap instance
-
ssh to ec2
aws configure
- install kops
https://github.com/kubernetes/kops/blob/master/docs/getting_started/aws.md
curl -Lo kops 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
sudo mv ./kops /usr/local/bin/
- install kubectl
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
aws s3api create-bucket \
--bucket svl-kops-state-store \
--region us-east-1
export NAME=svlcluster.k8s.local
export KOPS_STATE_STORE=s3://svl-kops-state-store
aws ec2 describe-availability-zones --region eu-central-1
eu-central-1a
eu-central-1b
eu-central-1c
kops create cluster \
--zones eu-central-1a,eu-central-1b,eu-central-1c \
${NAME}
ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa
kops create secret --name ${NAME} sshpublickey admin -i ~/.ssh/id_rsa.pub
kops edit cluster ${NAME}
kops edit ig nodes --name ${NAME}
kops get ig --name ${NAME}
kops update cluster ${NAME} --yes
Cluster is starting. It should be ready in a few minutes.
Suggestions:
* validate cluster: kops validate cluster --wait 10m
* list nodes: kubectl get nodes --show-labels
* ssh to the master: ssh -i ~/.ssh/id_rsa ubuntu@api.svlcluster.k8s.local
* the ubuntu user is specific to Ubuntu. If not using Ubuntu please use the appropriate user based on your OS.
* read about installing addons at: https://kops.sigs.k8s.io/operations/addons.
scp -i key.pem -r fleetman ec2-user@18.185.96.228:/home/ec2-user
scp -i key.pem -r elk ec2-user@3.122.229.25:/home/ec2-user
kops delete cluster --name ${NAME} --yes
for restart reexport env