|
| 1 | +// Module is included in the following assemblies: |
| 2 | +// |
| 3 | +// * installing-openshift-gitops |
| 4 | + |
| 5 | +:_content-type: PROCEDURE |
| 6 | +[id="installing-gitops-operator-using-cli_{context}"] |
| 7 | += Installing OpenShift GitOps Operator using CLI |
| 8 | + |
| 9 | +[role="_abstract"] |
| 10 | +You can install {gitops-title} Operator from the OperatorHub using the CLI. |
| 11 | + |
| 12 | +.Procedure |
| 13 | + |
| 14 | +. Create a Subscription object YAML file to subscribe a namespace to the {gitops-title}, for example, `sub.yaml`: |
| 15 | ++ |
| 16 | +.Example Subscription |
| 17 | +[source,yaml] |
| 18 | +---- |
| 19 | +apiVersion: operators.coreos.com/v1alpha1 |
| 20 | +kind: Subscription |
| 21 | +metadata: |
| 22 | + name: openshift-gitops-operator |
| 23 | + namespace: openshift-operators |
| 24 | +spec: |
| 25 | + channel: stable <1> |
| 26 | + installPlanApproval: Automatic |
| 27 | + name: openshift-gitops-operator <2> |
| 28 | + source: redhat-operators <3> |
| 29 | + sourceNamespace: openshift-marketplace <4> |
| 30 | +---- |
| 31 | +<1> Specify the channel name from where you want to subscribe the Operator. |
| 32 | +<2> Specify the name of the Operator to subscribe to. |
| 33 | +<3> Specify the name of the CatalogSource that provides the Operator. |
| 34 | +<4> The namespace of the CatalogSource. Use `openshift-marketplace` for the default OperatorHub CatalogSources. |
| 35 | ++ |
| 36 | +. Apply the `Subscription` to the cluster: |
| 37 | ++ |
| 38 | +[source,terminal] |
| 39 | +---- |
| 40 | +$ oc apply -f openshift-gitops-sub.yaml |
| 41 | +---- |
| 42 | +. After the installation is complete, ensure that all the pods in the `openshift-gitops` namespace are running: |
| 43 | ++ |
| 44 | +[source,terminal] |
| 45 | +---- |
| 46 | +$ oc get pods -n openshift-gitops |
| 47 | +---- |
| 48 | +.Example output |
| 49 | ++ |
| 50 | +[source,terminal] |
| 51 | +---- |
| 52 | +NAME READY STATUS RESTARTS AGE |
| 53 | +cluster-b5798d6f9-zr576 1/1 Running 0 65m |
| 54 | +kam-69866d7c48-8nsjv 1/1 Running 0 65m |
| 55 | +openshift-gitops-application-controller-0 1/1 Running 0 53m |
| 56 | +openshift-gitops-applicationset-controller-6447b8dfdd-5ckgh 1/1 Running 0 65m |
| 57 | +openshift-gitops-redis-74bd8d7d96-49bjf 1/1 Running 0 65m |
| 58 | +openshift-gitops-repo-server-c999f75d5-l4rsg 1/1 Running 0 65m |
| 59 | +openshift-gitops-server-5785f7668b-wj57t 1/1 Running 0 53m |
| 60 | +---- |
0 commit comments