Skip to content

Commit

Permalink
Merge pull request #378 from ezio-auditore/prom
Browse files Browse the repository at this point in the history
Added prometheus operator dependencies
  • Loading branch information
openshift-merge-bot[bot] authored Mar 21, 2024
2 parents 2ece900 + bc40eea commit d7d0044
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ catalog/noobaa.yaml
catalog/ocs.yaml
catalog/odf.yaml
catalog/rook.yaml
catalog/prometheus.yaml
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ ROOK_SUBSCRIPTION_CHANNEL=$(ROOK_SUBSCRIPTION_CHANNEL)
ROOK_SUBSCRIPTION_STARTINGCSV=$(ROOK_SUBSCRIPTION_STARTINGCSV)
ROOK_SUBSCRIPTION_CATALOGSOURCE=$(ROOK_SUBSCRIPTION_CATALOGSOURCE)
ROOK_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE=$(ROOK_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE)
PROMETHEUS_SUBSCRIPTION_NAME=$(PROMETHEUS_SUBSCRIPTION_NAME)
PROMETHEUS_SUBSCRIPTION_PACKAGE=$(PROMETHEUS_SUBSCRIPTION_PACKAGE)
PROMETHEUS_SUBSCRIPTION_CHANNEL=$(PROMETHEUS_SUBSCRIPTION_CHANNEL)
PROMETHEUS_SUBSCRIPTION_STARTINGCSV=$(PROMETHEUS_SUBSCRIPTION_STARTINGCSV)
PROMETHEUS_SUBSCRIPTION_CATALOGSOURCE=$(PROMETHEUS_SUBSCRIPTION_CATALOGSOURCE)
PROMETHEUS_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE=$(PROMETHEUS_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE)
endef
export MANAGER_ENV_VARS

Expand Down Expand Up @@ -175,6 +181,7 @@ catalog: opm ## Generate catalog manifests and then validate generated files.
$(OPM) render --output=yaml $(NOOBAA_BUNDLE_IMG) $(OPM_RENDER_OPTS) > catalog/noobaa.yaml
$(OPM) render --output=yaml $(CSIADDONS_BUNDLE_IMG) $(OPM_RENDER_OPTS) > catalog/csiaddons.yaml
$(OPM) render --output=yaml $(ROOK_BUNDLE_IMG) $(OPM_RENDER_OPTS) > catalog/rook.yaml
$(OPM) render --output=yaml $(PROMETHEUS_BUNDLE_IMG) $(OPM_RENDER_OPTS) > catalog/prometheus.yaml
$(OPM) validate catalog

.PHONY: catalog-build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ data:
OCS_SUBSCRIPTION_NAME: ocs-operator
OCS_SUBSCRIPTION_PACKAGE: ocs-operator
OCS_SUBSCRIPTION_STARTINGCSV: ocs-operator.v4.15.0
PROMETHEUS_SUBSCRIPTION_CATALOGSOURCE: odf-catalogsource
PROMETHEUS_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE: openshift-marketplace
PROMETHEUS_SUBSCRIPTION_CHANNEL: beta
PROMETHEUS_SUBSCRIPTION_NAME: odf-prometheus-operator
PROMETHEUS_SUBSCRIPTION_PACKAGE: odf-prometheus-operator
PROMETHEUS_SUBSCRIPTION_STARTINGCSV: odf-prometheus-operator.v4.10.0
ROOK_SUBSCRIPTION_CATALOGSOURCE: odf-catalogsource
ROOK_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE: openshift-marketplace
ROOK_SUBSCRIPTION_CHANNEL: alpha
Expand Down
2 changes: 1 addition & 1 deletion bundle/manifests/odf-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ metadata:
categories: Storage
console.openshift.io/plugins: '["odf-console"]'
containerImage: quay.io/ocs-dev/odf-operator:latest
createdAt: "2024-03-13T06:42:11Z"
createdAt: "2024-03-21T13:04:01Z"
description: OpenShift Data Foundation provides a common control plane for storage
solutions on OpenShift Container Platform.
features.operators.openshift.io/token-auth-aws: "true"
Expand Down
4 changes: 4 additions & 0 deletions bundle/metadata/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ dependencies:
value:
packageName: csi-addons
version: "0.7.0"
- type: olm.package
value:
packageName: odf-prometheus-operator
version: "4.10.0"
11 changes: 11 additions & 0 deletions catalog/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,14 @@ package: rook-ceph-operator
name: alpha
entries:
- name: rook-ceph-operator.v4.15.0

---
defaultChannel: beta
name: odf-prometheus-operator
schema: olm.package
---
schema: olm.channel
package: odf-prometheus-operator
name: beta
entries:
- name: odf-prometheus-operator.v4.10.0
6 changes: 6 additions & 0 deletions config/manager/manager.env
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ ROOK_SUBSCRIPTION_CHANNEL=alpha
ROOK_SUBSCRIPTION_STARTINGCSV=rook-ceph-operator.v4.15.0
ROOK_SUBSCRIPTION_CATALOGSOURCE=odf-catalogsource
ROOK_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE=openshift-marketplace
PROMETHEUS_SUBSCRIPTION_NAME=odf-prometheus-operator
PROMETHEUS_SUBSCRIPTION_PACKAGE=odf-prometheus-operator
PROMETHEUS_SUBSCRIPTION_CHANNEL=beta
PROMETHEUS_SUBSCRIPTION_STARTINGCSV=odf-prometheus-operator.v4.10.0
PROMETHEUS_SUBSCRIPTION_CATALOGSOURCE=odf-catalogsource
PROMETHEUS_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE=openshift-marketplace
14 changes: 14 additions & 0 deletions controllers/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ var (
"ROOK_SUBSCRIPTION_STARTINGCSV": "rook-ceph-operator.v4.15.0",
"ROOK_SUBSCRIPTION_CATALOGSOURCE": "odf-catalogsource",
"ROOK_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE": "openshift-marketplace",

"PROMETHEUS_SUBSCRIPTION_NAME": "odf-prometheus-operator",
"PROMETHEUS_SUBSCRIPTION_PACKAGE": "odf-prometheus-operator",
"PROMETHEUS_SUBSCRIPTION_CHANNEL": "beta",
"PROMETHEUS_SUBSCRIPTION_STARTINGCSV": "odf-prometheus-operator.v4.10.0",
"PROMETHEUS_SUBSCRIPTION_CATALOGSOURCE": "odf-catalogsource",
"PROMETHEUS_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE": "openshift-marketplace",
}

OperatorNamespace = GetEnvOrDefault("OPERATOR_NAMESPACE")
Expand Down Expand Up @@ -96,6 +103,13 @@ var (
RookSubscriptionStartingCSV = GetEnvOrDefault("ROOK_SUBSCRIPTION_STARTINGCSV")
RookSubscriptionCatalogSource = GetEnvOrDefault("ROOK_SUBSCRIPTION_CATALOGSOURCE")
RookSubscriptionCatalogSourceNamespace = GetEnvOrDefault("ROOK_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE")

PrometheusSubscriptionName = GetEnvOrDefault("PROMETHEUS_SUBSCRIPTION_NAME")
PrometheusSubscriptionPackage = GetEnvOrDefault("PROMETHEUS_SUBSCRIPTION_PACKAGE")
PrometheusSubscriptionChannel = GetEnvOrDefault("PROMETHEUS_SUBSCRIPTION_CHANNEL")
PrometheusSubscriptionStartingCSV = GetEnvOrDefault("PROMETHEUS_SUBSCRIPTION_STARTINGCSV")
PrometheusSubscriptionCatalogSource = GetEnvOrDefault("PROMETHEUS_SUBSCRIPTION_CATALOGSOURCE")
PrometheusSubscriptionCatalogSourceNamespace = GetEnvOrDefault("PROMETHEUS_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE")
)

const (
Expand Down
17 changes: 16 additions & 1 deletion controllers/subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,22 @@ func GetStorageClusterSubscriptions() []*operatorv1alpha1.Subscription {
},
}

return []*operatorv1alpha1.Subscription{ocsSubscription, rookSubscription, noobaaSubscription, csiAddonsSubscription}
prometheusSubscription := &operatorv1alpha1.Subscription{
ObjectMeta: metav1.ObjectMeta{
Name: PrometheusSubscriptionName,
Namespace: OperatorNamespace,
},
Spec: &operatorv1alpha1.SubscriptionSpec{
CatalogSource: PrometheusSubscriptionCatalogSource,
CatalogSourceNamespace: PrometheusSubscriptionCatalogSourceNamespace,
Package: PrometheusSubscriptionPackage,
Channel: PrometheusSubscriptionChannel,
StartingCSV: PrometheusSubscriptionStartingCSV,
InstallPlanApproval: operatorv1alpha1.ApprovalAutomatic,
},
}

return []*operatorv1alpha1.Subscription{ocsSubscription, rookSubscription, noobaaSubscription, csiAddonsSubscription, prometheusSubscription}
}

// GetFlashSystemClusterSubscription return subscription for FlashSystemCluster
Expand Down
9 changes: 8 additions & 1 deletion e2e/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ var (
CsiaddonsClusterServiceVersion string
// RookClusterServiceVersion is the name of Rook csv
RookClusterServiceVersion string
// PrometheusClusterService version is the name of the Prometheus csv
PrometheusClusterServiceVersion string
)

var (
Expand All @@ -49,14 +51,15 @@ func init() {
flag.StringVar(&NoobaClusterServiceVersion, "nooba-cluster-service-version", "", "The Nooba CSV name which needs to verified")
flag.StringVar(&CsiaddonsClusterServiceVersion, "csiaddons-cluster-service-version", "", "The CSI Addon CSV name which needs to verified")
flag.StringVar(&RookClusterServiceVersion, "rook-cluster-service-version", "", "The Rook CSV name which needs to verified")
flag.StringVar(&PrometheusClusterServiceVersion, "prometheus-cluster-service-version", "", "The Prometheus CSV name which needs to verified")
flag.Parse()

verifyFlags()

// A list of names of all the csvs that should be installed
CsvNames = []string{OdfClusterServiceVersion, OcsClusterServiceVersion,
RookClusterServiceVersion, NoobaClusterServiceVersion,
CsiaddonsClusterServiceVersion}
CsiaddonsClusterServiceVersion, PrometheusClusterServiceVersion}

dm, err := deploymanager.NewDeployManager()
if err != nil {
Expand Down Expand Up @@ -94,4 +97,8 @@ func verifyFlags() {
if RookClusterServiceVersion == "" {
panic("rook-cluster-service-version is not provided")
}

if PrometheusClusterServiceVersion == "" {
panic("prometheus-cluster-service-version is not provided")
}
}
3 changes: 2 additions & 1 deletion hack/e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ cd e2e/odf && ${GINKGO} build && ./odf.test \
--ocs-cluster-service-version=${OCS_SUBSCRIPTION_STARTINGCSV} \
--nooba-cluster-service-version=${NOOBAA_SUBSCRIPTION_STARTINGCSV} \
--csiaddons-cluster-service-version=${CSIADDONS_SUBSCRIPTION_STARTINGCSV} \
--rook-cluster-service-version=${ROOK_SUBSCRIPTION_STARTINGCSV}
--rook-cluster-service-version=${ROOK_SUBSCRIPTION_STARTINGCSV} \
--prometheus-cluster-service-version=${PROMETHEUS_SUBSCRIPTION_STARTINGCSV}
13 changes: 13 additions & 0 deletions hack/make-bundle-vars.mk
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ ROOK_BUNDLE_IMG_TAG ?= v4.15.0
ROOK_BUNDLE_IMG_LOCATION ?= quay.io/ocs-dev
ROOK_BUNDLE_IMG ?= $(ROOK_BUNDLE_IMG_LOCATION)/$(ROOK_BUNDLE_IMG_NAME):$(ROOK_BUNDLE_IMG_TAG)

# To be changed when odf-prometheus-operator bundle exists
PROMETHEUS_BUNDLE_NAME ?= odf-prometheus-operator
PROMETHEUS_BUNDLE_IMG_NAME ?= $(PROMETHEUS_BUNDLE_NAME)-bundle
PROMETHEUS_BUNDLE_IMG_TAG ?= v4.10.0
PROMETHEUS_BUNDLE_IMG_LOCATION ?= quay.io/ocs-dev
PROMETHEUS_BUNDLE_IMG ?= $(PROMETHEUS_BUNDLE_IMG_LOCATION)/$(PROMETHEUS_BUNDLE_IMG_NAME):$(PROMETHEUS_BUNDLE_IMG_TAG)

# A space-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.
BUNDLE_IMGS ?= $(BUNDLE_IMG) $(OCS_BUNDLE_IMG) $(IBM_BUNDLE_IMG) $(NOOBAA_BUNDLE_IMG) $(CSIADDONS_BUNDLE_IMG) $(ROOK_BUNDLE_IMG)
Expand Down Expand Up @@ -151,6 +158,12 @@ ROOK_SUBSCRIPTION_STARTINGCSV ?= $(ROOK_BUNDLE_NAME).$(ROOK_BUNDLE_IMG_TAG)
ROOK_SUBSCRIPTION_CATALOGSOURCE ?= $(OPERATOR_CATALOGSOURCE)
ROOK_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE ?= $(OPERATOR_CATALOGSOURCE_NAMESPACE)

PROMETHEUS_SUBSCRIPTION_NAME ?= $(PROMETHEUS_BUNDLE_NAME)
PROMETHEUS_SUBSCRIPTION_PACKAGE ?= $(PROMETHEUS_BUNDLE_NAME)
PROMETHEUS_SUBSCRIPTION_CHANNEL ?= beta
PROMETHEUS_SUBSCRIPTION_STARTINGCSV ?= $(PROMETHEUS_BUNDLE_NAME).$(PROMETHEUS_BUNDLE_IMG_TAG)
PROMETHEUS_SUBSCRIPTION_CATALOGSOURCE ?= $(OPERATOR_CATALOGSOURCE)
PROMETHEUS_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE ?= $(OPERATOR_CATALOGSOURCE_NAMESPACE)
# kube rbac proxy image variables
CLUSTER_ENV ?= openshift
KUBE_RBAC_PROXY_IMG ?= gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1
Expand Down

0 comments on commit d7d0044

Please sign in to comment.