forked from ceph/ceph-csi-operator
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bundle: Implement changes for bundle generation
Signed-off-by: Nitin Goyal <nigoyal@redhat.com>
- Loading branch information
Showing
15 changed files
with
9,442 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
include Makefile | ||
|
||
BUNDLE_IMAGE_NAME ?= $(IMAGE_NAME)-bundle | ||
|
||
BUNDLE_IMG ?= $(IMAGE_REGISTRY)/$(REGISTRY_NAMESPACE)/$(BUNDLE_IMAGE_NAME):$(IMAGE_TAG) | ||
|
||
# the PACKAGE_NAME is included in the bundle/CSV and is used in catalogsources | ||
# for operators (like OperatorHub.io). Products that include the ceph-csi-operator | ||
# bundle should use a different PACKAGE_NAME to prevent conflicts. | ||
PACKAGE_NAME ?= ceph-csi-operator | ||
|
||
# Creating the New CatalogSource requires publishing CSVs that replace one operator, | ||
# but can skip several. This can be accomplished using the skipRange annotation: | ||
SKIP_RANGE ?= | ||
|
||
# The default version of the bundle (CSV) can be found in | ||
# config/manifests/bases/ceph-csi-operator.clusterserviceversion.yaml | ||
BUNDLE_VERSION ?= 4.17.0 | ||
|
||
# DEFAULT_CHANNEL defines the default channel used in the bundle. | ||
# Add a new line here if you would like to change its default config. (E.g DEFAULT_CHANNEL = "stable") | ||
# To re-generate a bundle for any other default channel without changing the default setup, you can: | ||
# - use the DEFAULT_CHANNEL as arg of the bundle target (e.g make bundle DEFAULT_CHANNEL=stable) | ||
# - use environment variables to overwrite this value (e.g export DEFAULT_CHANNEL="stable") | ||
DEFAULT_CHANNEL ?= alpha | ||
BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL) | ||
|
||
# CHANNELS define the bundle channels used in the bundle. | ||
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "preview,fast,stable") | ||
# To re-generate a bundle for other specific channels without changing the standard setup, you can: | ||
# - use the CHANNELS as arg of the bundle target (e.g make bundle CHANNELS=preview,fast,stable) | ||
# - use environment variables to overwrite this value (e.g export CHANNELS="preview,fast,stable") | ||
CHANNELS ?= $(DEFAULT_CHANNEL) | ||
BUNDLE_CHANNELS := --channels=$(CHANNELS) | ||
|
||
OPERATOR_SDK ?= $(LOCALBIN)/operator-sdk-$(OPERATOR_SDK_VERSION) | ||
OPERATOR_SDK_VERSION ?= 1.34.1 | ||
|
||
|
||
.PHONY: bundle | ||
bundle: kustomize operator-sdk manifests | ||
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG) | ||
cd config/manifests/bases && $(KUSTOMIZE) edit add annotation --force 'olm.skipRange':"$(SKIP_RANGE)" | ||
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle \ | ||
--overwrite --manifests --metadata --package $(PACKAGE_NAME) --version $(BUNDLE_VERSION) $(BUNDLE_METADATA_OPTS) | ||
|
||
.PHONY: bundle-build | ||
bundle-build: bundle ## Build the bundle image. | ||
$(CONTAINER_TOOL) build -f bundle.Dockerfile -t $(BUNDLE_IMG) . | ||
|
||
.PHONY: bundle-push | ||
bundle-push: ## Push bundle image with the manager. | ||
$(CONTAINER_TOOL) push $(BUNDLE_IMG) | ||
|
||
.PHONY: operator-sdk | ||
operator-sdk: ## Download operator-sdk locally. | ||
@test -f $(OPERATOR_SDK) && echo "$(OPERATOR_SDK) already exists. Skipping download." && exit 0 ;\ | ||
echo "Downloading $(OPERATOR_SDK)" ;\ | ||
set -e ;\ | ||
mkdir -p $(dir $(OPERATOR_SDK)) ;\ | ||
OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \ | ||
curl -sSLo $(OPERATOR_SDK) https://github.com/operator-framework/operator-sdk/releases/download/v${OPERATOR_SDK_VERSION}/operator-sdk_$${OS}_$${ARCH} ;\ | ||
chmod +x $(OPERATOR_SDK) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM scratch | ||
|
||
# Core bundle labels. | ||
LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1 | ||
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/ | ||
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ | ||
LABEL operators.operatorframework.io.bundle.package.v1=ceph-csi-operator | ||
LABEL operators.operatorframework.io.bundle.channels.v1=alpha | ||
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.34.1 | ||
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 | ||
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v4 | ||
|
||
# Copy files to locations specified by labels. | ||
COPY bundle/manifests /manifests/ | ||
COPY bundle/metadata /metadata/ |
19 changes: 19 additions & 0 deletions
19
bundle/manifests/ceph-csi-operator-controller-manager-metrics-service_v1_service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/name: ceph-csi-operator | ||
control-plane: controller-manager | ||
name: ceph-csi-operator-controller-manager-metrics-service | ||
spec: | ||
ports: | ||
- name: https | ||
port: 8443 | ||
protocol: TCP | ||
targetPort: https | ||
selector: | ||
control-plane: controller-manager | ||
status: | ||
loadBalancer: {} |
27 changes: 27 additions & 0 deletions
27
...ifests/ceph-csi-operator-driver-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/name: ceph-csi-operator | ||
name: ceph-csi-operator-driver-editor-role | ||
rules: | ||
- apiGroups: | ||
- csi.ceph.io | ||
resources: | ||
- drivers | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- csi.ceph.io | ||
resources: | ||
- drivers/status | ||
verbs: | ||
- get |
23 changes: 23 additions & 0 deletions
23
...ifests/ceph-csi-operator-driver-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/name: ceph-csi-operator | ||
name: ceph-csi-operator-driver-viewer-role | ||
rules: | ||
- apiGroups: | ||
- csi.ceph.io | ||
resources: | ||
- drivers | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- csi.ceph.io | ||
resources: | ||
- drivers/status | ||
verbs: | ||
- get |
13 changes: 13 additions & 0 deletions
13
.../manifests/ceph-csi-operator-metrics-reader_rbac.authorization.k8s.io_v1_clusterrole.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/name: ceph-csi-operator | ||
name: ceph-csi-operator-metrics-reader | ||
rules: | ||
- nonResourceURLs: | ||
- /metrics | ||
verbs: | ||
- get |
27 changes: 27 additions & 0 deletions
27
...eph-csi-operator-operatorconfig-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/name: ceph-csi-operator | ||
name: ceph-csi-operator-operatorconfig-editor-role | ||
rules: | ||
- apiGroups: | ||
- csi.ceph.io | ||
resources: | ||
- operatorconfigs | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- csi.ceph.io | ||
resources: | ||
- operatorconfigs/status | ||
verbs: | ||
- get |
23 changes: 23 additions & 0 deletions
23
...eph-csi-operator-operatorconfig-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/name: ceph-csi-operator | ||
name: ceph-csi-operator-operatorconfig-viewer-role | ||
rules: | ||
- apiGroups: | ||
- csi.ceph.io | ||
resources: | ||
- operatorconfigs | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- csi.ceph.io | ||
resources: | ||
- operatorconfigs/status | ||
verbs: | ||
- get |
Oops, something went wrong.