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: testkube: move pro context into global params #880

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
29 changes: 17 additions & 12 deletions charts/testkube-api/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -97,27 +97,32 @@ Define API image
Define API environment in agent mode
*/}}
{{- define "testkube-api.env-agent-mode" -}}
{{- if .Values.cloud.key -}}
{{- $proKey := .Values.global.pro.key | default .Values.cloud.key }}
{{- $proSecretKey := .Values.global.pro.existingSecret.key | default .Values.cloud.existingSecret.key }}
{{- $proSecretName := .Values.global.pro.existingSecret.name | default .Values.cloud.existingSecret.name }}
{{- if $proKey -}}
- name: TESTKUBE_PRO_API_KEY
value: "{{ .Values.cloud.key }}"
{{- else if .Values.cloud.existingSecret.key -}}
value: "{{ $proKey }}"
{{- else if $proSecretKey -}}
- name: TESTKUBE_PRO_API_KEY
valueFrom:
secretKeyRef:
key: {{ .Values.cloud.existingSecret.key }}
name: {{ .Values.cloud.existingSecret.name }}
key: {{ $proSecretKey }}
name: {{ $proSecretName }}
{{- end -}}
{{- if .Values.cloud.url }}
{{- $cloudUrl := .Values.global.pro.url | default .Values.cloud.url -}}
{{- if $cloudUrl }}
- name: TESTKUBE_CLOUD_URL
value: {{ tpl .Values.cloud.url $ | quote }}
value: {{ tpl $cloudUrl $ | quote }}
- name: TESTKUBE_PRO_URL
value: {{ tpl .Values.cloud.url $ | quote }}
value: {{ tpl $cloudUrl $ | quote }}
{{- end }}
{{- if .Values.cloud.uiUrl}}
{{- $cloudUiUrl := .Values.global.pro.uiUrl | default .Values.cloud.uiUrl -}}
{{- if $cloudUiUrl }}
- name: TESTKUBE_CLOUD_UI_URL
value: {{ tpl .Values.cloud.uiUrl $ | quote }}
value: {{ tpl $cloudUiUrl $ | quote }}
- name: TESTKUBE_PRO_UI_URL
value: {{ tpl .Values.cloud.uiUrl $ | quote }}
value: {{ tpl $cloudUiUrl $ | quote }}
{{- end}}
{{- if not .Values.cloud.tls.enabled }}
- name: TESTKUBE_PRO_TLS_INSECURE
Expand Down Expand Up @@ -158,7 +163,7 @@ Define API environment in agent mode
secretKeyRef:
key: {{ .Values.cloud.existingSecret.envId }}
name: {{ .Values.cloud.existingSecret.name }}
{{- end}}
{{- end }}
{{- if .Values.cloud.migrate }}
- name: TESTKUBE_PRO_MIGRATE
value: "{{ .Values.cloud.migrate }}"
Expand Down
25 changes: 22 additions & 3 deletions charts/testkube-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ global:
enabled: false
name: global-template
spec: {}
## Running Testkube in Agent mode
pro:
## Testkube Pro Agent API URL
url: "agent.testkube.io:443"
## Testkube Pro UI URL
uiUrl: ""
## Testkube Pro Agent key
key: ""
## Retrieve cloud information from existing secret
existingSecret:
## Name of the secret. If set, this will be used instead of the above values
name: ""
## Key for the License Key
key: ""

### @section Common parameters
## Kubernetes version (using Helm capabilities if not set)
Expand Down Expand Up @@ -103,15 +117,18 @@ configValues: ""
## Testkube API Deployment parameters
## Running Testkube in Agent mode
cloud:
## DEPRECATED: Use global.pro.url instead
## URL of the Cloud Saas Control Plane
url: "agent.testkube.io:443"
## DEPRECATED: Use global.pro.uiUrl instead
## URL of the Cloud UI
uiUrl: ""
## License Key
## DEPRECATED: Use global.pro.key instead
## Agent Token
key: ""
## Organization ID
## DEPRECATED: Organization ID is fetched dynamically
orgId: ""
## Environment ID
## DEPRECATED: Environment ID is fetched dynamically
envId: ""
## true if migration from OSS
migrate: ""
Expand All @@ -137,8 +154,10 @@ cloud:
name: ""
## Key for the License Key
key: ""
## DEPRECATED: Organization ID is fetched dynamically
## Key for the Organization ID
orgId: ""
## DEPRECATED: Environment ID is fetched dynamically
## Key for the Environment ID
envId: ""

Expand Down
27 changes: 16 additions & 11 deletions charts/testkube-logs/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,30 @@ spec:
env:
- name: DEBUG
value: "{{ .Values.debug }}"
{{- if .Values.pro.key }}
{{- $proKey := .Values.global.pro.key | default .Values.pro.key }}
{{- if $proKey }}
- name: TESTKUBE_PRO_API_KEY
value: "{{ .Values.pro.key }}"
{{- end}}
{{- if .Values.pro.existingSecret.key }}
value: "{{ $proKey }}"
{{- end }}
{{- $proSecretKey := .Values.global.pro.existingSecret.key | default .Values.pro.existingSecret.key }}
{{- $proSecretName := .Values.global.pro.existingSecret.name | default .Values.pro.existingSecret.name }}
{{- if $proSecretKey }}
- name: TESTKUBE_PRO_API_KEY
valueFrom:
secretKeyRef:
key: {{ .Values.pro.existingSecret.key }}
name: {{ .Values.pro.existingSecret.name }}
key: {{ $proSecretKey }}
name: {{ $proSecretName }}
{{- end}}
{{- if .Values.pro.url }}
{{- $proUrl := .Values.global.pro.url | default .Values.pro.url }}
{{- if $proUrl }}
- name: TESTKUBE_PRO_URL
value: "{{ .Values.pro.url }}"
value: "{{ $proUrl }}"
{{- end }}
{{- if .Values.pro.uiUrl}}
{{- $proUiUrl := .Values.global.pro.uiUrl | default .Values.pro.uiUrl }}
{{- if $proUiUrl }}
- name: TESTKUBE_PRO_UI_URL
value: "{{ .Values.pro.uiUrl }}"
{{- end}}
value: "{{ $proUiUrl }}"
{{- end }}
{{- if not .Values.pro.tls.enabled }}
- name: TESTKUBE_PRO_TLS_INSECURE
value: "true"
Expand Down
22 changes: 22 additions & 0 deletions charts/testkube-logs/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,37 @@ global:
affinity: {}
# -- Tolerations to add to all deployed pods
tolerations: []
# -- Running Testkube in Agent mode
pro:
# -- Testkube Pro Agent API URL
url: "agent.testkube.io:443"
# -- Testkube Pro UI URL
uiUrl: ""
# -- Testkube Pro Agent key
key: ""
## Retrieve cloud information from existing secret
existingSecret:
# -- Name of the secret. If set, this will be used instead of the above values
name: ""
# -- Agent Token
key: ""

debug: true

pro:
## DEPRECATED: Use global.pro.url instead
## URL of the Cloud Saas Control Plane
url: "logs.testkube.io:443"
## DEPRECATED: Use global.pro.uiUrl instead
## URL of the Cloud Saas UI
uiUrl: ""
## DEPRECATED: Use global.pro.key instead
## License Key
key: ""
## DEPRECATED: Organization ID is fetched dynamically
## Organization ID
orgId: ""
## DEPRECATED: Environment ID is fetched dynamically
## Environment ID
envId: ""
tls:
Expand All @@ -45,8 +65,10 @@ pro:
name: ""
## Key for the License Key
key: ""
## DEPRECATED: Organization ID is fetched dynamically
## Key for the Organization ID
orgId: ""
## DEPRECATED: Environment ID is fetched dynamically
## Key for the Environment ID
envId: ""

Expand Down
20 changes: 14 additions & 6 deletions charts/testkube/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ global:
# pod:
# imagePullSecrets:
# - name: regcred
# -- Running Testkube in Agent mode
pro:
# -- Testkube Pro Agent API URL
url: "agent.testkube.io:443"
# -- Testkube Pro UI URL
uiUrl: ""
# -- Testkube Pro Agent key
key: ""
## Retrieve cloud information from existing secret
existingSecret:
# -- Name of the secret. If set, this will be used instead of the above values
name: ""
# -- Key for the License Key
key: ""

# -- MongoDB pre-upgrade parameters
preUpgradeHook:
Expand Down Expand Up @@ -465,12 +479,6 @@ testkube-api:

# Testkube Agent settings
cloud:
# -- Testkube Cloud API URL
url: "agent.testkube.io:443"
## URL of the Cloud UI
uiUrl: ""
# -- Testkube Clouc License Key (for Environment)
key: ""
tls:
# -- Toggle should the connection to Agent API in Cloud/Enterprise use secure GRPC (GRPCS) (if false, it will use insecure GRPC)
enabled: true
Expand Down