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.
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.
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.
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 architecture and requirements articles.
A valid license key is needed in order to install CKEditor AI On-Premises.
Contact us for a trial license key.
- Clone the
cksource/ckeditor-cs-on-premises-infrastructureGit repository.
git clone git@github.com:cksource/ckeditor-cs-on-premises-infrastructure.gitCopy code- Go to the
kubernetes/helmdirectory.
cd ckeditor-cs-on-premises-infrastructure/kubernetes/helmCopy code- Create
imagePullSecretfor 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 codeThe 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 codeInstall the chart:
cd ai-service-development-stack &&
helm dependency update &&
helm install ai-service . --values dev.values.yamlCopy codethen expose the CKEditor AI On-Premises port
kubectl port-forward service/ai-service 8000:8080Copy codeThis 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: trueCopy codeInstall the chart:
cd cs-with-ai &&
helm dependency update &&
helm install cs-with-ai . --values dev.values.yamlCopy codethen 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:8080Copy codeNote: This is not a production-ready solution. To expose the application to the public in a production environment use a proper proxy configuration.
The command below will stop and remove all pods which were started during the tutorial.
helm delete ai-serviceCopy codeFor the scenario with Collaboration Server, use helm delete cs-with-ai.
You can adjust the example configuration to your needs by modifying the values.yaml file in the .../kubernetes/helm/ai-service/ directory.