diff --git a/README.md b/README.md index e9dfe6b..09acd72 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,68 @@ -# Scoby +![TriggerMesh Logo](docs/assets/images/triggermesh-logo.png) + +![CodeQL](https://github.com/triggermesh/scoby/actions/workflows/codeql.yaml/badge.svg?branch=main) +![Static](https://github.com/triggermesh/scoby/actions/workflows/static.yaml/badge.svg?branch=main) +[![Go Report Card](https://goreportcard.com/badge/github.com/triggermesh/scoby)](https://goreportcard.com/report/github.com/triggermesh/scoby) +[![Release](https://img.shields.io/github/v/release/triggermesh/scoby?label=release)](https://github.com/triggermesh/scoby/releases) +[![Slack](https://img.shields.io/badge/Slack-Join%20chat-4a154b?style=flat&logo=slack)](https://join.slack.com/t/triggermesh-community/shared_invite/zt-1kngevosm-MY7kqn9h6bT08hWh8PeltA) Generic Kubernetes controller for simple workloads. -![scoby](docs/../docs/assets/harrison-kugler-kombucha.jpg) +![scoby](docs/assets/images/harrison-kugler-kombucha.jpg) > photo by [Harrison Kugler](https://unsplash.com/@harrisonkugler?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) ## Description -Scoby is a controller that generates controllers :infinity:, and makes it easy to manage application instances as Kubernetes objects. +Scoby is a controller that creates controllers dynamically :infinity:, and makes it easy to manage your application instances as Kubernetes objects. -Registrations are the core object of Scoby, they contain references to user a provided container image,a CRD, and workload generation parameters. +In shoft, Scoby is the shortest path between your application's container image and Kubernetes end users. -- The container image provided at the registration must receive parameters via environment variables. -- The CRD must contain all supported parameters and validations. Scoby does not add extra validations and parses user created objects without comparing with the registered CRD. -- Workloads generated by Scoby can be Deployments (with optional Service) or Knative Services. Custom Resource instances will generate environment variables that can be highly customized. +![scoby user overview](docs/assets/images/scoby-user-overview.png) -Registered CRDs will get a controller that reacts to object instances in a strictly declarative manner. +Given a container image containinng an application, a Kubernetes CRD that defines the application spec, and an Scoby registration that configures rendering, end users will be able to manage instances of your application at Kubernetes. -![scoby summary](docs/../docs/assets/scoby-summary.png) +## Primer -## Install The Development Version +There are 3 steps needed to create your Kubernetes native application: -Development version can be installed using [ko](https://github.com/ko-build/ko) +- Build the image: create a container image that Scoby can use. Parameters need to be passed via environment variables. +- Create the CRD: Scoby will use the CRD elements to create the environment variables that your application needs. Make sure your add all your validations via CRD. +- Create the CRDRegistration: the registration informs Scoby about how the CRD elements are transformed into environment variables, what image to use, and what type of workload should be created. -```console -ko apply -f ./config +A registration could look as simple as this: + +```yaml +apiVersion: scoby.triggermesh.io/v1alpha1 +kind: CRDRegistration +metadata: + name: myapp +spec: + crd: myapp.myorganization.io + workload: + fromImage: + repo: myorganization/myapp:v1 ``` -Scoby can also run locally pointing to a Kubernetes cluster, make sure the CRD registration exists. +## Install + +To install Scoby at a Kubernetes cluster apply manifests for both CRDs and Controller: ```console -# Apply registration -kubectl apply -f config/300-crdregistration.yaml +# Install Scoby CRDs +kubectl apply -f https://github.com/triggermesh/scoby/releases/latest/download/scoby-crds.yaml + +# Install Scoby Controller +kubectl apply -f https://github.com/triggermesh/scoby/releases/latest/download/scoby.yaml +``` + +Refer to [releases](https://github.com/triggermesh/scoby/releases) for further information. -# Run controller -go run cmd/scoby-controller/main.go +### Development Version + +Development version can be installed using [ko](https://github.com/ko-build/ko) + +```console +ko apply -f ./config ``` ## Usage diff --git a/docs/assets/harrison-kugler-kombucha.jpg b/docs/assets/images/harrison-kugler-kombucha.jpg similarity index 100% rename from docs/assets/harrison-kugler-kombucha.jpg rename to docs/assets/images/harrison-kugler-kombucha.jpg diff --git a/docs/assets/images/scoby-user-overview.png b/docs/assets/images/scoby-user-overview.png new file mode 100644 index 0000000..2b359fc Binary files /dev/null and b/docs/assets/images/scoby-user-overview.png differ diff --git a/docs/assets/images/triggermesh-logo.png b/docs/assets/images/triggermesh-logo.png new file mode 100644 index 0000000..3c14fd2 Binary files /dev/null and b/docs/assets/images/triggermesh-logo.png differ diff --git a/docs/assets/scoby-summary.png b/docs/assets/scoby-summary.png deleted file mode 100644 index de26d44..0000000 Binary files a/docs/assets/scoby-summary.png and /dev/null differ diff --git a/docs/hooks.md b/docs/hooks.md index 94610ac..b99fb37 100644 --- a/docs/hooks.md +++ b/docs/hooks.md @@ -190,5 +190,8 @@ The response from the finalize hook call might include the same information as t "permantent": "true|false", "continue": "true|false" }, + "status": { + + } } ``` diff --git a/pkg/hook/v1/types.go b/pkg/hook/v1/types.go index cac806c..959b134 100644 --- a/pkg/hook/v1/types.go +++ b/pkg/hook/v1/types.go @@ -50,6 +50,9 @@ type HookResponse struct { // HookResponseFinalize is the expected finalize reply from configured hooks. type HookResponseFinalize struct { Error *HookResponseError `json:"error,omitempty"` + + // Status whose elements should be merged with those that Scoby creates. + Status *commonv1alpha1.Status `json:"status,omitempty"` } // HookResponseError contains the information that Scoby needs to