diff --git a/modules/osdk-suggested-namespace.adoc b/modules/osdk-suggested-namespace.adoc new file mode 100644 index 0000000000..b85e37d89f --- /dev/null +++ b/modules/osdk-suggested-namespace.adoc @@ -0,0 +1,30 @@ +// Module included in the following assemblies: +// +// * operators/operator_sdk/osdk-generating-csvs.adoc + +[id="osdk-suggested-namespace_{context}"] += Setting a suggested namespace + +Some Operators must be deployed in a specific namespace, or with ancillary +resources in specific namespaces, in order to work properly. If resolved from a +Subscription, OLM defaults the namespaced resources of an Operator to the +namespace of its Subscription. + +As an Operator author, you can instead express a desired target namespace as +part of your CSV to maintain control over the final namespaces of the resources +installed for their Operators. When adding the Operator to a cluster using +OperatorHub, this enables the web console to autopopulate the suggested +namespace for the cluster administrator during the installation process. + +.Procedure + +* In your CSV, set the `operatorframework.io/suggested-namespace` annotation to +your suggested namespace: ++ +[source,yaml] +---- +metadata: + annotations: + operatorframework.io/suggested-namespace: <1> +---- +<1> Set your suggested namespace. diff --git a/operators/operator_sdk/osdk-generating-csvs.adoc b/operators/operator_sdk/osdk-generating-csvs.adoc index fca05167bb..3da048b56c 100644 --- a/operators/operator_sdk/osdk-generating-csvs.adoc +++ b/operators/operator_sdk/osdk-generating-csvs.adoc @@ -48,7 +48,7 @@ include::modules/osdk-manually-defined-csv-fields.adoc[leveloffset=+1] include::modules/osdk-generating-a-csv.adoc[leveloffset=+1] include::modules/olm-enabling-operator-restricted-network.adoc[leveloffset=+1] - +include::modules/osdk-suggested-namespace.adoc[leveloffset=+1] include::modules/osdk-crds.adoc[leveloffset=+1] include::modules/osdk-owned-crds.adoc[leveloffset=+2] include::modules/osdk-required-crds.adoc[leveloffset=+2]