testkube
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
| Repository | Name | Version |
|---|---|---|
| file://../testkube-api | testkube-api | 2.0.10 |
| file://../testkube-logs | testkube-logs | 0.2.0 |
| file://../testkube-operator | testkube-operator | 2.0.0 |
| https://charts.bitnami.com/bitnami | mongodb | 13.10.1 |
| https://nats-io.github.io/k8s/helm/charts/ | nats | 1.1.7 |
| https://charts.bitnami.com/bitnami | postgresql | 16.3.0 |
Values
| Key | Type | Default | Description |
|---|---|---|---|
| global | object | {"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.affinity | object | {} | Affinity rules to add to all deployed Pods |
| global.annotations | object | {} | Annotations to add to all deployed objects |
| global.features.logsV2 | bool | false | Toggle whether to enable V2 log support |
| global.features.whitelistedContainers | string | "init,logs,scraper" | Comma-separated array of containers which should get scraped for logs |
| global.imagePullSecrets | list | [] | Global Docker registry secret names as an array |
| global.imageRegistry | string | "" | Global Docker image registry |
| global.labels | object | {} | Labels to add to all deployed objects |
| global.nodeSelector | object | {} | Node labels to add to all deployed Pods |
| global.testWorkflows | object | {"createOfficialTemplates":true,"createServiceAccountTemplates":true,"globalTemplate":{"enabled":false,"name":"global-template","spec":{}}} | Test Workflows configuration |
| global.testWorkflows.createOfficialTemplates | bool | true | Create TestWorkflowTemplates with automatically configured execution |
| global.testWorkflows.createServiceAccountTemplates | bool | true | Create TestWorkflowTemplates to easily use the service account |
| global.testWorkflows.globalTemplate | object | {"enabled":false,"name":"global-template","spec":{}} | Global TestWorkflowTemplate that will be automatically included for all executions |
| global.testWorkflows.globalTemplate.enabled | bool | false | Is global template enabled |
| global.testWorkflows.globalTemplate.name | string | "global-template" | Name of the global template |
| global.testWorkflows.globalTemplate.external | bool | false | Is the global template sourced externally? (otherwise it's created from spec below) |
| global.testWorkflows.globalTemplate.spec | object | {} | Specification for the global template |
| global.tls.caCertPath | string | "" | Path to the PEM-encoded CA certificate file (needs to be mounted to the container previously) |
| global.tolerations | list | [{"effect":"NoSchedule","key":"kubernetes.io/arch","operator":"Equal","value":"arm64"}] | Tolerations to add to all deployed pods |
| global.volumes | object | {"additionalVolumeMounts":[],"additionalVolumes":[]} | Global volume settings (API & Test Jobs) |
| global.volumes.additionalVolumeMounts | list | [] | Additional volume mounts to be added to the Testkube API container and Test Jobs containers |
| global.volumes.additionalVolumes | list | [] | Additional volumes to be added to the Testkube API container and Test Jobs containers |
| mongodb.auth.enabled | bool | false | Toggle whether to enable MongoDB authentication |
| mongodb.containerSecurityContext | object | {} | Security Context for MongoDB container |
| mongodb.enabled | bool | true | Toggle whether to install MongoDB |
| mongodb.fullnameOverride | string | "testkube-mongodb" | MongoDB fullname override |
| mongodb.image.pullSecrets | list | [] | MongoDB image pull Secret |
| mongodb.image.registry | string | "docker.io" | MongoDB image registry |
| mongodb.image.repository | string | "zcube/bitnami-compat-mongodb" | MongoDB image repository |
| mongodb.image.tag | string | "6.0.5-debian-11-r64" | MongoDB image tag |
| mongodb.livenessProbe.enabled | bool | true | |
| mongodb.livenessProbe.failureThreshold | int | 6 | |
| mongodb.livenessProbe.initialDelaySeconds | int | 30 | |
| mongodb.livenessProbe.periodSeconds | int | 240 | |
| mongodb.livenessProbe.successThreshold | int | 1 | |
| mongodb.livenessProbe.timeoutSeconds | int | 10 | |
| mongodb.podSecurityContext | object | {} | MongoDB Pod Security Context |
| mongodb.readinessProbe | object | {"enabled":true,"failureThreshold":6,"initialDelaySeconds":5,"periodSeconds":240,"successThreshold":1,"timeoutSeconds":5} | Settings for readiness and liveness probes |
| mongodb.resources | object | {"requests":{"cpu":"150m","memory":"100Mi"}} | MongoDB resource settings |
| mongodb.service | object | {"clusterIP":"","nodePort":true,"port":"27017","portName":"mongodb"} | MongoDB service settings |
| nats.config.jetstream.enabled | bool | true | Toggle whether to enable JetStream (should not be disabled as Testkube uses Jetstream features) |
| nats.config.merge.max_payload | string | "<< 8MB >>" | |
| nats.natsBox | object | {"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.enabled | bool | true | |
| postgresql.architecture | string | "standalone" | PostgreSQL architecture |
| postgresql.auth.enabledPostgresUser | bool | true | Enable "postgres" admin user for PostgreSQL |
| postgresql.auth.database | string | backend | Name for a custom database to create in PostgreSQL |
| postgresql.auth.password | string | postgres5432 | Password for the custom user to create in PostgreSQL |
| postgresql.auth.postgresPassword | string | postgres1234 | Password for the "postgres" admin user in PostgreSQL |
| postgresql.fullnameOverride | string | "testkube-postgresql" | PostgreSQL fullname override |
| postgresql.enabled | bool | false | Toggle whether to install PostgreSQL |
| postgresql.global.security.allowInsecureImages | bool | true | Allows skipping image verification for PostgreSQL |
| postgresql.image.pullSecrets | list | [] | PostgreSQL image pull Secret |
| postgresql.image.registry | string | "docker.io" | PostgreSQL image registry |
| postgresql.image.repository | string | "zcube/bitnami-compat-postgresql" | PostgreSQL image repository |
| postgresql.image.tag | string | "15.2.0-debian-11-r64" | PostgreSQL image tag |
| postgresql.primary.configuration | string | "" | Configuration for PostgreSQL |
| postgresql.primary.containerSecurityContext | object | {} | Security Context for PostgreSQL container |
| postgresql.primary.extraVolumes | list | [{"name": "postgresql-run", "emptyDir": {}}] | PostgreSQL extra volumes for writable directories |
| postgresql.primary.extraVolumeMounts | list | [{"name": "postgresql-run", "mountPath": "/var/run/postgresql"}] | PostgreSQL extra volume mounts for writable directories |
| postgresql.primary.livenessProbe.enabled | bool | true | Settings for liveness probes |
| postgresql.primary.livenessProbe.failureThreshold | int | 6 | |
| postgresql.primary.livenessProbe.initialDelaySeconds | int | 30 | |
| postgresql.primary.livenessProbe.periodSeconds | int | 10 | |
| postgresql.primary.livenessProbe.timeoutSeconds | int | 5 | |
| postgresql.primary.readinessProbe.enabled | bool | true | Settings for readiness probes |
| postgresql.primary.readinessProbe.failureThreshold | int | 6 | |
| postgresql.primary.readinessProbe.initialDelaySeconds | int | 5 | |
| postgresql.primary.readinessProbe.periodSeconds | int | 10 | |
| postgresql.primary.readinessProbe.timeoutSeconds | int | 5 | |
| postgresql.primary.readinessProbe.successThreshold | int | 6 | |
| postgresql.primary.resources | object | {"requests":{"cpu":"150m","memory":"100Mi"}} | PostgreSQL resource settings |
| postgresql.primary.persistence.enabled | bool | true | Enable persistence for PostgreSQL |
| postgresql.primary.persistence.size | string | 1Gi | Size for PostgreSQL volume |
| postgresql.primary.persistence.storageClass | string | "" | Storage Class for PostgreSQL |
| postgresql.primary.podSecurityContext | object | {} | PostgreSQL Pod Security Context |
| postgresql.primary.service | object | {"clusterIP":"","ports":{"postgresql": 5432},"type":"NodePort"} | PostgreSQL service settings |
| preUpgradeHook | object | {"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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the charttestkube is pinned at v2.16.0 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