Provides a CMS Plone Backend and Frontend for Kubernetes with cdk8s
Project description
CDK8S Plone
A CDK8S library for deploying Plone CMS to Kubernetes.
This library provides constructs to bootstrap a Plone deployment on a Kubernetes cluster using the CDK8S framework.
Features
- Backend: Plone backend (API with
plone.voltoor Classic-UI) - Frontend: Plone Volto (modern React-based user interface)
- Varnish Caching: Optional HTTP caching layer using kube-httpcache with cluster-wide cache invalidation
- High Availability: Configurable replicas with PodDisruptionBudgets
- Multi-language Support: Published to npm (TypeScript/JavaScript) and PyPI (Python)
Installation
TypeScript/JavaScript
Create a new CDK8S project (or use an existing one):
cdk8s init typescript-app
Install the library:
npm install @bluedynamics/cdk8s-plone
Package: @bluedynamics/cdk8s-plone
Python
Create a new CDK8S project:
cdk8s init python-app
Install the library:
pip install cdk8s-plone
Package: cdk8s-plone
Quick Start
Basic Plone Deployment
import { App, Chart } from 'cdk8s';
import { Plone, PloneVariant } from '@bluedynamics/cdk8s-plone';
const app = new App();
const chart = new Chart(app, 'PloneDeployment');
new Plone(chart, 'my-plone', {
variant: PloneVariant.VOLTO,
backend: {
image: 'plone/plone-backend:6.0.10',
replicas: 3,
},
frontend: {
image: 'plone/plone-frontend:16.0.0',
replicas: 2,
},
});
app.synth();
With Varnish HTTP Cache
import { PloneHttpcache } from '@bluedynamics/cdk8s-plone';
const plone = new Plone(chart, 'my-plone', {
variant: PloneVariant.VOLTO,
backend: { image: 'plone/plone-backend:6.0.10' },
frontend: { image: 'plone/plone-frontend:16.0.0' },
});
new PloneHttpcache(chart, 'cache', {
plone: plone,
existingSecret: 'varnish-secret',
replicas: 2,
});
Generate Kubernetes Manifests
cdk8s synth
The manifests are stored in the dist/ directory.
For a complete example, see the example project.
Prerequisites
- kubectl - Command-line tool for deploying Kubernetes manifests. Install kubectl
- Helm (optional) - Only needed if generating Helm charts. Install Helm
- Node.js - For TypeScript/JavaScript development
- Python 3.8+ - For Python development
API Documentation
For complete API documentation, see API.md.
Key Constructs
Plone
Main construct for deploying Plone CMS. Supports two variants:
- VOLTO: Modern React frontend with REST API backend (default)
- CLASSICUI: Traditional server-side rendered Plone
Properties:
backendServiceName- Name of the backend Kubernetes servicefrontendServiceName- Name of the frontend service (VOLTO only)variant- Deployment variant (VOLTO or CLASSICUI)siteId- Plone site ID in ZODB (default: 'Plone')
PloneHttpcache
Varnish HTTP caching layer using the kube-httpcache Helm chart.
Properties:
httpcacheServiceName- Name of the Varnish service
Configuration Options
PloneOptions
version- Version of your projectsiteId- Plone site ID (default: 'Plone')variant- PloneVariant.VOLTO or PloneVariant.CLASSICUI (default: VOLTO)backend- Backend configuration (PloneBaseOptions)frontend- Frontend configuration (PloneBaseOptions, required for VOLTO)imagePullSecrets- Image pull secrets for private registries
PloneBaseOptions
Configuration for backend or frontend:
Container:
image- Container image (e.g., 'plone/plone-backend:6.0.10')imagePullPolicy- Pull policy (default: 'IfNotPresent')replicas- Number of replicas (default: 2)environment- Environment variables (cdk8s-plus-30.Env)
Resources:
requestCpu/limitCpu- CPU requests/limitsrequestMemory/limitMemory- Memory requests/limits
High Availability:
minAvailable- Min pods during updates (for PodDisruptionBudget)maxUnavailable- Max unavailable pods during updates
Health Probes:
readinessEnabled- Enable readiness probe (default: true)readinessInitialDelaySeconds/readinessTimeoutSeconds/readinessPeriodSecondsreadinessSuccessThreshold/readinessFailureThresholdlivenessEnabled- Enable liveness probe (default: false, recommended true for frontend)livenessInitialDelaySeconds/livenessTimeoutSeconds/livenessPeriodSecondslivenessSuccessThreshold/livenessFailureThreshold
Annotations:
annotations- Deployment metadata annotationspodAnnotations- Pod template annotations (e.g., for Prometheus)serviceAnnotations- Service annotations (e.g., for external-dns)
PloneHttpcacheOptions
plone- Plone construct to attach cache to (required)varnishVcl- VCL configuration as stringvarnishVclFile- Path to VCL configuration fileexistingSecret- Kubernetes secret for Varnish admin credentialsreplicas- Number of Varnish replicas (default: 2)requestCpu/limitCpu- CPU resourcesrequestMemory/limitMemory- Memory resourcesservicemonitor- Enable Prometheus ServiceMonitor (default: false)
Development
This project uses Projen to manage project configuration. Do not edit generated files directly.
Setup
Clone the repository and install dependencies:
nvm use lts/*
corepack enable
npx projen
Common Commands
# Run tests
npx projen test
# Run tests in watch mode
npx projen test:watch
# Build (compile TypeScript + generate JSII bindings)
npx projen build
# Lint
npx projen eslint
# Generate API documentation
npx projen docgen
# Package for distribution
npx projen package-all
Making Changes
- Edit
.projenrc.tsfor project configuration changes - Run
npx projento regenerate project files - Make code changes in
src/ - Run tests and update snapshots if needed:
npx projen test -- -u
References
License
See LICENSE file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cdk8s_plone-0.1.0.tar.gz.
File metadata
- Download URL: cdk8s_plone-0.1.0.tar.gz
- Upload date:
- Size: 597.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edc55672099a88b8ed42f9f02a54b46f41611106410f66c82880eb2e204ec2d8
|
|
| MD5 |
94421764205d7c89fd2a1b3099bb6882
|
|
| BLAKE2b-256 |
4376ddf715ae4dd53f4b00cea9a65c2178e1f2b4a84d2250eb7492748826a01d
|
File details
Details for the file cdk8s_plone-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cdk8s_plone-0.1.0-py3-none-any.whl
- Upload date:
- Size: 595.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eea470d45c7c1314b2ecf2be7d9a4a402446ebea1a858cf9dc15278e277bf4a5
|
|
| MD5 |
77ba9649309c3d8a35f7b3c04fa3f033
|
|
| BLAKE2b-256 |
81680de5d9a5e8ce98e503482da4e81f4eb4c73c07227c38daf3b583318fe320
|