8
8
Setup Kubernetes (K8s) Cluster on AWS Using KOPS
9
9
10
10
#!/bin/bash
11
- #1 ) Create Ubuntu EC2 instance in AWS
11
+ # 1) Create Ubuntu EC2 instance in AWS
12
12
13
- 2 ) install AWSCLI
13
+ # 2) install AWSCLI
14
14
15
15
sudo apt update -y
16
16
sudo apt install unzip wget -y
@@ -20,23 +20,23 @@ Setup Kubernetes (K8s) Cluster on AWS Using KOPS
20
20
sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
21
21
22
22
23
- #3 ) Install kops software on ubuntu instance:
23
+ # 3) Install kops software on ubuntu instance:
24
24
25
25
#Install wget if not installed
26
26
sudo apt install wget -y
27
27
sudo wget https://github.com/kubernetes/kops/releases/download/v1.16.1/kops-linux-amd64
28
28
sudo chmod +x kops-linux-amd64
29
29
sudo mv kops-linux-amd64 /usr/local/bin/kops
30
30
31
- #4 ) Install kubectl
31
+ # 4) Install kubectl
32
32
33
33
sudo curl -LO https://storage.googleapis.com/kubernetes-release/release/$ (curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
34
34
sudo chmod +x ./kubectl
35
35
sudo mv ./kubectl /usr/local/bin/kubectl
36
36
aws s3 mb s3://nubonglegah.k8.local
37
37
aws s3 ls
38
38
39
- #5 ) Create an IAM role from AWS Console or CLI with below Policies.
39
+ # 5) Create an IAM role from AWS Console or CLI with below Policies.
40
40
41
41
AmazonEC2FullAccess
42
42
AmazonS3FullAccess
@@ -49,7 +49,7 @@ You Created. --> Save.
49
49
50
50
51
51
52
- #6 ) create an S3 bucket Execute below commond in KOPS Server use unique bucket name if you get bucket name exists error.
52
+ # 6) create an S3 bucket Execute below commond in KOPS Server use unique bucket name if you get bucket name exists error.
53
53
54
54
aws s3 mb s3://nubonglegah.k8.local
55
55
aws s3 ls
@@ -69,24 +69,24 @@ You Created. --> Save.
69
69
70
70
source .bashrc
71
71
72
- #7 ) Create sshkeys before creating cluster
72
+ # 7) Create sshkeys before creating cluster
73
73
74
74
ssh-keygen
75
75
76
76
77
- #8 ) Create kubernetes cluster definitions on S3 bucket
77
+ # 8) Create kubernetes cluster definitions on S3 bucket
78
78
79
79
kops create cluster --zones us-east-2c --networking weave --master-size t2.medium --master-count 1 --node-size t2.large --node-count=2 ${NAME}
80
80
81
81
kops create cluster --zones us-east-1e,zones us-east-2c --networking weave --master-size t2.medium --master-count 2 --node-size t2.micro --node-count=2 ${NAME}
82
82
83
83
kops create secret --name ${NAME} sshpublickey admin -i ~/.ssh/id_rsa.pub
84
84
85
- #9 ) Create kubernetes cluser
85
+ # 9) Create kubernetes cluser
86
86
87
87
kops update cluster ${NAME} --yes
88
88
89
- #10 ) Validate your cluster(KOPS will take some time to create cluster ,Execute below commond after 3 or 4 mins)
89
+ # 10) Validate your cluster(KOPS will take some time to create cluster ,Execute below commond after 3 or 4 mins)
90
90
91
91
kops validate cluster
92
92
@@ -103,7 +103,7 @@ You Created. --> Save.
103
103
====================================================================================================
104
104
105
105
106
- 13# IF you wan to SSH to Kubernates Master or Nodes Created by KOPS. You can SSH From KOPS_Server
106
+ 13 # IF you wan to SSH to Kubernates Master or Nodes Created by KOPS. You can SSH From KOPS_Server
107
107
108
108
ssh admin@<IPOrDNS >
109
109
it above command is not working
0 commit comments