Charmed Kubernetes on Equinix Metal
As with any cloud supported by Juju, Charmed Kubernetes can be deployed and used on Equinix Metal. This document provides some extra information and an overlay to help get the most out of this cloud. For instructions on installing Juju itself, please see the latest Juju documentation.
Before installing
Equinix Metal has been added to the clouds Juju automatically knows about. To check, you can run the command:
If equinix
does not appear in the list, your local Juju install probably just needs to
refresh its list of clouds. Run:
You should also add your credentials for this cloud. Use the interactive command:
...and follow the prompts to enter the information required (including the project id, and your auth token).
Bootstrapping
Bootstrap a Juju controller within one of the equinix regions.
For example, to select Dallas ‘da’ from the list of equinix-facilities
Installing
To deploy Charmed Kubernetes on Equinix Metal, it is also recommended to deploy some storage and to use Calico for networking. You can deploy and configure Charmed Kubernetes any way you like, but this example overlay will help you get started.
You can download the ceph-radosgw overlay here And download the equinix overlay here
It can then be installed with the command:
When the deployment has settled, remember to fetch the configuration file!
You can check the status by running:
juju status
At this point, there will be error messages on the workers as the pods will not run until the Cloud Controller Manager has been run.
Post install
To use Kubernetes on Equinix Metal, you should now set up the Equinix Cloud Controller Manager.
While the deployment is in progress no pods will be able to spun up on the Kubernetes due to taints being set on each node. The taints will be removed once the Cloud Controller Manager (CCM) is enabled and the nodes are registered with the cloud control plane.
First, a Kubernetes secret has to be created, defining the variables for the CCM: Configuration of the CCM can be applied via the secret, See equinix-configuration for detalis.
The next steps are to confirm the version of the CCM to use:
...enable premissions for the kube-vip
loadbalancer:
... and deploy:
Note: in some Equinix Metal facilities it is required to define a static route on each Kubernetes Worker node to allow the traffic to the workloads exposed via the Load Balancer to go via proper gateway:
Using load balancers
With the cloud load balancer capabilities enabled, actions which invoke a loadbalancer in Kubernetes will automatically trigger creation of the ElasticIP in the Metal cloud and associate it with the KubeVIP service, simultaneously adjusting BGP tables in the cloud and forward the traffic to Kubernetes nodes. This can be demonstrated with a simple application. Here we will create a simple application and scale it to five pods:
You can verify that the application and replicas have been created with:
Which should return output similar to:
To create a LoadBalancer, the application should now be exposed as a service:
To check that the service is running correctly:
...which should return output similar to:
You can see that the External IP is now in front of the five endpoints of the example deployment. You can test the ingress address:
See the guide to contributing or discuss these docs in our public Mattermost channel.