Sign up (with export icon)

Kubernetes with Helm

Show the table of contents

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.

The repository provides Helm charts for two setups: CKEditor AI On-Premises standalone, with its own MySQL database and Redis, and CKEditor AI On-Premises together with Collaboration Server On-Premises, where both services share one MySQL database and Redis.

Prerequisites

Copy link

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 AI On-Premises Docker Registry.
Please prepare the download token from the Customer Portal.

Note

A valid license key is needed in order to install CKEditor AI On-Premises.
Contact us for a trial license key.

Preparing development environment

Copy link
  1. Clone the cksource/ckeditor-cs-on-premises-infrastructure Git repository.
git clone git@github.com:cksource/ckeditor-cs-on-premises-infrastructure.git
Copy code
  1. Go to the kubernetes/helm directory.
cd ckeditor-cs-on-premises-infrastructure/kubernetes/helm
Copy code
  1. Create imagePullSecret for pulling images from the CKEditor container registry, replace the placeholder with the download token.
kubectl create secret docker-registry docker-cke-cs-com \
	--docker-username "ai-service" \
	--docker-server "https://docker.cke-cs.com" \
	--docker-password="<PASSWORD>"
Copy code

Running the standalone scenario

Copy link

The standalone scenario runs CKEditor AI On-Premises with a MySQL and single instance of Redis.

Create the dev.values.yaml file in the ai-service-development-stack directory. Replace the placeholders with your CKEditor AI On-Premises license key, which can be found in the Customer Portal, and with your LLM provider and API key. See LLM providers for available providers.

ai-service:
  secret:
	data:
	  LICENSE_KEY: '<LICENSE_KEY>'
	  PROVIDERS: '{"openai":{"type":"openai","apiKeys":["<API_KEY>"]}}'
Copy code

Install the chart:

cd ai-service-development-stack &&
helm dependency update &&
helm install ai-service . --values dev.values.yaml
Copy code

then expose the CKEditor AI On-Premises port

kubectl port-forward service/ai-service 8000:8080
Copy code

Running the scenario with Collaboration Server

Copy link

This scenario runs CKEditor AI On-Premises and Collaboration Server On-Premises on a shared MySQL and single instance of Redis. See Collaboration Server integration for details.

Create the dev.values.yaml file in the cs-with-ai directory. Replace the placeholders with your Collaboration Server On-Premises and CKEditor AI On-Premises license keys, and with your LLM provider API key.

sharedDatabase: &sharedDatabase
  DATABASE_HOST: cs-with-ai-mysql
  DATABASE_USER: root
  DATABASE_PASSWORD: root-password
sharedRedis: &sharedRedis
  REDIS_HOST: cs-with-ai-redis-master

ckeditor-cs:
  server:
	secret:
	  data:
		<<: [*sharedDatabase, *sharedRedis]
		ENVIRONMENTS_MANAGEMENT_SECRET_KEY: secret
		LICENSE_KEY: '<COLLABORATION_SERVER_LICENSE_KEY>'

ai-service:
  secret:
	data:
	  <<: [*sharedDatabase, *sharedRedis]
	  ENVIRONMENTS_MANAGEMENT_SECRET_KEY: secret
	  LICENSE_KEY: '<AI_SERVICE_LICENSE_KEY>'
	  PROVIDERS: '{"openai":{"type":"openai","apiKeys":["<API_KEY>"]}}'

mysql:
  enabled: true
redis:
  enabled: true
Copy code

Install the chart:

cd cs-with-ai &&
helm dependency update &&
helm install cs-with-ai . --values dev.values.yaml
Copy code

then expose the Collaboration Server On-Premises and CKEditor AI On-Premises ports

kubectl port-forward service/cs-with-ai-ckeditor-cs-server 8000 &
kubectl port-forward service/cs-with-ai-ai-service 8001:8080
Copy code

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

Deleting installation

Copy link

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

helm delete ai-service
Copy code

For the scenario with Collaboration Server, use helm delete cs-with-ai.

Customizing scenario

Copy link

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