If you’re looking for an efficient way to deploy CKAN on Kubernetes, you might be interested in using a Helm chart. Helm is a package manager that simplifies the deployment of Kubernetes applications.. With a CKAN Helm chart, you can easily deploy and manage your CKAN instance on Kubernetes with just a few simple commands.

In this blog, we’ll explore the benefits of using a CKAN Helm chart and guide you through the steps to get started.

A Helm chart for CKAN

The current chart version is 1.0.2

This chart deploys a self-contained CKAN instance with all of its dependencies. These can be enabled/disabled if they already exist in your infrastructure.

The values can also enable two jobs for initializing Postgres and SOLR. These will use the provided CKAN environment to set the access permissions for the ckan and datastore DB users and create a SOLR collection for the CKAN instance.

Prerequisites Details

  • Kubernetes 1.9
  • Install Helm
  • Setup correctly kubectl and kubeconfig setup before running helm.

Helm repo

The datapusher and ckan charts can be found on Keitaro’s helm repo:

$ helm repo add keitaro-charts https://keitaro-charts.storage.googleapis.com

Deploy CKAN on Kubernetes cluster

To deploy CKAN on Kubernetes cluster with the release name

<release-name>
$ helm repo add keitaro-charts https://keitaro-charts.storage.googleapis.com

$ helm install <release-name> keitaro-charts/ckan

Configuration

Production deployment values can be set in values.yaml here. This file contains variables that will be passed to the templates. All configurable values should be placed in this file. Alternatively, you can specify each parameter using the

--set key=value[,key=value] argument to helm install.

Cleanup

To remove the spawned pods, you can run simple.

helm delete <release-name>

Helm will however preserve created persistent volume claims, to also remove them execute the commands below:

$ release=<release-name>
$ helm delete $release
$ kubectl delete pvc -l release=$release

Chart Requirements

RepositoryNameVersion
https://charts.bitnami.com/bitnamipostgresql10.2.0
https://charts.bitnami.com/bitnamiredis12.2.3
https://charts.helm.sh/incubatorsolr1.4.0
https://keitaro-charts.storage.googleapis.comdatapusher1.0.0

Chart Values

KeyTypeDefaultDescription
CkanDBNamestring"ckan_default"Variable for name of the database used by CKAN
CkanDBPassstring"pass"Variable for password for the CKAN database owner
CkanDBUserstring"ckan_default"Variable for username for the owner of the CKAN database
DBDeploymentNamestring"postgres"Variable for name override for postgres deployment
DBHoststring"postgres"Variable for name of headless svc from postgres deployment
DatapusherNamestring"datapusher"Variable for name override for datapusher deployment
DatastoreDBNamestring"datastore_default"Variable for name of the database used by Datastore
DatastoreRODBPassstring"pass"Variable for password for the datastore database user with read access
DatastoreRODBUserstring"datastorero"Variable for username for the user with read access to the datastore database
DatastoreRWDBPassstring"pass"Variable for password for the datastore database user with write access
DatastoreRWDBUserstring"datastorerw"Variable for username for the user with write access to the datastore database
MasterDBNamestring"postgres"Variable for name of the master user database in PostgreSQL
MasterDBPassstring"pass"Variable for password for the master user in PostgreSQL
MasterDBUserstring"postgres"Variable for master user name for PostgreSQL
RedisNamestring"redis"Variable for name override for redis deployment
SolrNamestring"solr"Variable for name override for solr deployment
affinityobject{}
ckan.activityStreamsEmailNotificationsstring"true"
ckan.ckanPluginsstring"envvars image_view text_view recline_view datastore datapusher"List of plugins to be used by the instance
ckan.datapusherCallbackUrlBasestring"http://ckan"Location of the CKAN k8s service to be used by the Datapusher, overriding the default site url route.
ckan.datapusherUrlstring"http://datapusher-headless:8000"Location of the datapusher service to be used by the CKAN instance
ckan.datastore.RoDbNamestring"datastore_default"Name of the database to be used for Datastore
ckan.datastore.RoDbPasswordstring"pass"Password for the datastore read permissions user
ckan.datastore.RoDbUrlstring"postgres"Url of the PostgreSQL server where the datastore database is hosted
ckan.datastore.RoDbUserstring"datastorero"Username for the datastore database with read permissions
ckan.datastore.RwDbNamestring"datastore_default"Name of the database to be used for Datastore
ckan.datastore.RwDbPasswordstring"pass"Password for the datastore write permissions user
ckan.datastore.RwDbUrlstring"postgres"Url of the PostgreSQL server where the datastore database is hosted
ckan.datastore.RwDbUserstring"datastorerw"Username for the datastore database with write permissions
ckan.db.ckanDbNamestring"ckan_default"Name of the database to be used by CKAN
ckan.db.ckanDbPasswordstring"pass"Password of the user for the database to be used by CKAN
ckan.db.ckanDbUrlstring"postgres"Url of the PostgreSQL server where the CKAN database is hosted
ckan.db.ckanDbUserstring"ckan_default"Username of the database to be used by CKAN
ckan.debugstring"false"
ckan.extraEnvlist[]An array to add extra environment variables For example: extraEnv: – name: FOO value: “bar”
ckan.issues.sendEmailNotificationsstring"true"
ckan.liveness.failureThresholdint6Failure threshold for the liveness probe
ckan.liveness.initialDelaySecondsint10Initial delay for the liveness probe
ckan.liveness.periodSecondsint10Check interval for the liveness probe
ckan.liveness.timeoutSecondsint10Timeout interval for the liveness probe
ckan.locale.defaultstring"en"
ckan.locale.offeredstring"en"
ckan.maintenanceModestring"false"Set to true to disable CKAN from starting and serve a maintenance page
ckan.psql.initializebooltrueFlag whether to initialize the PostgreSQL instance with the provided users and databases
ckan.psql.masterDatabasestring"postgres"PostgreSQL database for the master user
ckan.psql.masterPasswordstring"pass"PostgreSQL master user password
ckan.psql.masterUserstring"postgres"PostgreSQL master username
ckan.readiness.failureThresholdint6Failure threshold for the readiness probe
ckan.readiness.initialDelaySecondsint10Inital delay seconds for the readiness probe
ckan.readiness.periodSecondsint10
ckan.readiness.timeoutSecondsint10Timeout interval for the readiness probe
ckan.redisstring"redis://redis-headless:6379/0"Location of the Redis service to be used by the CKAN instance
ckan.siteIdstring"site-id-here"Site id
ckan.siteTitlestring"Site Title here"Site title for the instance
ckan.siteUrlstring"http://localhost:5000"Url for the CKAN instance
ckan.smtp.mailFromstring"[email protected]"
ckan.smtp.passwordstring"smtpPassword"
ckan.smtp.serverstring"smtpServerURLorIP:port"
ckan.smtp.starttlsstring"true"
ckan.smtp.tlsstring"enabled"
ckan.smtp.userstring"smtpUser"
ckan.solrstring"http://solr-headless:8983/solr/ckancollection"Location of SOLR collection used by the instance
ckan.spatialBackendstring"solr"
ckan.storagePathstring"/var/lib/ckan/default"Storage path to be used by the instance
ckan.sysadminApiTokenstring"replace_this_with_generated_api_token_for_sysadmin"CKAN system admin API token Needs to be generated via the CKAN UI and replaced after initial deployment
ckan.sysadminEmailstring"[email protected]"CKAN system admin email
ckan.sysadminNamestring"ckan_admin"CKAN system admin username
ckan.sysadminPasswordstring"PasswordHere"CKAN system admin password
datapusher.datapusher.chunkSizestring"10240000"Size of chunks of the data that is being downloaded in bytes
datapusher.datapusher.datapusherRewriteResourcesstring"True"Enable or disable (boolean) whether datapusher should rewrite resources uploaded to CKAN’s filestore, since datapusher takes the CKAN Site URL value for generating the resource URL. Default: False
datapusher.datapusher.datapusherRewriteUrlstring"http://ckan"Sets the rewrite URL that datapushed will rewrite resources that are uploaded to CKAN’s filestore. Default: http://ckan:5000
datapusher.datapusher.datapusherSslVerifystring"False"Enable or disable (boolean) verification of SSL when trying to get resources. Default: True
datapusher.datapusher.downloadTimeoutstring"300"Timeout limit of the download request
datapusher.datapusher.insertRowsstring"50000"Number of rows to take from the data and upload them as chunks to datastore
datapusher.datapusher.maxContentLengthstring"102400000"
datapusher.enabledbooltrueFlag to control whether to deploy the datapusher
datapusher.fullnameOverridestring"datapusher"Name override for the datapusher deployment
fullnameOverridestring"ckan"
image.pullPolicystring"IfNotPresent"
image.repositorystring"keitaro/ckan"
image.tagstring"2.9.2"
imagePullSecretslist[]
ingress.annotationsobject{}
ingress.enabledboolfalse
ingress.hosts[0].hoststring"chart-example.local"
ingress.hosts[0].pathslist[]
ingress.tlslist[]
ingressRoute.enabledboolfalse
ingressRoute.hoststring"chart-example.local"Used in conjunction with a Traefik v2 deployment
nameOverridestring""
nodeSelectorobject{}
podSecurityContextobject{}
postgresql.enabledbooltrueFlag to control whether to deploy PostgreSQL
postgresql.existingSecretstring"postgrescredentials"Name of existing secret that holds passwords for PostgreSQL
postgresql.fullnameOverridestring"postgres"Name override for the PostgreSQL deployment
postgresql.persistence.sizestring"1Gi"Size of the PostgreSQL pvc
postgresql.pgPassstring"pass"Password for the master PostgreSQL user. Feeds into the postgrescredentials secret that is provided to the PostgreSQL chart
pvc.enabledbooltrue
pvc.sizestring"1Gi"
pvc.storageClassNamestring""
redis.cluster.enabledboolfalseCluster mode for Redis
redis.enabledbooltrueFlag to control whether to deploy Redis
redis.fullnameOverridestring"redis"Name override for the redis deployment
redis.master.persistence.enabledboolfalseEnable redis volume claim
redis.master.persistence.sizestring"1Gi"Size of the volume claim
redis.usePasswordboolfalseUse password for accessing redis
replicaCountint1
resourcesobject{}
securityContextobject{}
service.portint80
service.typestring"ClusterIP"Type of the service created for the CKAN pod
serviceAccount.annotationsobject{}Annotations to add to the service account
serviceAccount.createboolfalseSpecifies whether a service account should be created
serviceAccount.namestringnilThe name of the service account to use. If not set and create is true, a name is generated using the fullname template
solr.enabledbooltrueFlag to control whether to deploy SOLR
solr.fullnameOverridestring"solr"Name override for the SOLR deployment
solr.image.repositorystring"solr"Repository for the SOLR image
solr.image.tagstring"6.6.6"Tag for the SOLR image
solr.initialize.configsetNamestring"ckanConfigSet"Name of the config set used for initializing
solr.initialize.enabledbooltrueFlag whether to initialize the SOLR instance with the provided collection name
solr.initialize.maxShardsPerNodeint10Maximum shards per node
solr.initialize.numShardsint2Number of shards for the SOLR collection
solr.initialize.replicationFactorint1Number of replicas for each SOLR shard
solr.replicaCountint1Number of SOLR instances in the cluster
solr.volumeClaimTemplates.storageSizestring"5Gi"Size of Solr PVC
solr.zookeeper.persistence.sizestring"1Gi"Size of ZK PVC
solr.zookeeper.replicaCountint1Numer of Zookeeper replicas in the ZK cluster
tolerationslist[]

Summary

If you are looking for an efficient way to deploy CKAN on Kubernetes, using a Helm chart can be a great solution. Helm is a package manager that streamlines the deployment of Kubernetes applications. With a CKAN Helm chart, you can quickly deploy and manage your CKAN instance on Kubernetes with minimal effort. This approach can save time and resources while providing a scalable and reliable infrastructure for your CKAN application.

Author avatar

About Filip Mihajlovski

Dev Ops at Keitaro

How may we help you with ?

By submitting this form you agree to Keitaro using your personal data in accordance with the General Data Protection Regulation. You can unsubscribe at any time. For information about our privacy practices, please visit our Privacy Policy page.