Start kind cluster
go tool kind create cluster
Install the CRDs into the cluster:
make install
Run the Manager:
make devlog
You can apply the samples (examples) from the config/sample:
kubectl apply -k config/samples/dev
Build and push your image to the location specified by IMG
:
make docker-build docker-push IMG=<some-registry>/operator:tag
NOTE: This image ought to be published in the personal registry you specified. And it is required to have access to pull the image from the working environment. Make sure you have the proper permission to the registry if the above commands don’t work.
Install the CRDs into the cluster:
make install
Deploy the Manager to the cluster with the image specified by IMG
:
make deploy IMG=<some-registry>/operator:tag
NOTE: If you encounter RBAC errors, you may need to grant yourself cluster-admin privileges or be logged in as admin.
Delete the APIs(CRDs) from the cluster:
make uninstall
UnDeploy the controller from the cluster:
make undeploy
Or ...... delete the kind cluster.
kind delete cluster
Following are the steps to build the installer and distribute this project to users.
- Build the installer for the image built and published in the registry:
make build-installer IMG=<some-registry>/operator:tag
NOTE: The makefile target mentioned above generates an 'install.yaml' file in the dist directory. This file contains all the resources built with Kustomize, which are necessary to install this project without its dependencies.
- Using the installer
Users can just run kubectl apply -f to install the project, i.e.:
kubectl apply -f https://raw.githubusercontent.com/<org>/operator/<tag or branch>/dist/install.yaml
Create a secret named ghcr
:
kubectl create secret docker-registry ghcr --docker-server=https://ghcr.io --docker-username=<your-user> --docker-password=<your-token> --docker-email=<your-email>
then use it as imagePullSecret.
The operator creates the following resources under cosmonic.io
group:
Cluster
: Represents a wasmCloud Cluster Control PlaneHostGroup
: Represents a set of wasmcloud hosts belonging to aCluster
Component
: A single Component, including configs, links, and secretsApplication
: A set of Components, guaranteed to be scheduled on the same wasmCloud host
Full RBAC definition can be found here
- apps
- Deployment
- Statefulset
- core
- Service
- ServiceAccount
- ConfigMap
- Secret
- PersistentVolumeClaim
- Event
- coordination.k8s.io
- Lease
- authentication.k8s.io
- SubjectAccessReview