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 make catalog-deploy to allow loading dev operator from console #43

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
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
18 changes: 13 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
#
# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
# bpfman.io/bpfman-operator-bundle:$VERSION and bpfman.io/bpfman-operator-catalog:$VERSION.
IMAGE_TAG_BASE ?= bpfman.io/bpfman-operator
IMAGE_TAG_BASE ?= quay.io/bpfman/bpfman-operator

# BUNDLE_IMG defines the image:tag used for the bundle.
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
Expand All @@ -50,7 +50,6 @@ IMAGE_TAG ?= latest
BPFMAN_IMG ?= quay.io/bpfman/bpfman:$(IMAGE_TAG)
BPFMAN_AGENT_IMG ?= quay.io/bpfman/bpfman-agent:$(IMAGE_TAG)
BPFMAN_OPERATOR_IMG ?= quay.io/bpfman/bpfman-operator:$(IMAGE_TAG)
BPFMAN_OPERATOR_BUNDLE_IMG ?= quay.io/bpfman/bpfman-operator-bundle:$(IMAGE_TAG)
KIND_CLUSTER_NAME ?= bpfman-deployment

# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
Expand Down Expand Up @@ -344,11 +343,11 @@ load-images-kind: ## Load bpfman-agent, and bpfman-operator images into the runn

.PHONY: bundle-build
bundle-build: ## Build the bundle image.
docker build -f Containerfile.bundle -t $(BPFMAN_OPERATOR_BUNDLE_IMG) .
docker build -f Containerfile.bundle -t $(BUNDLE_IMG) .

.PHONY: bundle-push
bundle-push: ## Push the bundle image.
docker push $(BPFMAN_OPERATOR_BUNDLE_IMG)
docker push $(BUNDLE_IMG)

# A comma-separated list of bundle images (e.g. make catalog-build BUNDLE_IMGS=example.com/operator-bundle:v0.1.0,example.com/operator-bundle:v0.2.0).
# These images MUST exist in a registry and be pull-able.
Expand All @@ -368,7 +367,6 @@ endif
.PHONY: catalog-build
catalog-build: opm ## Build a catalog image.
$(OPM) index add --container-tool docker --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) $(FROM_INDEX_OPT)

# Push the catalog image.
.PHONY: catalog-push
catalog-push: ## Push a catalog image.
Expand Down Expand Up @@ -434,3 +432,13 @@ deploy-openshift: manifests kustomize ## Deploy bpfman-operator to the Openshift
.PHONY: undeploy-openshift
undeploy-openshift: ## Undeploy bpfman-operator from the Openshift cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/openshift | kubectl delete --ignore-not-found=$(ignore-not-found) -f -

# Deploy the catalog.
.PHONY: catalog-deploy
catalog-deploy: ## Deploy a catalog image.
$(SED) -e 's~<IMAGE>~$(CATALOG_IMG)~' ./config/catalog/catalog.yaml | kubectl apply -f -

# Undeploy the catalog.
.PHONY: catalog-undeploy
catalog-undeploy: ## Undeploy a catalog image.
kubectl delete -f ./config/catalog/catalog.yaml
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,30 @@ To clean up at a later time, execute:
operator-sdk cleanup bpfman-operator
```

#### 3. Deploy as a bundle from the Console's OperatorHub page

This mode is recommended when you want to test the customer experience of navigating through the operators'
catalog and installing/configuring it manually through the UI, prior to committing the bundle to either: -

- https://github.com/redhat-openshift-ecosystem/community-operators-prod

or

- https://github.com/k8s-operatorhub/community-operators/pulls

```sh
export BUNDLE_IMG=quay.io/$USER/bpfman-operator-bundle:developement
make bundle bundle-build bundle-push
export CATALOG_IMG=quay.io/$USER/bpfman-operator-catalog:developement
make catalog-build catalog-push catalog-deploy
```

To clean up at a later time, execute:

```bash
make catalog-undeploy
```

## Verify the Installation

Regardless of the deployment method, if the `bpfman-operator` was deployed successfully,
Expand Down Expand Up @@ -182,4 +206,4 @@ object to find references to the bpfMap pinpoints (`spec.maps`) to configure the
## Developer

For more architecture details about `bpfman-operator`, refer to
[Developing the bpfman-operator](https://bpfman.io/v0.5.0-rc1/developer-guide/develop-operator)
[Developing the bpfman-operator](https://bpfman.io/v0.5.0-rc1/developer-guide/develop-operator)
21 changes: 20 additions & 1 deletion bundle/manifests/bpfman-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,18 @@ metadata:
capabilities: Basic Install
categories: OpenShift Optional
containerImage: quay.io/bpfman/bpfman-operator:v0.0.0
createdAt: "2024-07-12T15:52:56Z"
createdAt: "2024-07-12T16:12:00Z"
features.operators.openshift.io/cnf: "false"
features.operators.openshift.io/cni: "false"
features.operators.openshift.io/csi: "true"
features.operators.openshift.io/disconnected: "true"
features.operators.openshift.io/fips-compliant: "true"
features.operators.openshift.io/proxy-aware: "false"
features.operators.openshift.io/tls-profiles: "false"
features.operators.openshift.io/token-auth-aws: "false"
features.operators.openshift.io/token-auth-azure: "false"
features.operators.openshift.io/token-auth-gcp: "false"
operatorframework.io/suggested-namespace: bpfman
operatorframework.io/suggested-namespace-template: |-
{
"apiVersion": "v1",
Expand All @@ -313,9 +324,17 @@ metadata:
},
}
}
operators.openshift.io/infrastructure-features: '["csi", "disconnected"]'
operators.openshift.io/valid-subscription: '["OpenShift Kubernetes Engine", "OpenShift
Container Platform", "OpenShift Platform Plus"]'
operators.operatorframework.io/builder: operator-sdk-v1.27.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/bpfman/bpfman
labels:
operatorframework.io/arch.amd64: supported
operatorframework.io/arch.arm64: supported
operatorframework.io/arch.ppc64le: supported
operatorframework.io/arch.s390x: supported
name: bpfman-operator.v0.5.0-rc3
namespace: placeholder
spec:
Expand Down
13 changes: 13 additions & 0 deletions config/catalog/catalog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: bpfmanoperator-dev-catalog
namespace: openshift-marketplace
spec:
sourceType: grpc
image: <IMAGE>
displayName: Bpfman Operator development catalog
publisher: Me
updateStrategy:
registryPoll:
interval: 1m
18 changes: 18 additions & 0 deletions config/manifests/bases/bpfman-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
capabilities: Basic Install
containerImage: quay.io/bpfman/bpfman-operator:v0.0.0
repository: https://github.com/bpfman/bpfman
operatorframework.io/suggested-namespace: bpfman
operatorframework.io/suggested-namespace-template: |-
{
"apiVersion": "v1",
Expand All @@ -23,6 +24,23 @@ metadata:
},
}
}
features.operators.openshift.io/disconnected: "true"
features.operators.openshift.io/fips-compliant: "true"
features.operators.openshift.io/proxy-aware: "false"
features.operators.openshift.io/cnf: "false"
features.operators.openshift.io/cni: "false"
features.operators.openshift.io/csi: "true"
features.operators.openshift.io/tls-profiles: "false"
features.operators.openshift.io/token-auth-aws: "false"
features.operators.openshift.io/token-auth-azure: "false"
features.operators.openshift.io/token-auth-gcp: "false"
operators.openshift.io/infrastructure-features: '["csi", "disconnected"]'
operators.openshift.io/valid-subscription: '["OpenShift Kubernetes Engine", "OpenShift Container Platform", "OpenShift Platform Plus"]'
labels:
operatorframework.io/arch.amd64: supported
operatorframework.io/arch.arm64: supported
operatorframework.io/arch.ppc64le: supported
operatorframework.io/arch.s390x: supported
astoycos marked this conversation as resolved.
Show resolved Hide resolved
name: bpfman-operator.v0.0.0
namespace: placeholder
spec:
Expand Down
Loading