Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Quick Start and Introduction documentation #118

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,41 @@
![Build Status](https://github.com/operator-framework/helm-operator-plugins/workflows/CI/badge.svg?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/operator-framework/helm-operator-plugins/badge.svg?branch=master)](https://coveralls.io/github/operator-framework/helm-operator-plugins?branch=master)

Experimental refactoring of the operator-framework's helm operator
Reimplementation of the helm operator to enrich the Helm operator's reconciliation with custom Go code to create a
hybrid operator.

## Introduction

The Helm operator type automates Helm chart operations
by mapping the [values](https://helm.sh/docs/chart_template_guide/values_files/) of a Helm chart exactly to a
`CustomResourceDefinition` and defining its watched resources in a `watches.yaml`
[configuration](https://sdk.operatorframework.io/docs/building-operators/helm/tutorial/#watch-the-nginx-cr) file.

For creating a [Level II+](https://sdk.operatorframework.io/docs/advanced-topics/operator-capabilities/operator-capabilities/) operator
that reuses an already existing Helm chart, a [hybrid](https://github.com/operator-framework/operator-sdk/issues/670)
between the Go and Helm operator types is necessary.

The hybrid approach allows adding customizations to the Helm operator, such as:
- value mapping based on cluster state, or
- executing code in specific events.

## Quick start

### Creating a Helm reconciler

```go
// Operator's main.go
chart, err := loader.Load("path/to/chart")
if err != nil {
panic(err)
}

reconciler := reconciler.New(
reconciler.WithChart(*chart),
reconciler.WithGroupVersionKind(gvk),
)

if err := reconciler.SetupWithManager(mgr); err != nil {
panic(fmt.Sprintf("unable to create reconciler: %s", err))
}
```