Skip to content

Commit

Permalink
fix: labels in testkube-operator (#971)
Browse files Browse the repository at this point in the history
* fix: labels in testkube-operator; update NATS uri
  • Loading branch information
ypoplavs authored Jan 7, 2025
1 parent 8e1ee8a commit 67f0e63
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 30 deletions.
12 changes: 6 additions & 6 deletions charts/testkube-api/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,10 @@ Define API environment in agent mode
{{- end}}
- name: "NATS_EMBEDDED"
value: "{{ .Values.nats.embedded }}"
{{- if .Values.nats.enabled }}
- name: NATS_URI
{{- if .Values.nats.secretName }}
{{- if .Values.nats.uri }}
value: {{ .Values.nats.uri }}
{{- else if .Values.nats.secretName }}
valueFrom:
secretKeyRef:
name: {{ .Values.nats.secretName }}
Expand All @@ -185,7 +186,6 @@ Define API environment in agent mode
value: "{{ .Values.nats.tls.certSecret.baseMountPath }}/{{ .Values.nats.tls.certSecret.caFile }}"
{{- end }}
{{- end }}
{{- end }}
- name: "SCRAPPERENABLED"
value: "{{ .Values.storage.scrapperEnabled }}"
- name: "COMPRESSARTIFACTS"
Expand Down Expand Up @@ -265,9 +265,10 @@ Define API environment in standalone mode
value: "{{ .Values.mongodb.allowDiskUse }}"
- name: "NATS_EMBEDDED"
value: "{{ .Values.nats.embedded }}"
{{- if .Values.nats.enabled }}
- name: NATS_URI
{{- if .Values.nats.secretName }}
{{- if .Values.nats.uri }}
value: {{ .Values.nats.uri }}
{{- else if .Values.nats.secretName }}
valueFrom:
secretKeyRef:
name: {{ .Values.nats.secretName }}
Expand All @@ -287,7 +288,6 @@ Define API environment in standalone mode
value: "{{ .Values.nats.tls.certSecret.baseMountPath }}/{{ .Values.nats.tls.certSecret.caFile }}"
{{- end }}
{{- end }}
{{- end }}
- name: "STORAGE_ENDPOINT"
{{- if .Values.storage.endpoint }}
value: "{{ .Values.storage.endpoint }}"
Expand Down
2 changes: 2 additions & 0 deletions charts/testkube-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,8 @@ nats:
## load URI from secrets
# secretName: XXX
# secretKey: XXX
## load URI from plain-text
uri: "nats://testkube-nats:4222"

## MINIO parameters
minio:
Expand Down
11 changes: 0 additions & 11 deletions charts/testkube-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,6 @@ spec:
- name: APISERVER_REGISTRY
value: {{ .Values.global.imageRegistry }}
{{- end }}
{{- if .Values.nats.enabled }}
- name: NATS_URI
{{- if .Values.nats.secretName }}
valueFrom:
secretKeyRef:
name: {{ .Values.nats.secretName }}
key: {{ .Values.nats.secretKey }}
{{- else }}
value: "nats://{{ .Release.Name }}-nats"
{{- end }}
{{- end }}
{{- if .Values.purgeExecutions }}
- name: APISERVER_PURGE_EXECUTIONS
value: "true"
Expand Down
8 changes: 4 additions & 4 deletions charts/testkube-operator/templates/rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ kind: ClusterRoleBinding
metadata:
name: {{ .Release.Name }}-operator-manager-rolebinding
labels:
{{- if .Values.globalLabels }}
{{- include "global.tplvalues.render" ( dict "value" .Values.globalLabels "context" $ ) | nindent 4 }}
{{- if .Values.global.labels }}
{{- include "global.tplvalues.render" ( dict "value" .Values.global.labels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.global.annotations }}
annotations: {{- include "global.tplvalues.render" ( dict "value" .Values.global.annotations "context" $ ) | nindent 4 }}
Expand All @@ -29,8 +29,8 @@ kind: ClusterRoleBinding
metadata:
name: {{ .Release.Name }}-operator-proxy-rolebinding
labels:
{{- if .Values.globalLabels }}
{{- include "global.tplvalues.render" ( dict "value" .Values.globalLabels "context" $ ) | nindent 4 }}
{{- if .Values.global.labels }}
{{- include "global.tplvalues.render" ( dict "value" .Values.global.labels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.global.annotations }}
annotations: {{- include "global.tplvalues.render" ( dict "value" .Values.global.annotations "context" $ ) | nindent 4 }}
Expand Down
9 changes: 0 additions & 9 deletions charts/testkube-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,5 @@ testConnection:
## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set
affinity: {}

## NATS parameters
## ref: https://github.com/nats-io/nats-server
nats:
## Deploy NATS server to the cluster
enabled: true
## load URI from secrets
# secretName: XXX
# secretKey: XXX

## Pass a custom cronJobTemplate to the Testkube Operator Deployment
cronJobTemplate: ""
11 changes: 11 additions & 0 deletions charts/testkube/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,18 @@ testkube-api:
enabled: true
skipVerify: true
```
To use external NATS server, it's possible to configure:

```yaml
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)
Expand Down

0 comments on commit 67f0e63

Please sign in to comment.