Skip to content

Commit e48423b

Browse files
authored
feat: add option to install CRDs without the operator (#989)
1 parent 0e33566 commit e48423b

11 files changed

+19
-11
lines changed

charts/testkube-operator/templates/configmap.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
{{- if .Values.enabled }}
22
---
33
apiVersion: v1
44
data:
@@ -18,3 +18,4 @@ kind: ConfigMap
1818
metadata:
1919
name: testkube-operator-manager-config
2020
namespace: {{ include "testkube-operator.namespace" . }}
21+
{{- end }}

charts/testkube-operator/templates/deployment.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.enabled }}
12
apiVersion: {{ include "global.capabilities.deployment.apiVersion" . }}
23
kind: Deployment
34
metadata:
@@ -143,3 +144,4 @@ spec:
143144
nodeSelector:
144145
{{- toYaml .Values.global.nodeSelector | nindent 8 }}
145146
{{- end }}
147+
{{- end }}

charts/testkube-operator/templates/role.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ if .Values.rbac.create }}
1+
{{ if and .Values.enabled .Values.rbac.create }}
22
---
33

44
apiVersion: {{ include "global.capabilities.rbac.apiVersion" . }}
@@ -493,7 +493,7 @@ rules:
493493
- watch
494494
- deletecollection
495495

496-
{{- if and .Values.webhook.enabled .Values.webhook.patch.enabled }}
496+
{{- if and .Values.enabled (and .Values.webhook.enabled .Values.webhook.patch.enabled) }}
497497
---
498498
apiVersion: {{ include "global.capabilities.rbac.apiVersion" . }}
499499
kind: ClusterRole

charts/testkube-operator/templates/rolebinding.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ if .Values.rbac.create }}
1+
{{ if and .Values.enabled .Values.rbac.create }}
22
---
33

44
apiVersion: {{ include "global.capabilities.rbac.apiVersion" . }}
@@ -114,7 +114,7 @@ subjects:
114114
name: {{ include "testkube-operator.serviceAccountName" . }}
115115
namespace: {{ include "testkube-operator.namespace" . }}
116116

117-
{{- if and .Values.webhook.enabled .Values.webhook.patch.enabled }}
117+
{{- if and .Values.enabled (and .Values.webhook.enabled .Values.webhook.patch.enabled) }}
118118
---
119119
apiVersion: {{ include "global.capabilities.rbac.apiVersion" . }}
120120
kind: ClusterRoleBinding

charts/testkube-operator/templates/service.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.enabled }}
12
apiVersion: v1
23
kind: Service
34
metadata:
@@ -43,3 +44,4 @@ spec:
4344
targetPort: 9443
4445
selector:
4546
control-plane: controller-manager
47+
{{- end }}

charts/testkube-operator/templates/serviceaccount.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .Values.serviceAccount.create -}}
1+
{{- if and .Values.enabled .Values.serviceAccount.create -}}
22
apiVersion: v1
33
kind: ServiceAccount
44
metadata:
@@ -18,7 +18,7 @@ metadata:
1818
{{- end }}
1919
{{- end }}
2020

21-
{{- if and .Values.webhook.enabled .Values.webhook.patch.enabled }}
21+
{{- if and .Values.enabled (and .Values.webhook.enabled .Values.webhook.patch.enabled) }}
2222
---
2323
apiVersion: v1
2424
kind: ServiceAccount

charts/testkube-operator/templates/tests/test-connection.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .Values.testConnection.enabled }}
1+
{{- if and .Values.enabled .Values.testConnection.enabled }}
22
apiVersion: v1
33
kind: Pod
44
metadata:

charts/testkube-operator/templates/webhook-cert-create.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and .Values.webhook.enabled .Values.webhook.patch.enabled }}
1+
{{- if and .Values.enabled (and .Values.webhook.enabled .Values.webhook.patch.enabled) }}
22
apiVersion: batch/v1
33
kind: Job
44
metadata:

charts/testkube-operator/templates/webhook-cert-patch.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and .Values.webhook.enabled .Values.webhook.patch.enabled }}
1+
{{- if and .Values.enabled (and .Values.webhook.enabled .Values.webhook.patch.enabled) }}
22
apiVersion: batch/v1
33
kind: Job
44
metadata:

charts/testkube-operator/templates/webhook.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .Values.webhook.enabled }}
1+
{{- if and .Values.enabled .Values.webhook.enabled }}
22
apiVersion: admissionregistration.k8s.io/v1
33
kind: ValidatingWebhookConfiguration
44
metadata:

charts/testkube-operator/values.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ global:
2525
## Kubernetes version (using Helm capabilities if not set)
2626
kubeVersion: ""
2727

28+
## Should install the Operator
29+
enabled: true
30+
2831
## Should we install CRDS - when they can be installed from other Testkube instance
2932
installCRD: true
3033

0 commit comments

Comments
 (0)