|
| 1 | +--- |
| 2 | +title: Installation |
| 3 | +order: 2 |
| 4 | +--- |
| 5 | + |
| 6 | +This section covers the various aspects of installing the Operator. |
| 7 | + |
| 8 | +The Operator supports installation [via Helm](#install-using-helm) and |
| 9 | +[via the Operator Lifecycle Manager (OLM)](#install-using-olm). OLM is the recommended way to |
| 10 | +install on Red Hat OpenShift clusters, where OLM is installed by default. |
| 11 | + |
| 12 | +::: important |
| 13 | +The Operator is an Enterprise-only feature, please [contact us](https://www.kurrent.io/contact) for more information. |
| 14 | +::: |
| 15 | + |
| 16 | +## Install Using Helm |
| 17 | + |
| 18 | +### Prerequisites |
| 19 | + |
| 20 | +* A Kubernetes cluster running any [non-EOL version of Kubernetes](https://kubernetes.io/releases/). |
| 21 | +* Permission to create resources, deploy the Operator and install CRDs in the target cluster. |
| 22 | +* The following CLI tools installed, on your shell’s `$PATH`, with `$KUBECONFIG` pointing to your |
| 23 | + cluster: |
| 24 | + * [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl) |
| 25 | + * [Helm 3 CLI](https://helm.sh/docs/intro/install/) |
| 26 | +* A valid Operator license. Please [contact us](https://www.kurrent.io/contact) for more information. |
| 27 | + |
| 28 | +### Configure Helm Repository |
| 29 | + |
| 30 | +Add the Kurrent Helm repository to your local environment: |
| 31 | + |
| 32 | +```bash |
| 33 | +helm repo add kurrent-latest \ |
| 34 | + 'https://packages.kurrent.io/basic/kurrent-latest/helm/charts/' |
| 35 | +``` |
| 36 | + |
| 37 | +### Basic Installation |
| 38 | + |
| 39 | +The most basic installation will: |
| 40 | + |
| 41 | +- install necessary CRDs |
| 42 | +- run the Operator with a `ClusterRole` |
| 43 | +- configure the Operator to watch all namespaces |
| 44 | + |
| 45 | +To install in this way, run: |
| 46 | + |
| 47 | +```bash |
| 48 | +helm install kurrentdb-operator kurrent-latest/kurrentdb-operator \ |
| 49 | + --version 1.5.0 \ |
| 50 | + --create-namespace \ |
| 51 | + --namespace kurrent-system \ |
| 52 | + --set-file operator.license.key=/path/to/license.key \ |
| 53 | + --set-file operator.license.file=/path/to/license.lic |
| 54 | +``` |
| 55 | + |
| 56 | +This command: |
| 57 | + |
| 58 | +- Creates `kurrent-system` and deploys the Operator into it. |
| 59 | +- Deploys CRDs. |
| 60 | +- Applies the Operator license. |
| 61 | +- Populates a new Helm release called `kurrentdb-operator` in the `kurrent` namespace. |
| 62 | + |
| 63 | +*Expected Output*: |
| 64 | + |
| 65 | +``` |
| 66 | +NAME: kurrentdb-operator |
| 67 | +LAST DEPLOYED: Thu Mar 20 14:51:42 2025 |
| 68 | +NAMESPACE: kurrent-system |
| 69 | +STATUS: deployed |
| 70 | +REVISION: 1 |
| 71 | +TEST SUITE: None |
| 72 | +``` |
| 73 | + |
| 74 | +Additional customizations are described in the following sections. |
| 75 | + |
| 76 | +### Option: Targeting Specific Namespaces |
| 77 | + |
| 78 | +The Operator may be installed to only control resources in specific namespaces. When installed in |
| 79 | +this way, it uses a `Role` in each target namespace rather than a `ClusterRole`. |
| 80 | + |
| 81 | +For example, to configure the Operator to control resources in namespaces `foo` and `bar`, add a |
| 82 | +flag like `--set operator.namespaces='{foo,bar}'` to the installation steps described in [Basic |
| 83 | +Installation](#basic-installation). |
| 84 | + |
| 85 | +::: important |
| 86 | +Make sure the namespaces listed as part of the `operator.namespaces` parameter already exist before |
| 87 | +running the Helm installation. |
| 88 | +::: |
| 89 | + |
| 90 | +Note that there is no requirement that namespace used for the Helm installation overlap with the |
| 91 | +namespaces controlled by the Operator. |
| 92 | + |
| 93 | +### Option: Manual CRD Installation |
| 94 | + |
| 95 | +Some prefer to deploy CRDs manually, rather than through Helm. In this case, you must manually |
| 96 | +install the CRDs before the Helm installation (and again with each upgrade): |
| 97 | + |
| 98 | +```bash |
| 99 | +# Download the kurrentdb-operator Helm chart |
| 100 | +helm pull kurrent-latest/kurrentdb-operator --version 1.5.0 --untar |
| 101 | + |
| 102 | +# Install the CRDs |
| 103 | +kubectl apply -f kurrentdb-operator/templates/crds |
| 104 | +``` |
| 105 | + |
| 106 | +*Expected Output*: |
| 107 | +``` |
| 108 | +customresourcedefinition.apiextensions.k8s.io/kurrentdbs.kubernetes.kurrent.io created |
| 109 | +customresourcedefinition.apiextensions.k8s.io/kurrentdbbackups.kubernetes.kurrent.io created |
| 110 | +customresourcedefinition.apiextensions.k8s.io/kurrentdbbackupschedules.kubernetes.kurrent.io created |
| 111 | +``` |
| 112 | + |
| 113 | +Then, follow the installation steps described in [Basic Installation](#basic-installation) with the |
| 114 | +additional flag `--set crds.enabled=false`. |
| 115 | + |
| 116 | +Due to the extra steps at both installation and upgrade, we recommend letting the Helm chart |
| 117 | +automatically manage your CRDs. |
| 118 | + |
| 119 | +::: caution |
| 120 | +If you set the value of `crds.keep` to `false` (the default is `true`), helm upgrades and rollbacks |
| 121 | +can result in data loss. If `crds.keep` is `false` and `crds.enabled` transitions from `true` to |
| 122 | +`false` during an upgrade or rollback, the CRDs will be removed from the cluster, deleting all |
| 123 | +`KurrentDBs` and `KurrentDBBackups` and their associated child resources, including the PVCs and |
| 124 | +VolumeSnapshots containing your data! |
| 125 | +::: |
| 126 | + |
| 127 | +### Upgrading A Helm Installation |
| 128 | + |
| 129 | +The Operator can be upgraded using the following `helm` commands: |
| 130 | + |
| 131 | +```bash |
| 132 | +helm repo update kurrent-latest |
| 133 | +helm upgrade kurrentdb-operator kurrent-latest/kurrentdb-operator \ |
| 134 | + --namespace kurrent \ |
| 135 | + --version {version} \ |
| 136 | + --reset-then-reuse-values |
| 137 | +``` |
| 138 | + |
| 139 | +Here's what these commands do: |
| 140 | +- Refresh the local Helm repository index |
| 141 | +- Locate an existing operator installation in namespace `kurrent` |
| 142 | +- Select the target upgrade version `{version}` e.g. `1.5.0` |
| 143 | +- Perform the upgrade, preserving values that were set during installation |
| 144 | + |
| 145 | +## Install Using OLM |
| 146 | + |
| 147 | +### Prerequisites |
| 148 | + |
| 149 | +* An OpenShift cluster (version 4.17 or newer), or Kubernetes with OLM installed. |
| 150 | +* Permission to create resources, deploy the Operator and install CRDs in the target cluster. |
| 151 | +* `oc` (or `kubectl`) installed, on installed, on your shell’s `$PATH`, with `$KUBECONFIG` pointing |
| 152 | + to your cluster |
| 153 | +* A valid Operator license. Please [contact us](https://www.kurrent.io/contact) for more information. |
| 154 | + |
| 155 | +### Configure Namespaces |
| 156 | + |
| 157 | +Choose the namespace into which you will install your operator, and also the namespaces you want |
| 158 | +your operator to control. Create the namespaces now: |
| 159 | + |
| 160 | +```bash |
| 161 | +# a namespace into which we will install the operator |
| 162 | +oc create namespace kurrent-system |
| 163 | + |
| 164 | +# namespaces we want the operator to control |
| 165 | +oc create namespace foo bar |
| 166 | +``` |
| 167 | + |
| 168 | +### Create A `Secret` |
| 169 | + |
| 170 | +The Operator requires a `Secret` in its namespace containing a valid license. For OLM |
| 171 | +installations, the name of the secret must be `kurrentdb-operator`. |
| 172 | + |
| 173 | +```bash |
| 174 | +oc create secret generic -n kurrent-system kurrentdb-operator \ |
| 175 | + --from-file=licenseKey=/path/to/license.key \ |
| 176 | + --from-file=licenseFile=/path/to/license.lic |
| 177 | +``` |
| 178 | + |
| 179 | +### Create A `CatalogSource` |
| 180 | + |
| 181 | +A `CatalogSource` is the resource that tells OLM where to look for available operator versions. |
| 182 | + |
| 183 | +```bash |
| 184 | +oc apply -f - << EOF |
| 185 | +apiVersion: operators.coreos.com/v1alpha1 |
| 186 | +kind: CatalogSource |
| 187 | +metadata: |
| 188 | + name: kurrentdb-operator |
| 189 | + namespace: olm |
| 190 | +spec: |
| 191 | + sourceType: grpc |
| 192 | + image: docker.kurrent.io/kurrent-latest/kurrentdb-operator-catalog:latest |
| 193 | + displayName: KurrentDB Operator |
| 194 | + publisher: "Kurrent, Inc" |
| 195 | + grpcPodConfig: |
| 196 | + securityContextConfig: restricted |
| 197 | +EOF |
| 198 | +``` |
| 199 | + |
| 200 | +### Create An `OperatorGroup` |
| 201 | + |
| 202 | +An `OperatorGroup` is the resource that tells OLM which namespaces an operator should target. |
| 203 | + |
| 204 | +```bash |
| 205 | +oc apply -f - <<EOF |
| 206 | +apiVersion: operators.coreos.com/v1 |
| 207 | +kind: OperatorGroup |
| 208 | +metadata: |
| 209 | + name: kurrentdb-operator |
| 210 | + namespace: kurrent-system |
| 211 | +spec: |
| 212 | + upgradeStrategy: Default |
| 213 | + targetNamespaces: |
| 214 | + - foo |
| 215 | + - bar |
| 216 | +EOF |
| 217 | +``` |
| 218 | + |
| 219 | +If you wish for the Operator to target all namespaces, omit the `targetNamespaces` field entirely. |
| 220 | + |
| 221 | +### Create A `Subscription` |
| 222 | + |
| 223 | +A `Subscription` is the resource that asks OLM to install a particular operator into a namespace. |
| 224 | +Operators installed by the `Subscription` will target namespaces described by the `OperatorGroup` |
| 225 | +in that namespace. |
| 226 | + |
| 227 | +```bash |
| 228 | +oc apply -f - <<EOF |
| 229 | +apiVersion: operators.coreos.com/v1alpha1 |
| 230 | +kind: Subscription |
| 231 | +metadata: |
| 232 | + name: kurrentdb-operator |
| 233 | + namespace: kurrent-system |
| 234 | +spec: |
| 235 | + channel: fast-v1 |
| 236 | + installPlanApproval: Automatic |
| 237 | + name: kurrentdb-operator |
| 238 | + source: kurrentdb-operator |
| 239 | + sourceNamespace: default |
| 240 | + startingCSV: kurrentdb-operator.v1.5.0 |
| 241 | +EOF |
| 242 | +``` |
| 243 | + |
| 244 | +Now with the `CatalogSource`, `OperatorGroup`, and `Subscription` created, the Operator will be |
| 245 | +installed automatically by OLM, though it may take a couple minutes for the whole process to |
| 246 | +complete. |
| 247 | + |
| 248 | +## Deployment Validation |
| 249 | + |
| 250 | +Whether you installed using Helm or OLM, you can validate that the installation is working with |
| 251 | +`kubectl` (or using `oc` on an OpenShift cluster). |
| 252 | + |
| 253 | +Check that the `Deployment` running the operator looks healthy: |
| 254 | + |
| 255 | +```bash |
| 256 | +kubectl get -n kurrent-system deployments |
| 257 | +``` |
| 258 | + |
| 259 | +You should see `1/1` pods ready in the `kurrentdb-operator` Deployment: |
| 260 | + |
| 261 | +``` |
| 262 | +NAME READY UP-TO-DATE AVAILABLE AGE |
| 263 | +kurrentdb-operator 1/1 1 1 10m |
| 264 | +``` |
| 265 | + |
| 266 | +If not, check for error events in the Operator namespace for errors like image pull failures, |
| 267 | +scheduling problems, or operator crashes: |
| 268 | + |
| 269 | +```bash |
| 270 | +kubectl events -n kurrent-system |
| 271 | +``` |
| 272 | + |
| 273 | +If the Operator is starting successfully but then crashing, check the logs for issues like license |
| 274 | +key or file issues: |
| 275 | + |
| 276 | +```bash |
| 277 | +kubectl logs -n kurrent-system deployments/kurrentdb-operator |
| 278 | +``` |
| 279 | + |
| 280 | +If you are stuck, don't hesitate to reach out to support. |
0 commit comments