testkube

by joaquinito2051

Helm chartv2.16.0App 2.16.0

Testkube is an open-source platform that simplifies the deployment and management of automated testing infrastructure.

About this chart

testkube

Testkube is an open-source platform that simplifies the deployment and management of automated testing infrastructure.

Install

Add kubeshop Helm repository and fetch latest charts info:

helm repo add kubeshop https://kubeshop.github.io/helm-charts
helm repo update

TLS

Testkube API needs to have additional configuration if NATS or MinIO (or any S3-compatible storage) is used. THe following sections describe how to configure TLS for NATS and MinIO.

NATS

If you want to provision NATS server with TLS, first you will need to create a Kubernetes secret which contains the server certificate, certificate key and CA certificate, and then you can use the following configuration

nats:
  nats:
    tls:
      allowNonTLS: false
      secret:
        name: nats-server-cert
      ca: "ca.crt"
      cert: "cert.crt"
      key: "cert.key"

If NATS is configured to use TLS, Testkube API needs to set the secure flag so it uses a secure protocol when connecting to NATS.

testkube-api:
  nats:
    tls:
      enabled: true

Additionally, if NATS is configured to use a self-signed certificate, Testkube API needs to have the CA & client certificate in order to verify the NATS server certificate. You will need to create a Kubernetes secret which contains the client certificate, certificate key and CA certificate.

testkube-api:
  nats:
    tls:
      enabled: true
      mountCACertificate: true
      certSecret:
        enabled: true

It is also possible to skip the verification of the NATS server certificate by setting the skipVerify flag to true.

testkube-api:
  nats:
    tls:
      enabled: true
      skipVerify: true

To use external NATS server, it's possible to configure:

testkube-api:
  nats:
    enabled: false
    uri: nats://some-nats-address:4222
    # or providing URI with Kubernetes secret:
    # secretName: example-secret
    # secretKey: example-key

MinIO/S3

Currently, Testkube doesn't support provisioning MinIO with TLS. However, if you use an external MinIO (or any S3-compatible storage) you can configure Testkube API to use TLS when connecting to it.

testkube-api:
  storage:
    SSL: true

Additionally, if S3 server is configured to use a self-signed certificate, Testkube API needs to have the CA & client certificate in order to verify the S3 server certificate. You will need to create a Kubernetes secret which contains the client certificate, certificate key and CA certificate.

testkube-api:
  storage:
    SSL: true
    mountCACertificate: true
    certSecret:
      enabled: true

It is also possible to skip the verification of the S3 server certificate by setting the skipVerify flag to true.

testkube-api:
  storage:
    SSL: true
    skipVerify: true

NOTE: This will add CustomResourceDefinitions and RBAC roles and RoleBindings to the cluster. This installation requires having cluster administrative rights.

helm install testkube kubeshop/testkube --create-namespace --namespace testkube

Uninstall

NOTE: Uninstalling Testkube will also delete all CRDs and all resources created by Testkube.

helm delete testkube -n testkube
kubectl delete namespace testkube

Migration to upgradable CRDs Helm chart

Originally Helm chart stored CRDs in a special crds/ folder. In order to make them upgradable they were moved into the regular templates/ folder. Unfortunately Helm uses different annotations and labels for resources located in crds/ and templates/ folders. Please run these commands to fix it:

kubectl annotate --overwrite crds executors.executor.testkube.io meta.helm.sh/release-name="testkube" meta.helm.sh/release-namespace="testkube"
kubectl annotate --overwrite crds tests.tests.testkube.io meta.helm.sh/release-name="testkube" meta.helm.sh/release-namespace="testkube"
kubectl annotate --overwrite crds scripts.tests.testkube.io meta.helm.sh/release-name="testkube" meta.helm.sh/release-namespace="testkube"
kubectl label --overwrite crds executors.executor.testkube.io app.kubernetes.io/managed-by=Helm
kubectl label --overwrite crds tests.tests.testkube.io app.kubernetes.io/managed-by=Helm
kubectl label --overwrite crds scripts.tests.testkube.io app.kubernetes.io/managed-by=Helm

Requirements

RepositoryNameVersion
file://../testkube-apitestkube-api2.0.10
file://../testkube-logstestkube-logs0.2.0
file://../testkube-operatortestkube-operator2.0.0
https://charts.bitnami.com/bitnamimongodb13.10.1
https://nats-io.github.io/k8s/helm/charts/nats1.1.7
https://charts.bitnami.com/bitnamipostgresql16.3.0

Values

KeyTypeDefaultDescription
globalobject{"affinity":{},"annotations":{},"features":{"logsV2":false,"whitelistedContainers":"init,logs,scraper"},"imagePullSecrets":[],"imageRegistry":"","labels":{},"nodeSelector":{},"testWorkflows":{"createOfficialTemplates":true,"createServiceAccountTemplates":true,"globalTemplate":{"enabled":false,"name":"global-template","spec":{}}},"tls":{"caCertPath":""},"tolerations":[{"effect":"NoSchedule","key":"kubernetes.io/arch","operator":"Equal","value":"arm64"}],"volumes":{"additionalVolumeMounts":[],"additionalVolumes":[]}}Important! Please, note that this will override sub-chart image parameters.
global.affinityobject{}Affinity rules to add to all deployed Pods
global.annotationsobject{}Annotations to add to all deployed objects
global.features.logsV2boolfalseToggle whether to enable V2 log support
global.features.whitelistedContainersstring"init,logs,scraper"Comma-separated array of containers which should get scraped for logs
global.imagePullSecretslist[]Global Docker registry secret names as an array
global.imageRegistrystring""Global Docker image registry
global.labelsobject{}Labels to add to all deployed objects
global.nodeSelectorobject{}Node labels to add to all deployed Pods
global.testWorkflowsobject{"createOfficialTemplates":true,"createServiceAccountTemplates":true,"globalTemplate":{"enabled":false,"name":"global-template","spec":{}}}Test Workflows configuration
global.testWorkflows.createOfficialTemplatesbooltrueCreate TestWorkflowTemplates with automatically configured execution
global.testWorkflows.createServiceAccountTemplatesbooltrueCreate TestWorkflowTemplates to easily use the service account
global.testWorkflows.globalTemplateobject{"enabled":false,"name":"global-template","spec":{}}Global TestWorkflowTemplate that will be automatically included for all executions
global.testWorkflows.globalTemplate.enabledboolfalseIs global template enabled
global.testWorkflows.globalTemplate.namestring"global-template"Name of the global template
global.testWorkflows.globalTemplate.externalboolfalseIs the global template sourced externally? (otherwise it's created from spec below)
global.testWorkflows.globalTemplate.specobject{}Specification for the global template
global.tls.caCertPathstring""Path to the PEM-encoded CA certificate file (needs to be mounted to the container previously)
global.tolerationslist[{"effect":"NoSchedule","key":"kubernetes.io/arch","operator":"Equal","value":"arm64"}]Tolerations to add to all deployed pods
global.volumesobject{"additionalVolumeMounts":[],"additionalVolumes":[]}Global volume settings (API & Test Jobs)
global.volumes.additionalVolumeMountslist[]Additional volume mounts to be added to the Testkube API container and Test Jobs containers
global.volumes.additionalVolumeslist[]Additional volumes to be added to the Testkube API container and Test Jobs containers
mongodb.auth.enabledboolfalseToggle whether to enable MongoDB authentication
mongodb.containerSecurityContextobject{}Security Context for MongoDB container
mongodb.enabledbooltrueToggle whether to install MongoDB
mongodb.fullnameOverridestring"testkube-mongodb"MongoDB fullname override
mongodb.image.pullSecretslist[]MongoDB image pull Secret
mongodb.image.registrystring"docker.io"MongoDB image registry
mongodb.image.repositorystring"zcube/bitnami-compat-mongodb"MongoDB image repository
mongodb.image.tagstring"6.0.5-debian-11-r64"MongoDB image tag
mongodb.livenessProbe.enabledbooltrue
mongodb.livenessProbe.failureThresholdint6
mongodb.livenessProbe.initialDelaySecondsint30
mongodb.livenessProbe.periodSecondsint240
mongodb.livenessProbe.successThresholdint1
mongodb.livenessProbe.timeoutSecondsint10
mongodb.podSecurityContextobject{}MongoDB Pod Security Context
mongodb.readinessProbeobject{"enabled":true,"failureThreshold":6,"initialDelaySeconds":5,"periodSeconds":240,"successThreshold":1,"timeoutSeconds":5}Settings for readiness and liveness probes
mongodb.resourcesobject{"requests":{"cpu":"150m","memory":"100Mi"}}MongoDB resource settings
mongodb.serviceobject{"clusterIP":"","nodePort":true,"port":"27017","portName":"mongodb"}MongoDB service settings
nats.config.jetstream.enabledbooltrueToggle whether to enable JetStream (should not be disabled as Testkube uses Jetstream features)
nats.config.merge.max_payloadstring"<< 8MB >>"
nats.natsBoxobject{"enabled":false}Uncomment to override the NATS Server image options container: image: repository: nats tag: 2.11.6-alpine pullPolicy: registry: NATS Box container settings TODO remove this container after tests on dev and stage nats-box is A lightweight container with NATS utilities. It's not needed for nats server change it to natsBox: enabled: false
nats.reloader.enabledbooltrue
postgresql.architecturestring"standalone"PostgreSQL architecture
postgresql.auth.enabledPostgresUserbooltrueEnable "postgres" admin user for PostgreSQL
postgresql.auth.databasestringbackendName for a custom database to create in PostgreSQL
postgresql.auth.passwordstringpostgres5432Password for the custom user to create in PostgreSQL
postgresql.auth.postgresPasswordstringpostgres1234Password for the "postgres" admin user in PostgreSQL
postgresql.fullnameOverridestring"testkube-postgresql"PostgreSQL fullname override
postgresql.enabledboolfalseToggle whether to install PostgreSQL
postgresql.global.security.allowInsecureImagesbooltrueAllows skipping image verification for PostgreSQL
postgresql.image.pullSecretslist[]PostgreSQL image pull Secret
postgresql.image.registrystring"docker.io"PostgreSQL image registry
postgresql.image.repositorystring"zcube/bitnami-compat-postgresql"PostgreSQL image repository
postgresql.image.tagstring"15.2.0-debian-11-r64"PostgreSQL image tag
postgresql.primary.configurationstring""Configuration for PostgreSQL
postgresql.primary.containerSecurityContextobject{}Security Context for PostgreSQL container
postgresql.primary.extraVolumeslist[{"name": "postgresql-run", "emptyDir": {}}]PostgreSQL extra volumes for writable directories
postgresql.primary.extraVolumeMountslist[{"name": "postgresql-run", "mountPath": "/var/run/postgresql"}]PostgreSQL extra volume mounts for writable directories
postgresql.primary.livenessProbe.enabledbooltrueSettings for liveness probes
postgresql.primary.livenessProbe.failureThresholdint6
postgresql.primary.livenessProbe.initialDelaySecondsint30
postgresql.primary.livenessProbe.periodSecondsint10
postgresql.primary.livenessProbe.timeoutSecondsint5
postgresql.primary.readinessProbe.enabledbooltrueSettings for readiness probes
postgresql.primary.readinessProbe.failureThresholdint6
postgresql.primary.readinessProbe.initialDelaySecondsint5
postgresql.primary.readinessProbe.periodSecondsint10
postgresql.primary.readinessProbe.timeoutSecondsint5
postgresql.primary.readinessProbe.successThresholdint6
postgresql.primary.resourcesobject{"requests":{"cpu":"150m","memory":"100Mi"}}PostgreSQL resource settings
postgresql.primary.persistence.enabledbooltrueEnable persistence for PostgreSQL
postgresql.primary.persistence.sizestring1GiSize for PostgreSQL volume
postgresql.primary.persistence.storageClassstring""Storage Class for PostgreSQL
postgresql.primary.podSecurityContextobject{}PostgreSQL Pod Security Context
postgresql.primary.serviceobject{"clusterIP":"","ports":{"postgresql": 5432},"type":"NodePort"}PostgreSQL service settings
preUpgradeHookobject{"annotations":{},"enabled":true,"image":{"pullPolicy":"IfNotPresent","pullSecrets":[],"registry":"docker.io","repository":"bitnami/kubectl","tag":"1.28.2"},"labels":{},"name":"mongodb-upgrade","nodeSelector":{},"podAnnotations":{},"podSecurityContext":{},"resources":{},"securityContext":{},"serviceAccount":{"create":true},"tolerations":[],"ttlSecondsAfterFinished":100}MongoDB pre-upgrade parameters
preUpgradeHo

Deploy testkube with OpenTenant

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