Kubernetes & Crossplane
Deploying a Unikernel to Unikraft Cloud with Crossplane
Crossplane operates as a Kubernetes add-on, turning it into a universal control plane that manages both cloud services and infrastructure. It introduces the concept of ‘Infrastructure as Code,’ enabling users to define and provision cloud resources using Kubernetes-style manifest files.
Installation and Configuration of the Crossplane Provider
Before You Begin:
- Confirm administrative access to a Kubernetes cluster (can be a local one like Minikube).
- Secure a token for the Unikraft Cloud platform.
- Choose a unikraft unikernel image, like nginx.
- Ensure Crossplane and its CLI are installed in the cluster.
Installation Steps:
- Install the provider: Deploy the Unikraft Cloud provider using the command:
- Authenticate the provider against Unikraft Cloud:
Create a base64 encoded Secret in crossplane-system and apply a ProviderConfig that refers to this secret.
Paste a base64 encoded token into the credentials field in the YAML below.
Save them to a file named secret.yaml
:
Then, simply run:
Done! Your provider is now running and will be able to communicate with Unikraft Cloud’s API.
Deploying a Unikernel Instance
If you’re eager to get started quickly, you can utilize our official nginx image, readily available for all users.
For those interested in custom solutions, you can still build and use your own images — see the Quick Start guide.
To deploy an nginx instance, ensure the provider is installed and running, then use the following YAML configuration:
After applying this YAML, you will be able to list the instance via:
This will result in:
To get even more information, run:
The output of this command will contain various additional data, such as:
As you can see, one of the outputs is the DNS of the created instance. You can take that address and query it to confirm your instance is working properly:
To delete the instance, simply delete the kubernetes object. The crossplane provider will reconcile the state in Unikraft Cloud and remove the instance for you:
Troubleshooting and FAQs
How to debug issues with the provider?
The first place to start is the log output of the running provider pod. Locate the pod and inspect its logs via:
Create, delete or update the instance definition in the kubernetes cluster and look for errors in the log.
This workflow is also possible locally. If you are authenticated against a cluster with crossplane installed, check out the repo and run:
Before attempting the above, make sure the Unikraft Cloud connection token has been applied to the cluster.
Which actions does the provider support?
In its present state (0.2.0), the provider allows creating, deleting, starting and stopping running unikernel instances.
How can I see the state of my deployments?
Unikraft Cloud integrates with our kraftkit CLI. You will be able to see the instances created with crossplane by running:
For more information, please refer to kraftkit’s documentation.