You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 01-path-basics/102-your-first-cluster/readme.adoc
+1-58Lines changed: 1 addition & 58 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -141,6 +141,7 @@ The next step is link:../103-kubernetes-concepts[to learn about basic Kubernetes
141
141
The sections below provide information on other capabilities of Kubernetes clusters.
142
142
You are welcome to read and refer to them should you need to use those capabilities.
143
143
144
+
anchor:multi-master[]
144
145
== Alternative: Create a Kubernetes Cluster with kops
145
146
146
147
This section will walk you through how to install a Kubernetes cluster on AWS using kops.
@@ -152,64 +153,6 @@ The master and worker nodes within the cluster can use either DNS or the https:/
152
153
153
154
To create a cluster using the gossip protocol, simply use a cluster name with a suffix of `.k8s.local`. In the following steps, we will use `example.cluster.k8s.local` as a sample gossip cluster name. You may choose a different name as long as it ends with `.k8s.local`.
154
155
155
-
We show two examples of creating gossip-based clusters below. You can choose whether to create a single-master or multi-master cluster. Most workshop exercises will work on both types of cluster, however some modules require using a multi-master cluster _(to demonstrate rolling updates, for instance)._ If you aren't sure, please create a xref:multi-master[multi-master cluster].
156
-
157
-
=== Single-Master Cluster
158
-
159
-
By default, the `kops create cluster` command creates a single master node and two worker nodes in the specified zones.
160
-
161
-
Create a Kubernetes cluster using the following command. Run it in the "bash" terminal tab at the bottom of the Cloud9 IDE. This will create a cluster with a single master, multi-node and multi-az configuration:
162
-
163
-
$ kops create cluster \
164
-
--name example.cluster.k8s.local \
165
-
--zones $AWS_AVAILABILITY_ZONES \
166
-
--yes
167
-
168
-
The `AWS_AVAILABILITY_ZONES` environment variable should have been set during the link:../101-start-here[Cloud9 Environment Setup].
169
-
170
-
The `create cluster` command only creates and stores the cluster config in the S3 bucket. Adding the `--yes` flag ensures that the cluster is immediately created as well.
171
-
172
-
Once the `kops create cluster` command is issued, it provisions the EC2 instances, sets up Auto Scaling Groups, IAM users, Security Groups, installs Kubernetes on each node, then configures the master and worker nodes. This process can take some time based upon the number of master and worker nodes.
173
-
174
-
Note: If your 'create cluster' fails with an error like:
175
-
```
176
-
error reading s3://example-kops-state-store/example.cluster.k8s.local/config: Unable to list AWS regions: NoCredentialProviders: no valid providers in chain
177
-
caused by: EnvAccessKeyNotFound: failed to find credentials in the environment."
178
-
```
179
-
Please confirm the following environment variables are set before executing the 'create cluster' command:
180
-
```
181
-
echo $AWS_DEFAULT_PROFILE
182
-
echo $KOPS_STATE_STORE
183
-
echo $AWS_SDK_LOAD_CONFIG
184
-
```
185
-
If any of those environment variables are blank, please re-run the "Build Script" section of the link:../101-start-here[Cloud9 Environment Setup].
186
-
187
-
Wait for 5-8 minutes and then the cluster can be validated as shown:
188
-
189
-
```
190
-
$ kops validate cluster
191
-
Using cluster from kubectl context: example.cluster.k8s.local
0 commit comments