Skip to content

This repository contains plugins that extend kubebuilder for cluster/kcp aware controllers

License

Notifications You must be signed in to change notification settings

fgiloux/kcp-operator-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kcp Operator SDK

This project contains code generators to help with building cluster / kcp aware operators.

Description

After running a few commands the sdk generates all the plumbing so that operator authors can focus on designing their API and implementing the business logic.

kcp-operator-sdk will generate for you:

  • Code doing the json conversion for the API (custom resource) you have defined
  • Configuration files for
    • creating the CRD or the APIResourceSchema for your API
    • creating a kcp APIExport resource for the service
    • deploying the new controller on kcp or plain Kubernetes
    • setting up RBAC
  • Code for the controller and its manager
  • A Dockerfile for creating a container image with the controller
  • A Makefile
  • A skeleton for end to end tests

The project is based on Kubebuilder CLI extensions (plugins) and most of the features describe in the Kubebuilder documentation for go based operators are also available with the kcp-operator-sdk.

Here is a ~8 minutes demo of the operator. asciicast

Test it out!

Generate the plumbing for your operator.

$ kcp-operator-sdk init --component-config --domain tutorial.kubebuilder.io --repo github.com/yourrepo/kb-kcp-tutorial
$ kcp-operator-sdk create api --version v1alpha1 --kind Widget
$ make manifests apiresourceschemas

After you have done modifications to the API, rerun the manifest generation.

$ make manifests apiresourceschemas

Build some reconciliation logic and test it with the end-to-end tests

$ make test-e2e

NOTE: Run make --help for more information on all potential make targets

Specificities

A careful observer may notice that the create webhookcommand generates artefacts for Kubernetes deployments but not for kcp deployments. kcp is indeed taking a different direction, using CEL based conversion for API evolution.

License

kcp Operator SDK is under Apache 2.0 license. See the LICENSE file for details.

About

This repository contains plugins that extend kubebuilder for cluster/kcp aware controllers

Resources

License

Stars

Watchers

Forks

Packages

No packages published