...
/Create an Amazon Elastic Kubernetes Service (EKS) cluster with jx
Create an Amazon Elastic Kubernetes Service (EKS) cluster with jx
In the lesson we will discuss how to create a EKS cluster with jx.
We'll cover the following...
- Setting environment variables
- Creating an Amazon Elastic Kubernetes Service (EKS) cluster with jx
- Cluster name, region and node type
- Cluster autoscaling
- Default admin password
- Default environment prefix
- What do we get from this command?
- Jenkins X and other installations
- Ingress installation
- Custom domain name
- Long-term logs
- Git and Github settings
- Organization
- GitOps
- kubectl context change
- Creating a Cluster Autoscaler
Setting environment variables
To interact with AWS through its CLI, we need environment variables
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION
There are other ways, but I’ll ignore them in this course.
export AWS_ACCESS_KEY_ID=[...]export AWS_SECRET_ACCESS_KEY=[...]export AWS_DEFAULT_REGION=us-east-1
Please replace the first [...]
with the AWS Access Key ID, and the second with the AWS Secret Access Key. I am assuming that you are already familiar with AWS and you know how to create those keys, or that you already have them. If that’s not the case, please follow the instructions from the Managing Access Keys for Your AWS Account Root User page.
Creating an Amazon Elastic Kubernetes Service (EKS) cluster with jx
Now we’re ready to create an EKS cluster.
Cluster name, region and node type
We’ll name it jx-rocks
(--cluster-name
). It will run inside us-east-1
region (--region
) and on t2.large
(2 CPUs and 8 GB RAM) machines (--node-type
).
Cluster autoscaling
Unlike with GKE, we won’t get a Cluster Autoscaler out of the box, but we’ll fix that later. For now, you can assume that there will eventually be autoscaling, so there’s no need to worry whether the current capacity is enough. If anything, it is likely more than we will need from the start. Still, even though autoscaling will come later, we’ll set the current (--nodes
) and minimum (--nodes-min
) number of nodes to three and the maximum to six ( --nodes-max
). That will be converted into AWS Auto-Scaling Groups and, in the case of a misstep, it’ll protect us from ending up with more nodes than we can afford.
Default admin password
We’ll also set the default Jenkins X password to admin
(--default-admin-password
). Otherwise, the process will create a random one.
Default environment prefix
Finally, we’ll set jx-rocks
as the default environment prefix (--default-environment-prefix
). A part of the process will create a few repositories (one for staging and the other for production), and that prefix will be used to form their names. We won’t go into much detail about those environments and repositories just yet, that’s ...