Digital Ocean Kubernetes Challenge : Setting up crossplane on a DO Managed kubernetes instance
This blog post is part of the Digital Ocean Kubernetes Challenge and about how to setup the still in development DO-Crossplane Provider. This guide should provide useful to people as the current documentation is still lacking. Big shoutout to @kimschles for helping me figure part of this out.
Setup DO K8s Cluster and have kubectl setup to connect to the cluster
First we need to setup a digital ocean Kubernetes cluster, and use the doctl tooling to automatically generate the relevant kubectl configuration, the digital ocean GUI guides you through how to do this.
Install Basic Crossplane
Next install crossplane CLI
Note this is how the offical crossplane CLI documentation recomends installing it, you should never pipe directly into sh, see this as to why you shouldn’t pipe into shell.
Install the Custom Resource Definitions for the DO Provider
Next install the latest version of the digital ocean provider
In a new terminal window launch the provider
Deployment
Now we are finally ready to start deploying
First we need to create an ProviderConfig CRD and a Provider secret in the crossplane-system
namespace.
This is done by creating the following provider.yml
file where the data:token:
is a base64 encoded version of a digital ocean api token with read/write permissions
Then once the file provider.yml
is created, it can be applied to the cluster via
kubectl -n crossplane-system apply -f provider.yml
Finally we are ready to deploy digital ocean infrastructure! Currently the do-provider only supports droplets and load balancers.
Droplets can then be spun up like the provider.yml
file by creating a yml file with the following schema.
and again applying it with kubectl -n crossplane-system apply -f droplet.yml
Loadbalancers follow the following schema
There you have it! Thats how you install and use the crossplane digital ocean provider to manage DO droplets and loadbalancers. Now obviously this software is still in the very early stages so I personally wouldn’t reccomend using it for production, but exciting to see how it evolves!