AB#2589: Deploy operators via Helm (#575)

* Only deploy operators on GCP/Azure.
* cert-manager is now deployed by default (GCP/Azure)
* remove OLM
This commit is contained in:
Otto Bittner 2022-11-21 10:35:40 +01:00 committed by GitHub
parent b8d991f84c
commit bdd9dd922b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
146 changed files with 12799 additions and 8706 deletions

View file

@ -234,3 +234,30 @@ catalog-build: opm ## Build a catalog image.
.PHONY: catalog-push
catalog-push: ## Push a catalog image.
$(MAKE) docker-push IMG=$(CATALOG_IMG)
HELMIFY_DIR ?= $(LOCALBIN)/helmify
HELMIFY = $(HELMIFY_DIR)/helmify
.PHONY: helmify
helmify: ## Download helmify locally if necessary.
$(call go-install-tool,$(HELMIFY),$(HELMIFY_DIR),github.com/arttor/helmify/cmd/helmify@v0.3.18)
# go-install-tool will delete old package $2, then 'go install' any package $3 to $1.
define go-install-tool
@[ -f $(1) ]|| { \
set -e ;\
rm -rf $(2) ;\
TMP_DIR=$$(mktemp -d) ;\
cd $$TMP_DIR ;\
go mod init tmp ;\
BIN_DIR=$$(dirname $(1)) ;\
mkdir -p $$BIN_DIR ;\
echo "Downloading $(3)" ;\
GOBIN=$$BIN_DIR GOFLAGS='' go install $(3) ;\
rm -rf $$TMP_DIR ;\
}
endef
.PHONY: helm
helm: manifests kustomize helmify
$(KUSTOMIZE) build config/default | $(HELMIFY)

View file

@ -196,62 +196,7 @@ More information can be found via the [Kubebuilder Documentation](https://book.k
## Production deployment
In production, it is recommended to deploy the operator using the [operator lifecycle manager (OLM)](https://olm.operatorframework.io/).
1. [Deploy OLM](https://olm.operatorframework.io/docs/getting-started/)
```shell-session
operator-sdk olm install
```
2. [Deploy Node Maintenance Operator](https://github.com/medik8s/node-maintenance-operator)
```shell-session
operator-sdk run bundle quay.io/medik8s/node-maintenance-operator-bundle:latest
```
3. Deploy node operator
```yaml
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: constellation-node-operator-catalog
namespace: olm
spec:
sourceType: grpc
# TODO: user: set desired operator catalog version here
image: ghcr.io/edgelesssys/constellation/node-operator-catalog:v0.0.1
displayName: Constellation Node Operator
publisher: Edgeless Systems
updateStrategy:
registryPoll:
interval: 10m
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: constellation-og
namespace: kube-system
spec:
upgradeStrategy: Default
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: constellation-node-operator-sub
namespace: kube-system
spec:
channel: alpha
name: constellation-node-operator
source: constellation-node-operator-catalog
sourceNamespace: olm
installPlanApproval: Automatic
# TODO: user: set desired operator version here
startingCSV: node-operator.v0.0.1
config:
env:
# TODO: user: set correct CSP here ("azure" or "gcp")
- name: CONSTEL_CSP
value: "gcp"
```
The operator is deployed automatically during `constellation-init`.
Prerequisite for this is that cert-manager is installed.
cert-manager is also installed during `constellation-init`.
To deploy you can use the Helm chart at `/cli/internal/helm/charts/edgeless/operators/constellation-operator`.