Creating a cluster

The vfarcic/k8s-specs (https://github.com/vfarcic/k8s-specs) repository will continue to serve as our source of Kubernetes definitions. We'll make sure that it is up-to-date by pulling the latest version.

All the commands from this chapter are available in the 05-hpa-custom-metrics.sh (https://gist.github.com/vfarcic/cc546f81e060e4f5fc5661e4fa003af7) Gist.
 1  cd k8s-specs
 2
 3  git pull

The requirements are the same as those we had in the previous chapter. The only exception is EKS. We'll continue using the same Gists as before for all other Kuberentes flavors.

A note to EKS users
Even though three t2.small nodes we used so far have more than enough memory and CPU, they might not be able to host all the Pods we'll create. EKS (by default) uses AWS networking. A t2.small instance can have a maximum of three network interfaces, with four IPv4 address per each. That means that we can have up to twelve IPv4 addresses on each t2.small node. Given that each Pod needs to have its own address, that means that we can have a maximum of twelve Pods per node. In this chapter, we might need more than thirty-six Pods across the cluster. Instead of creating a cluster with more than three nodes, we'll add Cluster Autoscaler (CA) to the mix, and let the cluster expand if needed. We already explored CA in one of the previous chapters and the setup instructions are now added to the Gist eks-hpa-custom.sh (https://gist.github.com/vfarcic/868bf70ac2946458f5485edea1f6fc4c).

Please use one of the Gists that follow to create a new cluster. If you already have a cluster you'd like to use for the exercises, please use the Gists to validate that it fulfills all the requirements.

Now we're ready to extend our usage of HPA. But, before we do that, let's briefly explore (again) how HPA works out of the box.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.53.93