Skip to content

Commit

Permalink
feat: add option to install CRDs without the operator
Browse files Browse the repository at this point in the history
  • Loading branch information
rangoo94 committed Feb 4, 2025
1 parent 90505f6 commit fe40dfd
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 11 deletions.
3 changes: 2 additions & 1 deletion charts/testkube-operator/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

{{- if .Values.enabled }}
---
apiVersion: v1
data:
Expand All @@ -18,3 +18,4 @@ kind: ConfigMap
metadata:
name: testkube-operator-manager-config
namespace: {{ include "testkube-operator.namespace" . }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/testkube-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.enabled }}
apiVersion: {{ include "global.capabilities.deployment.apiVersion" . }}
kind: Deployment
metadata:
Expand Down Expand Up @@ -143,3 +144,4 @@ spec:
nodeSelector:
{{- toYaml .Values.global.nodeSelector | nindent 8 }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions charts/testkube-operator/templates/role.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if .Values.rbac.create }}
{{ if and .Values.enabled .Values.rbac.create }}
---

apiVersion: {{ include "global.capabilities.rbac.apiVersion" . }}
Expand Down Expand Up @@ -493,7 +493,7 @@ rules:
- watch
- deletecollection

{{- if and .Values.webhook.enabled .Values.webhook.patch.enabled }}
{{- if and .Values.enabled (and .Values.webhook.enabled .Values.webhook.patch.enabled) }}
---
apiVersion: {{ include "global.capabilities.rbac.apiVersion" . }}
kind: ClusterRole
Expand Down
4 changes: 2 additions & 2 deletions charts/testkube-operator/templates/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if .Values.rbac.create }}
{{ if and .Values.enabled .Values.rbac.create }}
---

apiVersion: {{ include "global.capabilities.rbac.apiVersion" . }}
Expand Down Expand Up @@ -114,7 +114,7 @@ subjects:
name: {{ include "testkube-operator.serviceAccountName" . }}
namespace: {{ include "testkube-operator.namespace" . }}

{{- if and .Values.webhook.enabled .Values.webhook.patch.enabled }}
{{- if and .Values.enabled (and .Values.webhook.enabled .Values.webhook.patch.enabled) }}
---
apiVersion: {{ include "global.capabilities.rbac.apiVersion" . }}
kind: ClusterRoleBinding
Expand Down
2 changes: 2 additions & 0 deletions charts/testkube-operator/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.enabled }}
apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -43,3 +44,4 @@ spec:
targetPort: 9443
selector:
control-plane: controller-manager
{{- end }}
4 changes: 2 additions & 2 deletions charts/testkube-operator/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.serviceAccount.create -}}
{{- if and .Values.enabled .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
Expand All @@ -18,7 +18,7 @@ metadata:
{{- end }}
{{- end }}

{{- if and .Values.webhook.enabled .Values.webhook.patch.enabled }}
{{- if and .Values.enabled (and .Values.webhook.enabled .Values.webhook.patch.enabled) }}
---
apiVersion: v1
kind: ServiceAccount
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.testConnection.enabled }}
{{- if and .Values.enabled .Values.testConnection.enabled }}
apiVersion: v1
kind: Pod
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.webhook.enabled .Values.webhook.patch.enabled }}
{{- if and .Values.enabled (and .Values.webhook.enabled .Values.webhook.patch.enabled) }}
apiVersion: batch/v1
kind: Job
metadata:
Expand Down
2 changes: 1 addition & 1 deletion charts/testkube-operator/templates/webhook-cert-patch.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.webhook.enabled .Values.webhook.patch.enabled }}
{{- if and .Values.enabled (and .Values.webhook.enabled .Values.webhook.patch.enabled) }}
apiVersion: batch/v1
kind: Job
metadata:
Expand Down
2 changes: 1 addition & 1 deletion charts/testkube-operator/templates/webhook.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.webhook.enabled }}
{{- if and .Values.enabled .Values.webhook.enabled }}
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
Expand Down
3 changes: 3 additions & 0 deletions charts/testkube-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ global:
## Kubernetes version (using Helm capabilities if not set)
kubeVersion: ""

## Should install the Operator
enabled: true

## Should we install CRDS - when they can be installed from other Testkube instance
installCRD: true

Expand Down

0 comments on commit fe40dfd

Please sign in to comment.