// Module included in the following assemblies:
//
// deploying/assembly_deploy-cluster-operator.adoc

[id='deploying-drain-cleaner-helm-chart-{context}']
= Deploying the Strimzi Drain Cleaner using Helm

[role="_abstract"]
link:https://helm.sh/[Helm] charts are used to package, configure, and deploy Kubernetes resources.
Strimzi provides a Helm chart to deploy the Strimzi Drain Cleaner.

The Drain Cleaner is deployed on the Kubernetes cluster with the default chart configuration, which assumes that `cert-manager` issues the TLS certificates required by the Drain Cleaner.

You can install the Drain Cleaner with `cert-manager` support or provide your own TLS certificates.

.Prerequisites

* You have xref:drain-cleaner-prereqs-str[downloaded the Strimzi Drain Cleaner deployment files].
* The Helm client must be installed on a local machine.
* Helm must be installed to the Kubernetes cluster.

.Default configuration values
Default configuration values are passed into the chart using parameters defined in a `values.yaml` file.  
If you don't want to use the default configuration, you can override the defaults when you install the chart using the `--set` argument.
You specify values in the format `--set key=value[,key=value]`.
The `values.yaml` file supplied with the Helm deployment files describes the available configuration parameters, including those shown in the following table. 

You can override the default image settings.
You can also set `secret.create` as `true` and add your own TLS certificates instead of using `cert-manager` to generate the certificates. 
For information on using OpenSSL to generate certificates, see xref:proc-drain-cleaner-certs-{context}[].

Any certificates you add must be renewed before they expire. 
You can use the configuration to control how certificates are watched for updates using environment variables.
For more information on how the environment variables work, see xref:proc-drain-cleaner-certs-renewing-{context}[].

.Chart configuration options
[cols="5m,4,2m",options="header"]
|===

| Parameter             
| Description                                                                               
| Default

| replicaCount
| Number of replicas of the Drain Cleaner webhook	
| 1
| image.registry	
| Drain Cleaner image registry	
| quay.io
| image.repository	
| Drain Cleaner image repository	
| strimzi
| image.name	
| Drain Cleaner image name	
| drain-cleaner
| image.tag	
| Drain Cleaner image tag	
| latest
| image.imagePullPolicy	
| Image pull policy for all pods deployed by the Drain Cleaner	
| nil
| secret.create
| Set to `true` and add certificates when not using `cert-manager` 
| false
| namespace.name
| Default namespace for the Drain Cleaner deployment.
| strimzi-drain-cleaner
| resources	
| Configures resources for the Drain Cleaner pod	
| []
| nodeSelector	
| Add a node selector to the Drain Cleaner pod	
| {} 
| tolerations	
| Add tolerations to the Drain Cleaner pod	
| []
| topologySpreadConstraints	
| Add topology spread constraints to the Drain Cleaner pod	
| {} 
| affinity	
| Add affinities to the Drain Cleaner pod	
| {}
 

|===

.Procedure

. Use the Helm command line tool to add the Strimzi Helm chart repository:
+
[source,shell,subs=attributes+]
----
helm repo add strimzi {ChartRepositoryUrl}
----

. Deploy the Drain Cleaner:
+
[source,shell]
----
helm install drain-cleaner strimzi/strimzi-drain-cleaner
----
+
Specify any changes to the default configuration as parameter values.
+
.Example configuration that changes the number of webhook replicas
[source,shell]
----
helm install drain-cleaner --set replicaCount=2 strimzi/strimzi-drain-cleaner
----

. Verify that the Cluster Operator has been deployed successfully:
+
[source,shell]
----
helm ls
----
