# Kubernetes with Helm

The presented example uses Helm charts, if you haven’t used the tool before, we highly recommend getting familiar with the [Helm quick-start docs](https://helm.sh/docs/intro/quickstart/).

The Helm chart setups the basic scenario of the CKEditor Collaboration Server On-Premises in Kubernetes with MySQL database and Redis cluster in two instances without the CKEditor Collaboration Worker.

<a id="prerequisites">

## Prerequisites

Helm v3 and Kubernetes 1.19+ are required to run examples from the section.

To fetch a Git repository with a pre-configured Helm chart, `git` needs to be installed.

To fetch required docker images you will need to authorize to the CKEditor Collaboration Server On-Premises Docker Registry.\
Please prepare the token from the [Customer Portal](https://portal.ckeditor.com/).

> **Warning**
>
> The presented example is not meant for production purposes! This configuration is insecure, not persistent and its purpose is testing only.
>
> For production usage, please check the [production deployment article](../production-deployment.md)

> **Note**
>
> A valid license key is needed in order to install Collaboration Server On-Premises.\
> [Contact us](https://ckeditor.com/contact/) for a trial license key.

<a id="preparing-development-environment">

## Preparing development environment

1. Clone the `cksource/ckeditor-cs-on-premises-infrastructure` Git repository.

```sh
git clone git@github.com:cksource/ckeditor-cs-on-premises-infrastructure.git
```

2. Go to the `ckeditor-cs-development-stack` directory.

```sh
cd ckeditor-cs-on-premises-infrastructure/kubernetes/helm/ckeditor-cs-development-stack
```

3. Create `imagePullSecret` for pulling images from the CKEditor container registry, replace the `xxx` with the authentication token.

```sh
kubectl create secret docker-registry docker-cke-cs-com \
	--docker-username "cs" \
	--docker-server "https://docker.cke-cs.com" \
	--docker-password="xxx"
```

4. Install all necessary dependencies. It will download all images needed in further tutorials.

```sh
helm repo add bitnami https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami &&
helm repo update &&
helm dependency update
```

<a id="running-the-default-scenario">

## Running the default scenario

The base scenario runs the application with a MySQL and single instance of Redis.

You will need to replace the `xxx` with your CKEditor Collaboration Server On-premises license key, which can be found in [the Customer Portal](https://portal.ckeditor.com/).

```sh
helm install ckeditor-cs . \
   --set ckeditor-cs.server.secret.data.LICENSE_KEY="xxx"
```

then expose the CKEditor Collaboration Server On-premises port

```sh
kubectl port-forward service/ckeditor-cs-server 8000
```

**Note: This is not a production-ready solution. To expose the application to the public in a production environment use a proper proxy configuration.**

<a id="deleting-installation">

## Deleting installation

The command below will stop and remove all pods which were started during the tutorial.

```sh
helm delete ckeditor-cs
```

<a id="customizing-scenario">

## Customizing scenario

You can adjust the example configuration to your needs by modifying the `values.yaml` file in the `.../kubernetes/helm/ckeditor-cs/` directory.

---

Full index of the Cloud Services documentation: [llms.txt](../../../../../llms.txt)
