codimd

by phntom

Helm chartv0.1.12App 2.4.3

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

ParameterDescriptionDefault
storageClassdefault storageClass for PersistenVolumenil
nameOverrideString to partially override codimd.fullname template with a string (will prepend the release name)nil
fullnameOverrideString to fully override codimd.fullname template with a stringnil

Docker image parameters

ParameterDescriptionDefault
image.registryCodiMD docker image registrynabo.codimd.dev
image.repositoryCodiMD docker image repositoryhackmdio/hackmd
image.tagCodiMD docker image version tag2.2.0
image.pullPolicyCodiMD docker image pull policyIfNotPresent
image.pullSecretsCodiMD 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.

ParameterDescriptionDefault
postgresql.enabledDeploy a PostgreSQL server as databasetrue
postgresql.volumePermissionsEnable database persistence using PVCtrue
postgresql.postgresqlUsernameDatabase user to createcodimd
postgresql.postgresqlPasswordPassword for the databasechangeme
postgresql.postgresqlDatabaseDatabase name to createcodimd
mariadb.enabledDeploy a MariaDB server as databasefalse
mariadb.volumePermissions.enabledEnable database persistence using PVCtrue
mariadb.db.userDatabase user to createcodimd
mariadb.db.passwordPassword for the databasechangeme
mariadb.db.nameDatabase name to createcodimd
mariadb.master.persistence.enabledEnable database persistence using PVCtrue
mariadb.replication.enabledMariaDB replication enabledfalse

Networking conectivity parameters

If you want use ingress, please set service.type to be ClusterIP

ParameterDescriptionDefault
service.typeKubernetes Service typeLoadBalancer
service.portService HTTP port80
service.externalTrafficPolicyService externalTrafficPolicynil
service.loadBalancerIPService loadBalancerIPnil
ingress.enabledIf true Ingress will be createdfalse
ingress.annotationsIngress annotationsnil
ingress.hostsIngress hostnamesnil
ingress.tlsIngress TLS configuration (YAML)nil

CodiMD common parameters

ParameterDescriptionDefault
codimd.affinityAffinity for pod assignmentnil
codimd.tolerationsTolerations for pod assignmentnil
codimd.nodeSelectorNode labels for pod assignmentnil
codimd.podAnnotationsExtra annotation for podnil
codimd.securityContext.runAsGroupGroup ID for the CodiMD container1500
codimd.securityContext.runAsUserUser ID for the CodiMD container1500
codimd.securityContext.fsGroupGroup ID for the CodiMD filesystem1500
codimd.securityContext.runAsNonRootRun non root in CodiMD containertrrue
codimd.connection.domainThe domain name your service will be hosted.nil
codimd.connection.urlAddPortSet 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.protocolUseSSLUse SSL protocol for resources path (applied only when domain is set).false
codimd.database.typeThe external database type (only accept postgres, mysql)nil
codimd.database.hostThe host of external databasenil
codimd.database.portThe port of external databasenil
codimd.database.usernameThe username that connects to external databasenil
codimd.database.passwordThe password that connects to external databasenil
codimd.database.databaseNameThe external database name we usednil
codimd.imageUpload.storeTypeThe type of image storagefilesystem
codimd.imageUpload.imgur.clientIdThe Imgur OAuth ClientIDnil
codimd.imageUpload.azure.connectionStringThe Azure image store connection stringnil
codimd.imageUpload.azure.containerThe Azure image store container namenil
codimd.imageUpload.lutim.urlThe lutim URLnil
codimd.imageUpload.minio.endpointThe minio endpointnil
codimd.imageUpload.minio.secureThe minio endpoint is secure or notnil
codimd.imageUpload.minio.portThe minio portnil
codimd.imageUpload.minio.accessKeyThe minio access keynil
codimd.imageUpload.minio.secretKeyThe minio secret keynil
codimd.imageUpload.s3.endpointThe AWS s3 endpointnil
codimd.imageUpload.s3.regionThe AWS s3 regionnil
codimd.imageUpload.s3.accessKeyIdThe AWS s3 access keynil
codimd.imageUpload.s3.secretKeyThe AWS s3 secret keynil
codimd.imageUpload.s3.bucketThe AWS s3 bucket namenil
codimd.imageStorePersistentVolume.enabledEnable image persistence using PVCtrue
codimd.imageStorePersistentVolume.sizeThe size of persistence volume10Gi
codimd.imageStorePersistentVolume.storageClassThe storageClass of persistence volume-
codimd.imageStorePersistentVolume.accessModesThe accessModes of persistence volume[ReadWriteOnce]
codimd.imageStorePersistentVolume.volumeModeThe volumeMode of persistence volumeFilesystem
codimd.versionCheckEnable automatically version checkertrue
codimd.security.useCDNWhether CodiMD would use static assets served on CDNfalse
codimd.security.sessionSecretThe secret string to sign session, please must change this valuechangeit
codimd.security.sessionLifeThe time to expire for session1209600000
codimd.security.hstsEnabledWhether HTST is enabled or nottrue
codimd.security.hstsMaxAge31536000
codimd.security.hstsIncludeSubdomainfalse
codimd.security.hstsPreloadtrue
codimd.security.cspEnabledWhether CSP is enabled or nottrue
codimd.security.cspReportUrinil
codimd.security.allowOriginnil

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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartcodimd is pinned at v0.1.12 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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