Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add configuration for new Agents architecture #983

Merged
merged 6 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions charts/testkube-api/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ Define API environment in agent mode
{{- if .Values.cloud.key -}}
- name: TESTKUBE_PRO_API_KEY
value: "{{ .Values.cloud.key }}"
- name: TESTKUBE_PRO_AGENT_ID
value: "{{ .Values.cloud.agentId }}"
{{- else if .Values.cloud.existingSecret.key -}}
- name: TESTKUBE_PRO_API_KEY
valueFrom:
Expand Down
29 changes: 29 additions & 0 deletions charts/testkube-api/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,14 @@ spec:
- name: TESTKUBE_TW_INIT_IMAGE
value: "{{ include "testkube-tw-init.image" . }}"
{{- if .Values.global.testWorkflows.globalTemplate.enabled }}
{{- if .Values.global.testWorkflows.globalTemplate.inline }}
- name: TESTKUBE_GLOBAL_WORKFLOW_TEMPLATE_INLINE
value: {{ toJson .Values.global.testWorkflows.globalTemplate.spec | quote }}
{{- else }}
- name: TESTKUBE_GLOBAL_WORKFLOW_TEMPLATE_NAME
value: "{{ .Values.global.testWorkflows.globalTemplate.name }}"
{{- end }}
{{- end }}
- name: ENABLE_K8S_EVENTS
value: "{{ .Values.enableK8sEvents }}"
{{- if or .Values.cloud.key .Values.cloud.existingSecret.key }}
Expand All @@ -219,6 +224,30 @@ spec:
- name: TESTKUBE_DOCKER_IMAGE_VERSION
value: "{{ .Values.dockerImageVersion }}"
{{- end }}
{{- if .Values.next.enabled }}
- name: FEATURE_NEW_ARCHITECTURE
value: "true"
- name: FEATURE_CLOUD_STORAGE
value: "{{ .Values.next.cloudStorage }}"
- name: DISABLE_TEST_TRIGGERS
value: "{{ not .Values.next.testTriggers.enabled }}"
- name: DISABLE_WEBHOOKS
value: "{{ not .Values.next.webhooks.enabled }}"
- name: DISABLE_RUNNER
value: "{{ not .Values.next.runner.enabled }}"
- name: DISABLE_DEPRECATED_TESTS
value: "{{ not .Values.next.legacyTests.enabled }}"
- name: GITOPS_KUBERNETES_TO_CLOUD_ENABLED
value: "{{ .Values.next.gitops.syncKubernetesToCloud }}"
- name: GITOPS_CLOUD_TO_KUBERNETES_ENABLED
value: "{{ .Values.next.gitops.syncCloudToKubernetes }}"
- name: GITOPS_CLOUD_NAME_PATTERN
value: "{{ .Values.next.gitops.namePatterns.cloud }}"
- name: GITOPS_KUBERNETES_NAME_PATTERN
value: "{{ .Values.next.gitops.namePatterns.kubernetes }}"
- name: DISABLE_DEFAULT_AGENT
value: "{{ not .Values.next.legacyAgent.enabled }}"
{{- end }}
image: {{ include "testkube-api.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.global.testWorkflows.globalTemplate.enabled (not .Values.global.testWorkflows.globalTemplate.external) }}
{{- if and .Values.global.testWorkflows.globalTemplate.enabled (not (or .Values.global.testWorkflows.globalTemplate.external .Values.global.testWorkflows.globalTemplate.inline)) }}
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflowTemplate
metadata:
Expand Down
63 changes: 62 additions & 1 deletion charts/testkube-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ global:
globalTemplate:
enabled: false
external: false
inline: false
name: global-template
spec: {}

Expand Down Expand Up @@ -130,14 +131,74 @@ scraperContainerResources: {}
## Resource requests and limits for Main Container
containerResources: {}

## Enable the new architecture
next:
## Enable next architecture
enabled: true
## Enable storing resources in the Control Plane
cloudStorage: false

## Configure legacy agent connection.
# - tkcagnt_*** - Super Agent
legacyAgent:
enabled: true

## Configure webhooks in this installation.
# - tkcagnt_*** - Super Agent
webhooks:
## Should it emit the webhooks
enabled: true

## Configure test triggers in this installation.
# - tkcagnt_*** - Super Agent
testTriggers:
## Should it emit the test triggers
enabled: true

# Configure the Test Workflows runner in this installation.
# - tkcagnt_*** - Super Agent
# - tkcrun_*** - Runner Agent
runner:
## Should it be enabled
enabled: true

# Configure GitOps to synchronise the resources between Kubernetes cluster and Control Plane.
# - tkcagnt_*** - Super Agent
# - tkcsync_*** - GitOps Agent
gitops:
## Should it copy data from Control Plane to Kubernetes
syncCloudToKubernetes: false
## Should it copy data from Kubernetes to Control Plane
syncKubernetesToCloud: true
## Define the naming patterns for resources in different sources
namePatterns:
## Name pattern for resources in the Control Plane
cloud: "<name>"
## Name pattern for resources in the Kubernetes cluster
kubernetes: "<name>"

# Configure the legacy Tests and Test Suites execution
# - tkcagnt_*** - Super Agent
legacyTests:
## Should it be enabled
enabled: true

## Configure controlling API in this installation
# - tkcagnt_*** - Super Agent
api:
## Should it enable controller API
enabled: true

## Testkube API Deployment parameters
## Running Testkube in Agent mode
cloud:
## URL of the Cloud Saas Control Plane
url: "agent.testkube.io:443"
## URL of the Cloud UI
uiUrl: ""
## Agent Token
## Public Agent ID
agentId: ""
## Agent Token / Secret Key
key: ""
## Organization ID
orgId: ""
Expand Down
60 changes: 59 additions & 1 deletion charts/testkube/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ global:
name: global-template
# -- Is the global template sourced externally? (otherwise it's created from spec below)
external: false
# -- Should the global template sourced inline instead of CRD? (otherwise its resource is created from spec below)
inline: false
# -- Specification for the global template
spec: {}
# spec:
Expand Down Expand Up @@ -433,7 +435,9 @@ testkube-api:
url: "agent.testkube.io:443"
## URL of the Cloud UI
uiUrl: ""
# -- Agent Token
## Public Agent ID
agentId: ""
## Agent Token / Secret Key
key: ""
## -- Organization ID
orgId: ""
Expand Down Expand Up @@ -471,6 +475,60 @@ testkube-api:
# -- TTL for image pull secrets cache (set to 0 to disable)
ttl: 30m

## Enable the new architecture
next:
## Enable next architecture
enabled: true
## Enable storing resources in the Control Plane
cloudStorage: false

## Configure legacy agent connection.
# - tkcagnt_*** - Super Agent
legacyAgent:
enabled: true

## Configure webhooks in this installation.
# - tkcagnt_*** - Super Agent
webhooks:
## Should it emit the webhooks
enabled: true

## Configure test triggers in this installation.
# - tkcagnt_*** - Super Agent
testTriggers:
## Should it emit the test triggers
enabled: true

# Configure the Test Workflows runner in this installation.
# - tkcagnt_*** - Super Agent
# - tkcrun_*** - Runner Agent
runner:
## Should it be enabled
enabled: true

# Configure GitOps to synchronise the resources between Kubernetes cluster and Control Plane.
# - tkcagnt_*** - Super Agent
# - tkcsync_*** - GitOps Agent
gitops:
## Should it be enabled
enabled: true
## Should it copy data from Control Plane to Kubernetes
syncCloudToKubernetes: false
## Should it copy data from Kubernetes to Control Plane
syncKubernetesToCloud: true
## Define the naming patterns for resources in different sources
namePatterns:
## Name pattern for resources in the Control Plane
cloud: "<name>"
## Name pattern for resources in the Kubernetes cluster
kubernetes: "<name>"

# Configure the legacy Tests and Test Suites execution
# - tkcagnt_*** - Super Agent
legacyTests:
## Should it be enabled
enabled: true

# ref: https://cloud.google.com/kubernetes-engine/docs/how-to/prepare-arm-workloads-for-deployment#node-affinity-multi-arch-arm
# -- Tolerations to schedule a workload to nodes with any architecture type. Required for deployment to GKE cluster.
tolerations: []
Expand Down
Loading