This operator watches for Instance CRDs and creates corresponding Kubernetes Pods scheduled to a Kraftlet node.
Unikraft Cloud integrates seamlessly with any Kubernetes cluster through a virtual kubelet known as Kraftlet. More information in Unikraft docs.
- Kubernetes cluster - A running Kubernetes cluster for Kraftlet to join as node
- Helm - For installing Kraftlet
- Go - For running locally during development
- kubectl - For managing Kubernetes resources
helm install kraftlet \
--namespace kraftlet \
--create-namespace \
--set ukc.metro=$UKC_METRO \
--set ukc.token=$UKC_TOKEN \
--set kraftlet.podSyncWorkers=64 \
--set kraftlet.podStatusUpdateInterval="5s" \
--set kraftlet.enableInstanceFqdnAnnotations=true \
oci://ghcr.io/unikraft-cloud/helm-charts/kraftletmake installThis will install the Workload and Instance CRDs into your cluster.
go run ./cmd/main.go --server-config=config/dev/example-same-cluster.yamlThe operator is now running and will watch for CRD changes in your cluster.
You can apply a Kubernetes Service and a Deployment to a cluster. Check the examples/kraftlet for resource configuration.
kubectl apply -f examples/instance.yamlPods are scheduled to Kraftlet via nodeSelector. Kraftlet then deploys each container defined by a pod as an instance, and creates a UKC service based on the Kubernetes service configuration.
You can apply a Kubernetes Service and a Deployment to a cluster. Check the examples/kraftlet for resource configuration.
kubectl get instances.compute.datumapis.comShould return:
NAME AGE READY REASON NETWORK IP EXTERNAL IP
example-sandbox-instance 4m57s True PodReady 10.0.0.9 my-subdomain.ash-sore-hamster.unikraft.app
End-to-end tests run against a hermetic kind cluster provisioned by
datum-cloud/test-infra and
driven by Task + Chainsaw.
docker,kindtask(>= 3.x), withTASK_X_REMOTE_TASKFILES=1exportedchainsaw- Downstream CRDs for
github.com/unikraft-cloud/k8s-operatordropped intoconfig/dependencies/unikraft-k8s-operator-crds/(the upstream repo is private so the CRDs cannot be fetched automatically)
export TASK_X_REMOTE_TASKFILES=1
task test:setup # kind up, install CRDs, build + load image, deploy provider
task e2e # run chainsaw tests
task test:teardown # delete kind cluster