diff --git a/ejb-txn-remote-call/README-source.adoc b/ejb-txn-remote-call/README-source.adoc index 0e1c630767..a651c9bc7d 100644 --- a/ejb-txn-remote-call/README-source.adoc +++ b/ejb-txn-remote-call/README-source.adoc @@ -727,51 +727,32 @@ wildfly-operator-5d4b7cc868-zfxcv 1/1 Running 1 22h endif::[] ifdef::ProductRelease[] -To install {productName}'s Operator, follow the https://docs.redhat.com/en/documentation/red_hat_jboss_enterprise_application_platform/8.0/html/using_jboss_eap_on_openshift_container_platform/assembly_deploying-your-jboss-eap-application-on-the-openshift-container-platform_default#proc_installing-eap-operator-using-the-cli_assembly_jboss-eap-operator-for-automating-application-deployment-on-openshift[official documentation] (which instructions are also reported here for convenience) -[NOTE] +[WARNING] ==== -* You have access to an OpenShift Container Platform cluster using an account with cluster-admin permissions. -* You have installed the oc tool in your local system. +For simplicity, this quickstart installs the EAP operator globally in the `openshift-operators` namespace, making it available across all namespaces in the cluster. The `openshift-operators` namespace already contains a `global-operators` OperatorGroup, so you must NOT create an additional OperatorGroup or the operator will fail to start. In production environments, consider namespace-scoped installation (see note below) to limit scope and improve security. ==== -. View the list of operators available to the cluster from the OperatorHub: -+ -[source,sh,options="nowrap",subs="+quotes,attributes+"] ----- -oc get packagemanifests -n openshift-marketplace | grep eap ----- -. Create a `Subscription` object YAML file (for example, `eap-operator-sub.yaml`) to subscribe a namespace to your EAP operator. The following is an example `Subscription` object YAML file: -+ -[source,sh,options="nowrap",subs="+quotes,attributes+"] ----- -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - name: eap - namespace: openshift-operators -spec: - channel: stable - installPlanApproval: Automatic - name: eap - source: redhat-operators - sourceNamespace: openshift-marketplace ----- -. Create the `Subscription` object from the YAML file: -+ +. Log in into the Openshift console as `kubeadmin` user (or any cluster administrator). +. Install the EAP operator globally. + +In your terminal, run the following command to subscribe the EAP operator. [source,sh,options="nowrap",subs="+quotes,attributes+"] ---- -oc apply -f eap-operator-sub.yaml +$ oc apply -f charts/eap-operator-sub.yaml --wait --timeout=10m0s ---- -+ -The EAP operator is successfully installed. At this point, the OLM is aware of the EAP operator. -A ClusterServiceVersion (CSV) for the operator appears in the target namespace, and APIs provided by the EAP operator is available for creation. -To verify that the {productName} Operator is running, execute the following command: -+ + +To verify the operator is ready to use, you can run the following command. You should see the following output. +The `PHASE` needs to be `Succeeded` [source,sh,options="nowrap",subs="+quotes,attributes+"] ---- -oc get csv -n openshift-operators +$ oc get ClusterServiceVersion -n openshift-operators ---- + +NOTE: For namespace-scoped installation: Edit `charts/eap-operator-group.yaml` to replace `` with your project namespace, and edit `charts/eap-operator-sub.yaml` to replace `openshift-operators` with your project namespace. Then apply both files: `oc apply -f charts/eap-operator-group.yaml && oc apply -f charts/eap-operator-sub.yaml` + +NOTE: For namespace-scoped installation: To verify the operator is ready to use remove the `-n openshift-operators` parameter. + endif::[] [#_start_postgresql_database] @@ -925,8 +906,24 @@ make undeploy endif::[] ifdef::ProductRelease[] + +To uninstall the EAP operator (global installation): [source,sh,options="nowrap"] ---- -oc delete -f eap-operator-sub.yaml +oc delete -f charts/eap-operator-sub.yaml --wait --timeout=10m0s +oc delete csv --all -n openshift-operators ---- + +To uninstall the EAP operator (namespace-scoped installation): +[source,sh,options="nowrap"] +---- +oc delete -f charts/eap-operator-sub.yaml -n NAMESPACE --wait --timeout=10m0s +oc delete -f charts/eap-operator-group.yaml +oc delete csv --all -n NAMESPACE +---- + +[NOTE] +==== +Replace NAMESPACE above, with the actual name of the namespace used in the namespace-scoped installation. +==== endif::[] \ No newline at end of file diff --git a/ejb-txn-remote-call/charts/eap-operator-group.yaml b/ejb-txn-remote-call/charts/eap-operator-group.yaml new file mode 100644 index 0000000000..6cd2f0e2aa --- /dev/null +++ b/ejb-txn-remote-call/charts/eap-operator-group.yaml @@ -0,0 +1,19 @@ +# OperatorGroup configuration for namespace-scoped EAP Operator installation +# +# This file configures the EAP Operator to watch only the current namespace +# instead of being installed globally across all namespaces. +# +# BEFORE APPLYING: Replace '' with your actual namespace name. +# You can get your current namespace with: oc project -q +# +# Example: +# If your namespace is 'my-project', change both occurrences of '' to 'my-project' + +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + name: eap-operator-group + namespace: +spec: + targetNamespaces: + - diff --git a/ejb-txn-remote-call/charts/eap-operator-sub.yaml b/ejb-txn-remote-call/charts/eap-operator-sub.yaml new file mode 100644 index 0000000000..a6a885396d --- /dev/null +++ b/ejb-txn-remote-call/charts/eap-operator-sub.yaml @@ -0,0 +1,20 @@ +# Subscription configuration for global EAP Operator installation +# +# This file subscribes to the EAP Operator from the Red Hat Operators catalog +# in the openshift-operators namespace, making it available globally across all namespaces. +# +# WARNING: This is for development/testing simplicity. In production environments, +# consider namespace-scoped installation by installing the Subscription in your +# specific project namespace along with an appropriate OperatorGroup. + +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: eap + namespace: openshift-operators +spec: + channel: stable + installPlanApproval: Automatic + name: eap + source: redhat-operators + sourceNamespace: openshift-marketplace