Add Controller enable/disable flag in Helm Charts (#2620)

* add controller enablement flag
* throw error if service not found
This commit is contained in:
neha_gupta
2022-11-15 17:56:08 +05:30
committed by GitHub
parent 3b2a86a8c9
commit d2f201b721
10 changed files with 18 additions and 2 deletions
@@ -1,3 +1,4 @@
{{- if or (.Values.controller.enabled) (.Values.influxdb.enabled) }}
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole kind: ClusterRole
metadata: metadata:
@@ -39,3 +40,4 @@ rules:
- get - get
- list - list
- watch - watch
{{- end -}}
@@ -1,3 +1,4 @@
{{- if or (.Values.controller.enabled) (.Values.influxdb.enabled) }}
kind: ClusterRoleBinding kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
metadata: metadata:
@@ -10,3 +11,4 @@ roleRef:
kind: ClusterRole kind: ClusterRole
name: {{ .Release.Name }}-controller name: {{ .Release.Name }}-controller
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
{{- end -}}
@@ -1,3 +1,4 @@
{{- if or (.Values.controller.enabled) (.Values.influxdb.enabled) }}
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
@@ -93,4 +94,5 @@ spec:
{{- end }} {{- end }}
{{- if .Values.extraCoreComponentPodConfig }} {{- if .Values.extraCoreComponentPodConfig }}
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} {{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
{{- end }} {{- end }}
{{- end -}}
@@ -1,3 +1,4 @@
{{- if or (.Values.controller.enabled) (.Values.influxdb.enabled) }}
{{- include "fission-role-generator" (merge (dict "namespace" .Values.defaultNamespace "component" "controller") .) }} {{- include "fission-role-generator" (merge (dict "namespace" .Values.defaultNamespace "component" "controller") .) }}
{{- if not .Values.singleDefaultNamespace }} {{- if not .Values.singleDefaultNamespace }}
@@ -5,3 +6,4 @@
{{ include "fission-role-generator" (merge (dict "namespace" $namespace "component" "controller") $) }} {{ include "fission-role-generator" (merge (dict "namespace" $namespace "component" "controller") $) }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end -}}
@@ -1,5 +1,7 @@
{{- if or (.Values.controller.enabled) (.Values.influxdb.enabled) }}
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
name: fission-controller name: fission-controller
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
{{- end -}}
@@ -1,3 +1,4 @@
{{- if or (.Values.controller.enabled) (.Values.influxdb.enabled) }}
{{- if .Values.serviceMonitor.enabled }} {{- if .Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor kind: ServiceMonitor
@@ -19,4 +20,5 @@ spec:
svc: controller svc: controller
endpoints: endpoints:
- targetPort: 8080 - targetPort: 8080
{{- end -}}
{{- end -}} {{- end -}}
@@ -1,3 +1,4 @@
{{- if or (.Values.controller.enabled) (.Values.influxdb.enabled) }}
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
@@ -15,4 +16,5 @@ spec:
nodePort: {{ .Values.controllerPort }} nodePort: {{ .Values.controllerPort }}
{{- end }} {{- end }}
selector: selector:
svc: controller svc: controller
{{- end -}}
+1
View File
@@ -338,6 +338,7 @@ buildermgr:
## It contains CRUD APIs for functions, triggers, environments, Kubernetes event watches, etc. and proxy APIs to internal 3rd-party services. ## It contains CRUD APIs for functions, triggers, environments, Kubernetes event watches, etc. and proxy APIs to internal 3rd-party services.
## ##
controller: controller:
enabled: false
## Pod resources as: ## Pod resources as:
## resources: ## resources:
## limits: ## limits:
+1
View File
@@ -65,6 +65,7 @@ deploy:
kubewatcher.securityContext.enabled: true kubewatcher.securityContext.enabled: true
webhook.securityContext.enabled: true webhook.securityContext.enabled: true
storagesvc.securityContext.enabled: true storagesvc.securityContext.enabled: true
controller.enabled: false
wait: true wait: true
flags: flags:
install: install: