diff --git a/operator/Makefile b/operator/Makefile index 90fb198ff5f4..2a5ec4455560 100644 --- a/operator/Makefile +++ b/operator/Makefile @@ -12,9 +12,10 @@ default: all # Updates this value when a new version of the product should include this operator and its bundle. CLUSTER_LOGGING_VERSION ?= 5.1.preview.1 -# CLUSTER_LOGGING_NS -# defines the default namespace of the OpenShift Cluster Logging product. -CLUSTER_LOGGING_NS ?= openshift-logging +# LOKI_OPERATOR_NS +# defines the default namespace of the Loki Operator in OpenShift. +# Loki Operator will be installed in this namespace. +LOKI_OPERATOR_NS ?= openshift-operators-redhat # VERSION # defines the project version for the bundle. @@ -178,15 +179,15 @@ olm-deploy: ## Deploy the operator bundle and the operator via OLM into an Kube $(error Set variable REGISTRY_ORG to use a custom container registry org account for local development) else olm-deploy: olm-deploy-bundle olm-deploy-operator $(OPERATOR_SDK) - kubectl create ns $(CLUSTER_LOGGING_NS) - kubectl label ns/$(CLUSTER_LOGGING_NS) openshift.io/cluster-monitoring=true --overwrite - $(OPERATOR_SDK) run bundle -n $(CLUSTER_LOGGING_NS) --install-mode OwnNamespace $(BUNDLE_IMG) + kubectl create ns $(LOKI_OPERATOR_NS) + kubectl label ns/$(LOKI_OPERATOR_NS) openshift.io/cluster-monitoring=true --overwrite + $(OPERATOR_SDK) run bundle -n $(LOKI_OPERATOR_NS) --install-mode OwnNamespace $(BUNDLE_IMG) endif .PHONY: olm-undeploy olm-undeploy: $(OPERATOR_SDK) ## Cleanup deployments of the operator bundle and the operator via OLM on an OpenShift cluster selected via KUBECONFIG. $(OPERATOR_SDK) cleanup loki-operator - kubectl delete ns $(CLUSTER_LOGGING_NS) + kubectl delete ns $(LOKI_OPERATOR_NS) .PHONY: deploy-size-calculator ifeq ($(findstring openshift-logging,$(CALCULATOR_IMG)),openshift-logging) diff --git a/operator/docs/forwarding_logs_to_gateway.md b/operator/docs/forwarding_logs_to_gateway.md index 88a0c538db7e..9738e974ec6a 100644 --- a/operator/docs/forwarding_logs_to_gateway.md +++ b/operator/docs/forwarding_logs_to_gateway.md @@ -36,7 +36,7 @@ metadata: name: lokistack-dev-tenant-logs-role rules: - apiGroups: - - 'loki.openshift.io' + - 'loki.grafana.com' resources: - application - infrastructure diff --git a/operator/docs/hack_loki_operator.md b/operator/docs/hack_loki_operator.md index 4a80f83d1a28..a735348ade59 100644 --- a/operator/docs/hack_loki_operator.md +++ b/operator/docs/hack_loki_operator.md @@ -93,12 +93,18 @@ It will undeploy controller from the configured Kubernetes cluster in [~/.kube/c where `$YOUR_QUAY_ORG` is your personal [quay.io](http://quay.io/) account where you can push container images and `$VERSION` can be any random version number such as `v0.0.1`. - The above command will deploy the operator to your active Openshift cluster defined by your local [kubeconfig](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/). The operator will be running in the `openshift-logging` namespace. + The above command will deploy the operator to your active Openshift cluster defined by your local [kubeconfig](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/). The operator will be running in the `openshift-operators-redhat` namespace. * You can confirm that the operator is up and running using: ```console - kubectl -n openshift-logging get pods + kubectl -n openshift-operators-redhat get pods + ``` + +* Next step is to create the `openshift-logging` namespace in the cluster: + + ```console + kubectl create ns openshift-logging ``` * Now you need to create a storage secret for the operator. This can be done using: @@ -157,7 +163,7 @@ It will undeploy controller from the configured Kubernetes cluster in [~/.kube/c If you don't want `lokistack-gateway` component [1] then you can skip it by removing the `--with-lokistack-gateway` args from the `loki-operator-controller-manager` deployment: ```console - kubectl -n openshift-logging edit deployment/loki-operator-controller-manager + kubectl -n openshift-operators-redhat edit deployment/loki-operator-controller-manager ``` Delete the flag `--with-lokistack-gateway` from the `args` section and save the file. This will update the deployment and now you can create LokiStack instance using: diff --git a/operator/docs/storage_size_calculator.md b/operator/docs/storage_size_calculator.md index 589720cce74b..883490dd0142 100644 --- a/operator/docs/storage_size_calculator.md +++ b/operator/docs/storage_size_calculator.md @@ -17,6 +17,12 @@ Storage Size Calculator is used to have an idea on how to properly size a Loki c * Deploy the [Loki Operator](https://github.com/grafana/loki/blob/master/operator/docs/hack_loki_operator.md#hacking-on-loki-operator-on-openshift) to the cluster. +* Create the `openshift-logging` namespace in the cluster: + + ```console + kubectl create ns openshift-logging + ``` + * Deploy the storage size calculator by executing following command in the terminal: ```console diff --git a/operator/internal/manifests/gateway_tenants_test.go b/operator/internal/manifests/gateway_tenants_test.go index 7af8ff034869..8bd6d7334a16 100644 --- a/operator/internal/manifests/gateway_tenants_test.go +++ b/operator/internal/manifests/gateway_tenants_test.go @@ -203,9 +203,9 @@ func TestConfigureDeploymentForMode(t *testing.T) { "--web.listen=:8082", "--web.internal.listen=:8083", "--web.healthchecks.url=http://localhost:8082", - `--openshift.mappings=application=loki.openshift.io`, - `--openshift.mappings=infrastructure=loki.openshift.io`, - `--openshift.mappings=audit=loki.openshift.io`, + `--openshift.mappings=application=loki.grafana.com`, + `--openshift.mappings=infrastructure=loki.grafana.com`, + `--openshift.mappings=audit=loki.grafana.com`, }, Ports: []corev1.ContainerPort{ { @@ -298,9 +298,9 @@ func TestConfigureDeploymentForMode(t *testing.T) { "--web.healthchecks.url=http://localhost:8082", "--tls.internal.server.cert-file=/var/run/tls/tls.crt", "--tls.internal.server.key-file=/var/run/tls/tls.key", - `--openshift.mappings=application=loki.openshift.io`, - `--openshift.mappings=infrastructure=loki.openshift.io`, - `--openshift.mappings=audit=loki.openshift.io`, + `--openshift.mappings=application=loki.grafana.com`, + `--openshift.mappings=infrastructure=loki.grafana.com`, + `--openshift.mappings=audit=loki.grafana.com`, }, Ports: []corev1.ContainerPort{ { @@ -435,9 +435,9 @@ func TestConfigureDeploymentForMode(t *testing.T) { "--web.healthchecks.url=http://localhost:8082", "--tls.internal.server.cert-file=/var/run/tls/tls.crt", "--tls.internal.server.key-file=/var/run/tls/tls.key", - `--openshift.mappings=application=loki.openshift.io`, - `--openshift.mappings=infrastructure=loki.openshift.io`, - `--openshift.mappings=audit=loki.openshift.io`, + `--openshift.mappings=application=loki.grafana.com`, + `--openshift.mappings=infrastructure=loki.grafana.com`, + `--openshift.mappings=audit=loki.grafana.com`, }, Ports: []corev1.ContainerPort{ { diff --git a/operator/internal/manifests/openshift/opa_openshift.go b/operator/internal/manifests/openshift/opa_openshift.go index bf175e684f11..23fcf9899d9e 100644 --- a/operator/internal/manifests/openshift/opa_openshift.go +++ b/operator/internal/manifests/openshift/opa_openshift.go @@ -14,7 +14,7 @@ const ( defaultOPAImage = "quay.io/observatorium/opa-openshift:latest" opaContainerName = "opa" opaDefaultPackage = "lokistack" - opaDefaultAPIGroup = "loki.openshift.io" + opaDefaultAPIGroup = "loki.grafana.com" opaMetricsPortName = "opa-metrics" )