# Installation

There are two ways to run the Stackable Secret Operator:

1.  Helm managed Docker container deployment on Kubernetes

2.  Build from source


## Prerequisites

You will need:

-   a Kubernetes cluster

-   kubectl

-   Helm


Resource sizing depends on cluster type(s), usage and scope, but as a starting point a minimum of the following resources is recommended for this operator:

-   0.2 cores (e.g. i5 or similar)

-   256MB RAM


## Helm

Helm allows you to download and deploy Stackable operators on Kubernetes and is by far the easiest installation method.

> **Note:** `helm repo` subcommands are not supported for OCI registries. The operators are installed directly, without adding the Helm Chart repository first.

Install the Stackable Secret Operator

```console
$ helm install secret-operator oci://oci.stackable.tech/sdp-charts/secret-operator
```

Helm will deploy the operator in Kubernetes containers. The operator installs and maintains its own CRDs at startup (see [CustomResourceDefinition (CRD) maintenance](https://docs.stackable.tech/home/stable/concepts/maintenance/crds/index.md)). You’re now ready to deploy secrets!

### Microk8s

Microk8s uses a non-standard Kubelet state directory. Installing secret-operator on Microk8s requires the argument `--set csiNodeDriver.kubeletDir=/var/snap/microk8s/common/var/lib/kubelet` to be added to the `helm install` command.

### k0s

k0s uses a non-standard Kubelet state directory. Installing secret-operator on k0s requires the argument `--set csiNodeDriver.kubeletDir=/var/lib/k0s/kubelet` to be added to the `helm install` command.

### HUAWEI cloud

In some cases HUAWEI cloud has the kubelet directory located at `/mnt/paas/kubernetes/kubelet`, resulting in the following error:

`failed to publish volume error=status: Unavailable, message: "failed to create secret parent dir /mnt/paas/kubernetes/kubelet/pods/<POD_ID>/volumes/kubernetes.io~csi/pvc-<PVC_ID>/mount: No such file or directory (os error 2)"`

In case you are encountering the mentioned error (or secret-operator does not work on your HUAWEI cloud at all), you need to add the argument `--set csiNodeDriver.kubeletDir=/mnt/paas/kubernetes/kubelet` to the `helm install` command.

### IBM cloud

In some cases IBM cloud has the kubelet directory located at `/var/data/kubelet/`, resulting in the following error:

`failed to publish volume error=status: Unavailable, message: "failed to create secret parent dir /var/data/kubelet/pods/<POD_ID>/volumes/kubernetes.io~csi/pvc-<PVC_ID>/mount: No such file or directory (os error 2)"`

In case you are encountering the mentioned error (or secret-operator does not work on your IBM cloud at all), you need to add the argument `--set csiNodeDriver.kubeletDir=/var/data/kubelet` to the `helm install` command.

### VMware Tanzu

Whether Tanzu uses a non-standard Kubelet state directory depends on the variant. BOSH-deployed clusters (Tanzu Kubernetes Grid Integrated Edition, formerly PKS) place it under `/var/vcap`, so installing secret-operator there requires the argument `--set csiNodeDriver.kubeletDir=/var/vcap/data/kubelet` to be added to the `helm install` command. Standard clusters (Tanzu Kubernetes Grid and vSphere with Tanzu) use the default `/var/lib/kubelet` and need no override. If unsure, check the actual directory on a node before overriding.
