|
| 1 | +# StackRox Kubernetes Security Platform - Central Services Helm Chart |
| 2 | + |
| 3 | +This Helm chart allows you to deploy the central services of the StackRox |
| 4 | +Kubernetes Security Platform: StackRox Central and StackRox Scanner. |
| 5 | + |
| 6 | +If you want to install Red Hat Advanced Cluster Security, refer to |
| 7 | +[Installing quickly using Helm charts](https://docs.openshift.com/acs/installing/installing_helm/install-helm-quick.html) |
| 8 | +for up to date information. |
| 9 | + |
| 10 | +## Prerequisites |
| 11 | + |
| 12 | +To deploy the central services for the StackRox Kubernetes Security platform |
| 13 | +using Helm, you must: |
| 14 | +- Have at least version 3.1 of the Helm tool installed on your machine |
| 15 | + |
| 16 | +## Add the Canonical Chart Location as a Helm Repository |
| 17 | + |
| 18 | +The canonical repository for StackRox Helm charts is https://raw.githubusercontent.com/stackrox/helm-charts/main/opensource/. |
| 19 | +To use StackRox Helm charts on your machine, run |
| 20 | +```sh |
| 21 | +helm repo add stackrox https://raw.githubusercontent.com/stackrox/helm-charts/main/opensource/ |
| 22 | +``` |
| 23 | +This command only needs to be run once on your machine. Whenever you are deploying |
| 24 | +or upgrading a chart from a remote repository, it is advisable to run |
| 25 | +```sh |
| 26 | +helm repo update |
| 27 | +``` |
| 28 | +beforehand. |
| 29 | + |
| 30 | +## Deploy Central Services Using Helm |
| 31 | + |
| 32 | +The basic command for deploying the central services is |
| 33 | +```sh |
| 34 | +helm install -n stackrox --create-namespace \ |
| 35 | + --set central.persistence.none=true \ |
| 36 | + stackrox-central-services stackrox/stackrox-central-services |
| 37 | +``` |
| 38 | +If you have a copy of this chart on your machine, you can also reference the |
| 39 | +path to this copy instead of `stackrox/stackrox-central-services` above. |
| 40 | + |
| 41 | +In case you use image mirroring or otherwise access StackRox container images from non-standard location, |
| 42 | +you may also need to provide image pull credentials. |
| 43 | +There are several ways to inject the required credentials (if any) into the installation process: |
| 44 | + |
| 45 | +- **Explicitly specify username and password:** Use this if you are using a registry that supports username/password |
| 46 | + authentication. Pass the following arguments to the `helm install` command: |
| 47 | + ```sh |
| 48 | + --set imagePullSecrets.username=<registry username> --set imagePullSecrets.password=<registry password> |
| 49 | + ``` |
| 50 | +- **Use pre-existing image pull secrets:** If you already have one or several image pull secrets |
| 51 | + created in the namespace to which you are deploying, you can reference these in the following |
| 52 | + way (we assume that your secrets are called `pull-secret-1` and `pull-secret-2`): |
| 53 | + ```sh |
| 54 | + --set imagePullSecrets.useExisting="pull-secret-1;pull-secret-2" |
| 55 | + ``` |
| 56 | +- **Do not use image pull secrets:** If you are pulling your images from quay.io/stackrox-io or a registry in a private |
| 57 | + network that does not require authentication, or if the default service account in the namespace |
| 58 | + to which you are deploying is already configured with appropriate image pull secrets, you do |
| 59 | + not need to specify any additional image pull secrets. |
| 60 | + |
| 61 | +### Accessing the StackRox Portal After Deployment |
| 62 | + |
| 63 | +Once you have deployed the StackRox Kubernetes Security Platform Central Services via |
| 64 | +`helm install`, you will see an information text on the console that contains any things to |
| 65 | +note, or warnings encountered during the installation text. In particular, it instructs you |
| 66 | +how to connect to your Central deployment via port-forward (if you have not configured an |
| 67 | +exposure method, see below), and the administrator password to use for the initial login. |
| 68 | + |
| 69 | +### Applying Custom Configuration Options |
| 70 | + |
| 71 | +This Helm chart has many different configuration options. For simple use cases, these can be |
| 72 | +set directly on the `helm install` command line; however, we generally recommend that you |
| 73 | +store your configuration in a dedicated file. |
| 74 | + |
| 75 | +#### Using the `--set` family of command-line flags |
| 76 | + |
| 77 | +This approach is the quickest way to customize the deployment, but it does not work for |
| 78 | +more complex configuration settings. Via the `--set` and `--set-file` flags, which need to be |
| 79 | +appended to your `helm install` invocation, you can inject configuration values into the |
| 80 | +installation process. Here are some examples: |
| 81 | +- **Deploy StackRox in offline mode:** This configures StackRox in a way such that it will not |
| 82 | + reach out to any external endpoints. |
| 83 | + ```sh |
| 84 | + --set env.offlineMode=true |
| 85 | + ``` |
| 86 | +- **Configure a fixed administrator password:** This sets the password with which you log in to |
| 87 | + the StackRox portal as an administrator. If you do not configure a password yourself, one will |
| 88 | + be created for you and printed as part of the installation notes. |
| 89 | + ```sh |
| 90 | + --set central.adminPassword.value=mysupersecretpassword |
| 91 | + ``` |
| 92 | + |
| 93 | +#### Using configuration YAML files and the `-f` command-line flag |
| 94 | + |
| 95 | +To ensure the best possible upgrade experience, it is recommended that you store all custom |
| 96 | +configuration options in two files: `values-public.yaml` and `values-private.yaml`. The former |
| 97 | +contains all non-sensitive configuration options (such as whether to run in offline mode), and the |
| 98 | +latter contains all sensitive configuration options (such as the administrator password, or |
| 99 | +custom TLS certificates). The `values-public.yaml` file can be stored in, for example, your Git |
| 100 | +repository, while the `values-private.yaml` file should be stored in a secrets management |
| 101 | +system. |
| 102 | + |
| 103 | +There is a large number of configuration options that cannot all be discussed in minute detail |
| 104 | +in this README file. However, the Helm chart contains example configuration files |
| 105 | +`values-public.yaml.example` and `values-private.yaml.example`, that list all the available |
| 106 | +configuration options, along with documentation. The following is just a brief example of what |
| 107 | +can be configured via those files: |
| 108 | +- **`values-public.yaml`:** |
| 109 | + ```yaml |
| 110 | + env: |
| 111 | + offlineMode: true # run in offline mode |
| 112 | + |
| 113 | + central: |
| 114 | + # Use custom resource overrides for central |
| 115 | + resources: |
| 116 | + requests: |
| 117 | + cpu: 4 |
| 118 | + memory: "8Gi" |
| 119 | + limits: |
| 120 | + cpu: 8 |
| 121 | + memory: "16Gi" |
| 122 | + |
| 123 | + # Expose central via a LoadBalancer service |
| 124 | + exposure: |
| 125 | + loadBalancer: |
| 126 | + enabled: true |
| 127 | + |
| 128 | + scanner: |
| 129 | + # Run without StackRox Scanner (NOT RECOMMENDED) |
| 130 | + disable: true |
| 131 | + |
| 132 | + scannerV4: |
| 133 | + # Enable Scanner V4, which will become the default scanner for StackRox. |
| 134 | + # Note that enabling Scanner V4 while having the StackRox Scanner disabled (scanner.disable=true) |
| 135 | + # is not a supported configuration. |
| 136 | + disable: false |
| 137 | + |
| 138 | + customize: |
| 139 | + # Apply the important-service=true label for all objects managed by this chart. |
| 140 | + labels: |
| 141 | + important-service: true |
| 142 | + # Set the CLUSTER=important-cluster environment variable for all containers in the |
| 143 | + # central deployment: |
| 144 | + central: |
| 145 | + envVars: |
| 146 | + CLUSTER: important-cluster |
| 147 | + ``` |
| 148 | +- **`values-private.yaml`**: |
| 149 | + ```yaml |
| 150 | + central: |
| 151 | + # Configure a default TLS certificate (public cert + private key) for central |
| 152 | + defaultTLS: |
| 153 | + cert: | |
| 154 | + -----BEGIN CERTIFICATE----- |
| 155 | + MII... |
| 156 | + -----END CERTIFICATE----- |
| 157 | + key: | |
| 158 | + -----BEGIN EC PRIVATE KEY----- |
| 159 | + MHc... |
| 160 | + -----END EC PRIVATE KEY----- |
| 161 | + ``` |
| 162 | + |
| 163 | +After you have created these YAML files, you can inject the configuration options into the |
| 164 | +installation process via the `-f` flag, i.e., by appending the following options to the |
| 165 | +`helm install` invocation: |
| 166 | +```sh |
| 167 | +-f values-public.yaml -f values-private.yaml |
| 168 | +``` |
| 169 | + |
| 170 | +### Changing Configuration Options After Deployment |
| 171 | + |
| 172 | +If you wish to make any changes to the deployment, simply change the configuration options |
| 173 | +in your `values-public.yaml` and/or `values-private.yaml` file(s), and inject them into an |
| 174 | +`helm upgrade` invocation: |
| 175 | +```sh |
| 176 | +helm upgrade -n stackrox stackrox-central-services stackrox/stackrox-central-services \ |
| 177 | + -f values-public.yaml \ |
| 178 | + -f values-private.yaml |
| 179 | +``` |
| 180 | +Under most circumstances, you will not need to supply the `values-private.yaml` file, unless |
| 181 | +you want changes to sensitive configuration options to be applied. |
| 182 | + |
| 183 | +Alternatively, you can also use the `--reuse-values` for the `helm upgrade` command. This flag |
| 184 | +causes values which were previously passed via `--values / -f`, `--set` or `--set-file` to be |
| 185 | +automatically passed again to the Helm chart rendering. |
| 186 | + |
| 187 | +### Passing Generated Values |
| 188 | + |
| 189 | +The Helm chart can conveniently automatically generate certain sensitive data objects. This includes |
| 190 | +passwords, keys and certificates. If these data objects were generated during the installation |
| 191 | +of the Helm chart, a command is provided as part of the post-installation notes which can be used |
| 192 | +for retrieving them and storing them in a file `generated-values.yaml`. This file |
| 193 | +might contain a CA key. |
| 194 | + |
| 195 | +If, during an upgrade of the Helm release, the Helm chart needs to generate a new certificate for |
| 196 | +some component, it is required to pass in the existing CA, for example by adding |
| 197 | +`-f generated-values.yaml` to the arguments for `helm upgrade`. |
| 198 | + |
| 199 | +### Enabling Scanner V4 |
| 200 | + |
| 201 | +Beginning with StackRox 4.4, a new scanner component based on ClairCore named Scanner V4 is integrated. |
| 202 | +In a future version of StackRox, Scanner V4 will become the new default scanner and replace the existing |
| 203 | +scanner named StackRox Scanner. Currently, Scanner V4 is not installed by default, but it |
| 204 | +can be enabled alongside StackRox Scanner using the following Helm chart setting: |
| 205 | + |
| 206 | +``` |
| 207 | +scannerV4: |
| 208 | + disable: false |
| 209 | +``` |
| 210 | + |
| 211 | +To enable Scanner V4 for an existing installation of this chart, the CA certificate |
| 212 | +and its key must be provided to the `helm upgrade` command. |
| 213 | +For example, if the CA was generated ahead of time and injected into the `helm install` command, then |
| 214 | +the `--reuse-values` flag for `helm upgrade` can be used to provide the certificate and key. However, if the CA was |
| 215 | +generated by the Helm chart at installation time, you must retrieve the generated secret |
| 216 | +values from the cluster (see above) and provide those to the `helm upgrade` command. |
| 217 | + |
| 218 | +Note that because Scanner V4 currently runs simultaneously with StackRox Scanner, your |
| 219 | +cluster must have sufficient computing resources available to host both scanner components at the same time. |
| 220 | +The default resource configuration for Scanner V4 components can be found in the file |
| 221 | +internal/defaults.yaml. |
0 commit comments