# Prepare Kubernetes Cluster

[Prepare Kubernetes Cluster by AppsCode](https://github.com/kmodules/installer) - Update Linux Kernel configuration of a Kubernetes Cluster nodes

## TL;DR;

```bash
$ helm repo add appscode https://charts.appscode.com/stable/
$ helm repo update
$ helm search repo appscode/prepare-cluster --version=v2026.7.10
$ helm upgrade -i prepare-cluster appscode/prepare-cluster -n kube-system --create-namespace --version=v2026.7.10
```

## Introduction

This chart deploys a Kubernetes Job on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.

## Prerequisites

- Kubernetes 1.12+

## Installing the Chart

To install/upgrade the chart with the release name `prepare-cluster`:

```bash
$ helm upgrade -i prepare-cluster appscode/prepare-cluster -n kube-system --create-namespace --version=v2026.7.10
```

The command deploys a Kubernetes Job on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.

> **Tip**: List all releases using `helm list`

## Uninstalling the Chart

To uninstall the `prepare-cluster`:

```bash
$ helm uninstall prepare-cluster -n kube-system
```

The command removes all the Kubernetes components associated with the chart and deletes the release.

## Configuration

The following table lists the configurable parameters of the `prepare-cluster` chart and their default values.

|         Parameter          |                                                                                                                                                                                     Description                                                                                                                                                                                     |                                                                                                                Default                                                                                                                 |
|----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| nameOverride               | Overrides name template                                                                                                                                                                                                                                                                                                                                                             | <code>""</code>                                                                                                                                                                                                                        |
| fullnameOverride           | Overrides fullname template                                                                                                                                                                                                                                                                                                                                                         | <code>""</code>                                                                                                                                                                                                                        |
| preparer.repository        | Docker image used to run kernel configuration commands                                                                                                                                                                                                                                                                                                                              | <code>docker.io/tianon/toybox</code>                                                                                                                                                                                                   |
| preparer.pullPolicy        | Image pull policy of Docker image used for node preparation                                                                                                                                                                                                                                                                                                                         | <code>IfNotPresent</code>                                                                                                                                                                                                              |
| preparer.tag               | Image tag of Docker image used for node preparation                                                                                                                                                                                                                                                                                                                                 | <code>0.8.11</code>                                                                                                                                                                                                                    |
| preparer.securityContext   | Security options the node preparer container should run with                                                                                                                                                                                                                                                                                                                        | <code>{"privileged":true}</code>                                                                                                                                                                                                       |
| cleaner.repository         | Docker image used to uninstall this helm release                                                                                                                                                                                                                                                                                                                                    | <code>ghcr.io/appscode/helm</code>                                                                                                                                                                                                     |
| cleaner.pullPolicy         | Image pull policy of Docker image used for helm command                                                                                                                                                                                                                                                                                                                             | <code>IfNotPresent</code>                                                                                                                                                                                                              |
| cleaner.tag                | Image tag of Docker image used for helm command                                                                                                                                                                                                                                                                                                                                     | <code>3.11.3</code>                                                                                                                                                                                                                    |
| cleaner.skip               | Skip generating cleaner YAML                                                                                                                                                                                                                                                                                                                                                        | <code>true</code>                                                                                                                                                                                                                      |
| cleaner.securityContext    | Security options the helm cleaner container should run with                                                                                                                                                                                                                                                                                                                         | <code>{}</code>                                                                                                                                                                                                                        |
| imagePullSecrets           | Specify an array of imagePullSecrets. Secrets must be manually created in the namespace. <br> Example: <br> `helm template charts/prepare-cluster \` <br> `--set imagePullSecrets[0].name=sec0 \` <br> `--set imagePullSecrets[1].name=sec1`                                                                                                                                        | <code>[]</code>                                                                                                                                                                                                                        |
| serviceAccount.create      | Specifies whether a service account should be created                                                                                                                                                                                                                                                                                                                               | <code>true</code>                                                                                                                                                                                                                      |
| serviceAccount.annotations | Annotations to add to the service account                                                                                                                                                                                                                                                                                                                                           | <code>{}</code>                                                                                                                                                                                                                        |
| serviceAccount.name        | The name of the service account to use. If not set and create is true, a name is generated using the fullname template                                                                                                                                                                                                                                                              | <code>""</code>                                                                                                                                                                                                                        |
| podAnnotations             | Annotations passed to operator pod(s).                                                                                                                                                                                                                                                                                                                                              | <code>{}</code>                                                                                                                                                                                                                        |
| podSecurityContext         | Security options the operator pod should run with.                                                                                                                                                                                                                                                                                                                                  | <code>{}</code>                                                                                                                                                                                                                        |
| resources                  | Compute Resources required by the node preparer and helm cleaner container                                                                                                                                                                                                                                                                                                          | <code>{}</code>                                                                                                                                                                                                                        |
| nodeSelector               | Node labels for pod assignment                                                                                                                                                                                                                                                                                                                                                      | <code>{"kubernetes.io/os":"linux"}</code>                                                                                                                                                                                              |
| tolerations                | Tolerations for pod assignment                                                                                                                                                                                                                                                                                                                                                      | <code>[]</code>                                                                                                                                                                                                                        |
| affinity                   | Affinity rules for pod assignment                                                                                                                                                                                                                                                                                                                                                   | <code>{}</code>                                                                                                                                                                                                                        |
| node.sysctls               | Specify an array of sysctl parameters. <br> Example: <br> `helm template charts/prepare-cluster \` <br> `--set node.sysctls[0].name=vm.max_map_count \` <br> `--set node.sysctls[0].value=300000`                                                                                                                                                                                   | <code>[{"name":"fs.file-max","value":"98000"},{"name":"kernel.pid_max","value":"64000"},{"name":"kernel.threads-max","value":"64000"},{"name":"vm.max_map_count","value":"128000"},{"name":"vm.zone_reclaim_mode","value":"0"}]</code> |
| copyStorageClasses         | Copy existing StorageClass into a new one with additional configuration <br> Example: <br> `helm install prepare-cluster charts/prepare-cluster --dry-run=server \` <br> `--set copyStorageClasses.standard.name=optimized \` <br> `--set copyStorageClasses.standard.mountOptions[0]=noatime \` <br> `--set copyStorageClasses.standard.params."csi\.storage\.k8s\.io/fstype=xfs"` | <code>{}</code>                                                                                                                                                                                                                        |


Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example:

```bash
$ helm upgrade -i prepare-cluster appscode/prepare-cluster -n kube-system --create-namespace --version=v2026.7.10 --set preparer.repository=docker.io/tianon/toybox
```

Alternatively, a YAML file that specifies the values for the parameters can be provided while
installing the chart. For example:

```bash
$ helm upgrade -i prepare-cluster appscode/prepare-cluster -n kube-system --create-namespace --version=v2026.7.10 --values values.yaml
```
