dynamodb

by jfelten

Helm chartv0.1.27App 1.12.0Apache-2.0

A Helm chart for running amazon dynamo db on a kubernetes cluster

About this chart

Dynamodb helm chart

This helm chart converts Amazon's dynamodb-local into a k8s deployable application. It creates a 2 container pod with one running a dynamodb table and the other running a dynamodb admin app

The intent is to provide a quick easy way to enable a local dynamo db instance for local development/testing.

prerequisites

  • helm 3
  • a modern working k8s cluster

Install

helm repo add keyporttech https://keyporttech.github.io/helm-charts/
helm install my-release keyporttech/dynamo-db

or clone this repo and install from the file system.

Contributing

Please see keyporttech charts contribution guidelines

Running the cicd tooling locally

This chart uses a Makefile to run CICD. To run:

make build

Values.yaml Configuration

Most configurable values are similar to other helm charts generated via helm create. The configurations specific to this chart are listed below.

Ingress controller

When the ingress controller is enabled the admin UI is available via:

http(s)://host.domain.com/dynamodb

Example with with using nginx controller and CertificateManager letsencrypt TLS issuer:

ingress:
  enabled: true
  host: dynamodb.myhost.com
  annotations:
    kubernetes.io/ingress.class: nginx
    kubernetes.io/ingress.allow-http: "false"
    nginx.ingress.kubernetes.io/proxy-body-size: "0"
    nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
    cert-manager.io/cluster-issuer: cert-issuer-letsencrypt-prod
  tls:
  # Secrets must be manually created in the namespace.
  - secretName: dynamodb-tls
    hosts:
      - dynamodb.myhost.com

Storage

This chart allows for 3 types of storage: pvc, directVolume, and emptyDir set via: storageType.

If no configuration is provided the chart will store data on the node using emptyDir.

If storageType is set to directVolume then directVolume msut be set in the chart vaules.

Example:

directVolume:
  nfs:
    server: 10.10.10.10
    path: "/dynamodb-data"

The following is an example of storage type pvc:

storage: "500Mi"
storageClassName: ""
ParameterDescriptionDefault
dynamodb.image.repositorydynamo db local imageamazon/dynamodb-local
dynamodb.image.pullPolicyimage pull policyIfNotPresent
dynamodb.image.tagimage tag1.12.0
admin.image.repositoryadmin web UI imageaaronshaf/dynamodb-admin
admin.image.pullPolicyimage pull policyIfNotPresent
admin.image.tagimage taglatest
imagePullSecretsimage pull secrets-
nameOverridename override-
fullnameOverridefullname override-
serviceAccount.createcreates service account if truetrue
serviceAccount.annotationsservice account annotations if created-
serviceAccount.nameservice account name if created-
podAnnotationspod annotations-
podSecurityContextpod security context-
securityContextsecurity context-
service.typek8s service typeClusterIP
ingress.enabledenable ingressfalse
ingress.annotationsingress annotations{}
ingress.tlslist of tls secret names and known_hosts[]
ingress.hostingress host-
autoscaling.enabledenable autoscalingfalse
autoscaling.minReplicasmin replicas1
autoscaling.maxReplicasmax replicas100
autoscaling.targetCPUUtilizationPercentageautoscaling target CPU80
autoscaling.targetMemoryUtilizationPercentageautoscaling target memoryunset
resourcespod resources[]
nodeSelectornode selector{}
tolerationsnode selector[]
affinityaffinity{}
storageTypetype of storage pvc, directVolume, emptyDiremptyDir
storagesize of pvc storageunset
storageClassNamepvc storage class nameunset
directVolumeyaml definings k8s volumeunset

Deploy dynamodb with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has dynamodb 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 chartdynamodb is pinned at v0.1.27 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