https://github.com/unikraft-cloud/crossplane-provider-unikraft-cloud
⎈ Crossplane Provider for Unikraft Cloud
https://github.com/unikraft-cloud/crossplane-provider-unikraft-cloud
kraftcloud kubernetes unikernel
Last synced: 10 months ago
JSON representation
⎈ Crossplane Provider for Unikraft Cloud
- Host: GitHub
- URL: https://github.com/unikraft-cloud/crossplane-provider-unikraft-cloud
- Owner: unikraft-cloud
- License: apache-2.0
- Created: 2023-10-11T08:58:07.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-16T09:37:59.000Z (over 1 year ago)
- Last Synced: 2025-06-09T14:50:19.073Z (about 1 year ago)
- Topics: kraftcloud, kubernetes, unikernel
- Language: Go
- Homepage:
- Size: 615 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# provider-kraftcloud
`provider-kraftcloud` is an early but functional [Crossplane](https://crossplane.io/) Provider for the Kraftcloud API. This provider allows you to manage Kraftcloud resources as managed resources within Crossplane.
This initial version supports the `Instance` resource, allowing you to manage your Kraftcloud instances seamlessly.
## Supported Resources
### Instance
The `Instance` type allows you to specify the desired state of your Kraftcloud instance.
Sample resource:
```yaml
apiVersion: compute.kraftcloud.crossplane.io/v1alpha1
kind: Instance
metadata:
name: example
spec:
forProvider:
image: unikraft.io/jayc.unikraft.io/mynginx:latest
memory: "64Mi"
args:
- "-c"
- "/nginx/conf/nginx.conf"
internalPort: 80
port: 443
desiredState: stopped
providerConfigRef:
name: example
```
## Setting Up the Configuration in the Cluster
To enable provider-kraftcloud in your Crossplane setup, you'll need to set up the appropriate configuration in your cluster. This involves setting up a secret to store your Kraftcloud token and a ProviderConfig resource to reference that secret.
### Here's how to do it:
1. Install the provider-kraftcloud:
First, ensure you've installed the provider-kraftcloud to your Crossplane instance.
2. Prepare Your Kraftcloud Token:
You will need a valid Kraftcloud token to authenticate and interact with the Kraftcloud API. Once you've obtained your token, you'll need to encode it in base64. On a UNIX-like system, you can do this as follows:
bash
```sh
echo -n 'YOUR_KRAFTCLOUD_TOKEN' | base64
```
Remember the output; you will use it in the next step.
## 3. Create the Secret:
Using the base64 encoded token from the previous step, create a secret in the crossplane-system namespace:
```yaml
apiVersion: v1
kind: Secret
metadata:
namespace: crossplane-system
name: example-provider-secret
type: Opaque
data:
credentials: YOUR_BASE64_ENCODED_TOKEN
```
Apply the secret to the cluster:
```sh
kubectl apply -f
```
## 4. Create the ProviderConfig:
Now, you need to create a ProviderConfig resource that references the previously created secret:
```yaml
apiVersion: kraftcloud.crossplane.io/v1alpha1
kind: ProviderConfig
metadata:
name: example
spec:
credentials:
source: Secret
secretRef:
namespace: crossplane-system
name: example-provider-secret
key: credentials
```
Apply the ProviderConfig to the cluster:
```sh
kubectl apply -f
```
## 5. Verify Your Setup:
You can now check if the ProviderConfig and the secret were created successfully:
```sh
kubectl get providerconfigs.kraftcloud.crossplane.io
kubectl get secrets -n crossplane-system
```
If you see your example ProviderConfig and example-provider-secret secret listed, the setup is complete!
## 6. Start Using provider-kraftcloud:
With the configuration in place, you can now start creating Instance resources as defined in the earlier section, and manage your Kraftcloud instances using Crossplane.