From fac960343db9b335178b329254e44c66a94af4d9 Mon Sep 17 00:00:00 2001 From: Michael Ryan Peter Date: Mon, 19 May 2025 15:24:05 -0400 Subject: [PATCH] OSDOCS#14595: 4.19 TP [OLMv1] Specifying a deployment namespace --- extensions/ce/managing-ce.adoc | 2 + ...g-an-operator-in-a-specific-namespace.adoc | 65 +++++++++++++++++++ modules/olmv1-installing-an-operator.adoc | 2 +- snippets/olmv1-tp-extension-support.adoc | 2 +- 4 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 modules/olmv1-installing-an-operator-in-a-specific-namespace.adoc diff --git a/extensions/ce/managing-ce.adoc b/extensions/ce/managing-ce.adoc index 47c744bd6a..36062f5ce0 100644 --- a/extensions/ce/managing-ce.adoc +++ b/extensions/ce/managing-ce.adoc @@ -27,10 +27,12 @@ include::modules/olmv1-creating-a-cluster-role.adoc[leveloffset=+2] include::modules/olmv1-example-pipelines-operator-cluster-role.adoc[leveloffset=+2] include::modules/olmv1-creating-a-cluster-role-binding.adoc[leveloffset=+2] include::modules/olmv1-installing-an-operator.adoc[leveloffset=+1] +include::modules/olmv1-installing-an-operator-in-a-specific-namespace.adoc[leveloffset=+1] [role="_additional-resources"] .Additional resources * xref:../../extensions/ce/managing-ce.adoc#olmv1-supported-extensions_managing-ce[Supported extensions] +* xref:../../authentication/using-rbac.adoc#rbac-projects-namespaces_using-rbac[Projects and namespaces] * xref:../../extensions/ce/managing-ce.adoc#olmv1-creating-a-service-account_managing-ce[Creating a service account] * xref:../../extensions/ce/update-paths.adoc#olmv1-about-target-versions_update-paths[Example custom resources (CRs) that specify a target version] * xref:../../extensions/ce/update-paths.adoc#olmv1-version-range-support_update-paths[Support for version ranges] diff --git a/modules/olmv1-installing-an-operator-in-a-specific-namespace.adoc b/modules/olmv1-installing-an-operator-in-a-specific-namespace.adoc new file mode 100644 index 0000000000..8038c346ab --- /dev/null +++ b/modules/olmv1-installing-an-operator-in-a-specific-namespace.adoc @@ -0,0 +1,65 @@ +// Module included in the following assemblies: +// +// * extensions/ce/olmv1-installing-an-operator-from-a-catalog.adoc + +:_mod-docs-content-type: PROCEDURE + +[id="olmv1-deploying-a-ce-in-a-specific-namespace_{context}"] += Deploying a cluster extension in a specific namespace (Technology Preview) + +Install modes are a multi-tenancy feature of {olmv0-first}. {olmv1} does not support multi-tenancy and deploys cluster extensions to the cluster by default by using the `AllNamespaces` install mode. + +However, some existing cluster extensions do not support the `AllNamespaces` install mode. You can deploy an extension in a specific namespace by using the `OwnNamespace` or `SingleNamespace` install modes as a Technology Preview feature for `registry+v1` Operator bundles. + +The `MultiNamespace` install mode is not supported. As a result, you cannot install the same Operator multiple times on a cluster. + +:FeatureName: {Support for deploying a cluster extension in a specific namespace} +include::snippets/technology-preview.adoc[] + +For more information, see "Supported extensions". + +.Prerequisites +* Access to an {product-title} cluster using an account with `cluster-admin` permissions +* The `TechPreviewNoUpgrade` feature set enabled on the cluster +* An Operator that supports the `OwnNamespace` or `SingleNamespace` install modes + +.Procedure + +. Create a custom resource (CR), similar to the following example: ++ +.Example `.yaml` file +[source,yaml] +---- +apiVersion: olm.operatorframework.io/v1 +kind: ClusterExtension +metadata: + name: + annotations: + olm.operatorframework.io/watch-namespace: +spec: + namespace: + serviceAccount: + name: + source: + sourceType: Catalog + catalog: + packageName: + channels: + - + version: + upgradeConstraintPolicy: CatalogProvided +---- +where: + +`namespace` :: Specifies the namespace where you want the cluster extension deployed. ++ +* If the `namespace` parameter is empty or if the annotation is not present, the extension is deployed using the `AllNamespaces` install mode. +* If the `namespace` parameter is the same value as the `installed_namespace` parameter in the `spec.namespace` field, the extension is deployed using the `OwnNamespace` install mode. +* If the `namespace` parameter specifies a namespace that is different from the `installed_namespace` parameter, the extension is deployed using the `SingleNamespace` install mode. + +. Apply the CR to the cluster by running the following command: ++ +[source,terminal] +---- +$ oc apply -f .yaml +---- diff --git a/modules/olmv1-installing-an-operator.adoc b/modules/olmv1-installing-an-operator.adoc index ad15092b81..b8b74566bf 100644 --- a/modules/olmv1-installing-an-operator.adoc +++ b/modules/olmv1-installing-an-operator.adoc @@ -5,7 +5,7 @@ :_mod-docs-content-type: PROCEDURE [id="olmv1-installing-an-operator_{context}"] -= Installing a cluster extension from a catalog += Installing a cluster extension in all namespaces You can install an extension from a catalog by creating a custom resource (CR) and applying it to the cluster. {olmv1-first} supports installing cluster extensions, including {olmv0} Operators in the `registry+v1` bundle format, that are scoped to the cluster. For more information, see _Supported extensions_. diff --git a/snippets/olmv1-tp-extension-support.adoc b/snippets/olmv1-tp-extension-support.adoc index 2af0837e70..40b2c6d985 100644 --- a/snippets/olmv1-tp-extension-support.adoc +++ b/snippets/olmv1-tp-extension-support.adoc @@ -12,9 +12,9 @@ Currently, {olmv1-first} supports installing cluster extensions that meet all of * The extension must use the `registry+v1` bundle format introduced in {olmv0}. * The extension must support installation via the `AllNamespaces` install mode. +** Support for the `SingleNamespace` and `OwnNamespace` install mode is included in {product-title} {product-version} as a Technology Preview feature. * The extension must not use webhooks. * The extension must not declare dependencies by using any of the following file-based catalog properties: - ** `olm.gvk.required` ** `olm.package.required` ** `olm.constraint`