codimd
by phntom
A CodiMD Helm chart for Kubernetes (scram-sha-256 compatible)
About this chart
CodiMD
CodiMD is a realtime collaborative markdown notes on all platforms.
Look at CodiMD Documentation for detail setting.
Prerequisites
- Kubernetes 1.14+
- Helm 2.16+ or Helm 3.0+
- PV provisioner support in the underlying infrastructure
How to use?
$ helm repo add codimd https://helm.codimd.dev/
$ helm install my-release codimd/codimd
Parameters
Common Helm parameters
If you use AWS EKS, please setup global.storageClass as gp2
| Parameter | Description | Default |
|---|---|---|
| storageClass | default storageClass for PersistenVolume | nil |
| nameOverride | String to partially override codimd.fullname template with a string (will prepend the release name) | nil |
| fullnameOverride | String to fully override codimd.fullname template with a string | nil |
Docker image parameters
| Parameter | Description | Default |
|---|---|---|
| image.registry | CodiMD docker image registry | nabo.codimd.dev |
| image.repository | CodiMD docker image repository | hackmdio/hackmd |
| image.tag | CodiMD docker image version tag | 2.2.0 |
| image.pullPolicy | CodiMD docker image pull policy | IfNotPresent |
| image.pullSecrets | CodiMD docker image pull secrets | [] |
Deploy an internal database parameters
This Helm chart contains postgreSQL and mariaDB, you just select one database to deploy. if you want to use external database (maybe cloud provider service or self-hosted database), just set postgresql.enabled and mariadb.enabled to be false and manuall assign database connection parameters in codimd.database.
| Parameter | Description | Default |
|---|---|---|
| postgresql.enabled | Deploy a PostgreSQL server as database | true |
| postgresql.volumePermissions | Enable database persistence using PVC | true |
| postgresql.postgresqlUsername | Database user to create | codimd |
| postgresql.postgresqlPassword | Password for the database | changeme |
| postgresql.postgresqlDatabase | Database name to create | codimd |
| mariadb.enabled | Deploy a MariaDB server as database | false |
| mariadb.volumePermissions.enabled | Enable database persistence using PVC | true |
| mariadb.db.user | Database user to create | codimd |
| mariadb.db.password | Password for the database | changeme |
| mariadb.db.name | Database name to create | codimd |
| mariadb.master.persistence.enabled | Enable database persistence using PVC | true |
| mariadb.replication.enabled | MariaDB replication enabled | false |
Networking conectivity parameters
If you want use ingress, please set service.type to be ClusterIP
| Parameter | Description | Default |
|---|---|---|
| service.type | Kubernetes Service type | LoadBalancer |
| service.port | Service HTTP port | 80 |
| service.externalTrafficPolicy | Service externalTrafficPolicy | nil |
| service.loadBalancerIP | Service loadBalancerIP | nil |
| ingress.enabled | If true Ingress will be created | false |
| ingress.annotations | Ingress annotations | nil |
| ingress.hosts | Ingress hostnames | nil |
| ingress.tls | Ingress TLS configuration (YAML) | nil |
CodiMD common parameters
| Parameter | Description | Default |
|---|---|---|
| codimd.affinity | Affinity for pod assignment | nil |
| codimd.tolerations | Tolerations for pod assignment | nil |
| codimd.nodeSelector | Node labels for pod assignment | nil |
| codimd.podAnnotations | Extra annotation for pod | nil |
| codimd.securityContext.runAsGroup | Group ID for the CodiMD container | 1500 |
| codimd.securityContext.runAsUser | User ID for the CodiMD container | 1500 |
| codimd.securityContext.fsGroup | Group ID for the CodiMD filesystem | 1500 |
| codimd.securityContext.runAsNonRoot | Run non root in CodiMD container | trrue |
| codimd.connection.domain | The domain name your service will be hosted. | nil |
| codimd.connection.urlAddPort | Set to assign port for URL. (You don’t need this for ports 80 or 443. This only works when domain is set) | false |
| codimd.connection.protocolUseSSL | Use SSL protocol for resources path (applied only when domain is set). | false |
| codimd.database.type | The external database type (only accept postgres, mysql) | nil |
| codimd.database.host | The host of external database | nil |
| codimd.database.port | The port of external database | nil |
| codimd.database.username | The username that connects to external database | nil |
| codimd.database.password | The password that connects to external database | nil |
| codimd.database.databaseName | The external database name we used | nil |
| codimd.imageUpload.storeType | The type of image storage | filesystem |
| codimd.imageUpload.imgur.clientId | The Imgur OAuth ClientID | nil |
| codimd.imageUpload.azure.connectionString | The Azure image store connection string | nil |
| codimd.imageUpload.azure.container | The Azure image store container name | nil |
| codimd.imageUpload.lutim.url | The lutim URL | nil |
| codimd.imageUpload.minio.endpoint | The minio endpoint | nil |
| codimd.imageUpload.minio.secure | The minio endpoint is secure or not | nil |
| codimd.imageUpload.minio.port | The minio port | nil |
| codimd.imageUpload.minio.accessKey | The minio access key | nil |
| codimd.imageUpload.minio.secretKey | The minio secret key | nil |
| codimd.imageUpload.s3.endpoint | The AWS s3 endpoint | nil |
| codimd.imageUpload.s3.region | The AWS s3 region | nil |
| codimd.imageUpload.s3.accessKeyId | The AWS s3 access key | nil |
| codimd.imageUpload.s3.secretKey | The AWS s3 secret key | nil |
| codimd.imageUpload.s3.bucket | The AWS s3 bucket name | nil |
| codimd.imageStorePersistentVolume.enabled | Enable image persistence using PVC | true |
| codimd.imageStorePersistentVolume.size | The size of persistence volume | 10Gi |
| codimd.imageStorePersistentVolume.storageClass | The storageClass of persistence volume | - |
| codimd.imageStorePersistentVolume.accessModes | The accessModes of persistence volume | [ReadWriteOnce] |
| codimd.imageStorePersistentVolume.volumeMode | The volumeMode of persistence volume | Filesystem |
| codimd.versionCheck | Enable automatically version checker | true |
| codimd.security.useCDN | Whether CodiMD would use static assets served on CDN | false |
| codimd.security.sessionSecret | The secret string to sign session, please must change this value | changeit |
| codimd.security.sessionLife | The time to expire for session | 1209600000 |
| codimd.security.hstsEnabled | Whether HTST is enabled or not | true |
| codimd.security.hstsMaxAge | 31536000 | |
| codimd.security.hstsIncludeSubdomain | false | |
| codimd.security.hstsPreload | true | |
| codimd.security.cspEnabled | Whether CSP is enabled or not | true |
| codimd.security.cspReportUri | nil | |
| codimd.security.allowOrigin | nil |
Deploy codimd with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has codimd on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartcodimd is pinned at v0.1.12 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply