GRPC overview

Write an extension using GRPC.

Proto schema

Your extension should generate a server from the Suffiks Extension proto schema found in the suffiks/suffiks repository.

If you like Go, we recommend using our wrapper framework.

Functions

Sync

The Sync function is called whenever Suffiks needs to synchronize the state of the extension with the state of the cluster. This function is called periodically and should be idempotent.

If you create resources in the cluster, you should add the owner reference provided in the SyncRequest to your resources.

Delete

The Delete function is called whenever the workload is deleted, or the fields your extension is responsible for is removed. This function might be called multiple times, and should be idempotent.

Default

The Default function is called whenever Suffiks receives a Mutatiing webhook from the Kubernetes API server. The only side effect this function should have is to set default values on the object, which is done by returing a JSONPatch in the DefaultResponse.

Validate

The Validate function is called whenever Suffiks receives a Validating webhook from the Kubernetes API server. This function should only validate the object, and return one or more ValidationError in the ValidateResponse if the object is invalid.

Documentation

The Documentation function is called whenever Suffiks needs to retrieve the documentation for the extension. Even if you don’t have any documentation, you should return an empty DocumentationResponse.