github.com/argoproj-labs/argocd-operator@v0.10.0/docs/install/olm.md (about) 1 # OLM Install 2 3 The following steps can be used to install the operator using the [Operator Lifecycle Manager][olm_home] on any Kubernetes 4 environment with minimal overhead. 5 6 ## Cluster Setup 7 8 This guide uses [minikube](https://minikube.sigs.k8s.io/) to deploy a Kubernetes cluster locally, follow the 9 instructions for your platform to install. If you already have a Kubernetes cluster ready to go, skip to 10 the [OLM](#operator-lifecycle-manager) section. 11 12 Run minikube with a dedicated profile. Adjust the system resources as needed for your platform. 13 14 ```bash 15 minikube start -p argocd --cpus=4 --disk-size=40gb --memory=8gb 16 ``` 17 18 ## Operator Lifecycle Manager 19 20 Install the OLM components manually. If you already have OLM installed, skip to the [Operator](#operator-install) section. 21 22 Either 23 24 - install OLM from here: https://github.com/operator-framework/operator-lifecycle-manager/releases 25 26 or 27 28 - install using the `operator-sdk` command 29 ```bash 30 operator-sdk olm install 31 ``` 32 33 Verify that OLM is installed. There should be two new namespaces, `olm` and `operators` created as a result. 34 35 ```bash 36 kubectl get ns 37 ``` 38 39 ``` 40 NAME STATUS AGE 41 kube-system Active 7d1h 42 default Active 7d1h 43 kube-public Active 7d1h 44 kube-node-lease Active 7d1h 45 operators Active 94s 46 olm Active 94s 47 ``` 48 49 Verify that the OLM Pods are running in the `olm` namespace. 50 51 ```bash 52 kubectl get pods -n olm 53 ``` 54 55 ``` 56 NAME READY STATUS RESTARTS AGE 57 olm-operator-5b58594fc8-bzpq2 1/1 Running 0 2m10s 58 catalog-operator-6d578c5764-l5f5t 1/1 Running 0 2m10s 59 packageserver-7495fbf449-w4w6h 1/1 Running 0 80s 60 packageserver-7495fbf449-9jmpj 1/1 Running 0 80s 61 operatorhubio-catalog-pnsc7 1/1 Running 0 81s 62 ``` 63 64 That's it, OLM should be installed and availble to manage the Argo CD Operator. 65 66 ## Operator Install 67 68 Use the following steps to install the operator using an OLM Catalog. 69 70 ### Namespace 71 72 Create a new namespace for the operator. 73 74 ```bash 75 kubectl create namespace argocd 76 ``` 77 78 ### Operator Catalog 79 80 Create a `CatalogSource` in the `olm` namespace. This manifest references a container image that has the Argo CD 81 Operator packaged for use in OLM. For more information on packaging the operator, see the [development][docs_dev] documentation. 82 83 ```bash 84 kubectl create -n olm -f deploy/catalog_source.yaml 85 ``` 86 87 The `catalog_source.yaml` file can be found [in the `deploy` folder in the 88 repository](https://github.com/argoproj-labs/argocd-operator/tree/master/deploy). 89 It should look like this: 90 91 ```yaml 92 apiVersion: operators.coreos.com/v1alpha1 93 kind: CatalogSource 94 metadata: 95 name: argocd-catalog 96 spec: 97 sourceType: grpc 98 image: quay.io/argoprojlabs/argocd-operator-registry@sha256:dcf6d07ed5c8b840fb4a6e9019eacd88cd0913bc3c8caa104d3414a2e9972002 # replace with your index image 99 displayName: Argo CD Operators 100 publisher: Argo CD Community 101 ``` 102 103 Verify that the Argo CD operator catalog has been created. 104 105 ```bash 106 kubectl get catalogsources -n olm 107 ``` 108 109 ``` 110 NAME DISPLAY TYPE PUBLISHER AGE 111 argocd-catalog Argo CD Operators grpc Argo CD 6s 112 operatorhubio-catalog Community Operators grpc OperatorHub.io 25m 113 ``` 114 115 Verify that the registry Pod that serves the catalog is running. 116 117 ```bash 118 kubectl get pods -n olm -l olm.catalogSource=argocd-catalog 119 ``` 120 121 ``` 122 NAME READY STATUS RESTARTS AGE 123 argocd-catalog-nxn79 1/1 Running 0 55s 124 ``` 125 126 ### Operator Group 127 128 Create an `OperatorGroup` in the `argocd` namespace that defines the namespaces that the Argo CD Operator will watch for 129 new resources. 130 131 Please find the file `operator_group.yaml` in the [git 132 repository](https://github.com/argoproj-labs/argocd-operator/blob/master/deploy/operator_group.yaml). 133 134 It's content looks like this: 135 136 ```yaml 137 apiVersion: operators.coreos.com/v1 138 kind: OperatorGroup 139 metadata: 140 name: argocd-operator 141 ``` 142 143 ```bash 144 kubectl create -n argocd -f deploy/operator_group.yaml 145 ``` 146 147 Verify that the new OperatorGroup was created in the `argocd` namespace. 148 149 ```bash 150 kubectl get operatorgroups -n argocd 151 ``` 152 153 ``` 154 NAME AGE 155 argocd-operator 10s 156 ``` 157 158 ### Subscription 159 160 Once the OperatorGroup is present, create a new `Subscription` for the Argo CD Operator in the new `argocd` namespace. 161 162 You can use the file [from the git 163 repository](https://github.com/argoproj-labs/argocd-operator/blob/master/deploy/subscription.yaml), it looks like this: 164 165 ```yaml 166 apiVersion: operators.coreos.com/v1alpha1 167 kind: Subscription 168 metadata: 169 name: argocd-operator 170 spec: 171 channel: alpha 172 name: argocd-operator 173 source: argocd-catalog 174 sourceNamespace: olm 175 ``` 176 177 ```bash 178 kubectl create -n argocd -f deploy/subscription.yaml 179 ``` 180 181 Verify that the Subscription was created in the `argocd` namespace. 182 ```bash 183 kubectl get subscriptions -n argocd 184 ``` 185 186 ```bash 187 NAME PACKAGE SOURCE CHANNEL 188 argocd-operator argocd-operator argocd-catalog alpha 189 ``` 190 191 The Subscription should result in an `InstallPlan` being created in the `argocd` namespace. 192 193 ```bash 194 kubectl get installplans -n argocd 195 ``` 196 197 ``` 198 NAME CSV APPROVAL APPROVED 199 install-62hsr argocd-operator.v0.1.0 Automatic true 200 ``` 201 202 Finally, verify that the Argo CD Operator Pod is running in the `argocd` namespace. 203 204 ```bash 205 kubectl get pods -n argocd 206 ``` 207 208 ``` 209 NAME READY STATUS RESTARTS AGE 210 argocd-operator-controller-manager-74b9ddb78c-lxzq2 2/2 Running 0 2m27s 211 ``` 212 213 ## Usage 214 215 Once the operator is installed and running, new ArgoCD resources can be created. See the [usage][docs_usage] 216 documentation to learn how to create new `ArgoCD` resources. 217 218 ## Cleanup 219 220 You can clean up the operator resources by running the following commands. 221 222 ```bash 223 kubectl delete -n argocd -f deploy/subscription.yaml 224 kubectl delete -n argocd -f deploy/operator_group.yaml 225 kubectl delete -n olm -f deploy/catalog_source.yaml 226 kubectl delete namespace argocd 227 ``` 228 229 [docs_dev]:../developer-guide/development.md 230 [docs_usage]:../usage/basics.md 231 [olm_home]:https://github.com/operator-framework/operator-lifecycle-manager