Skip to content

Commit

Permalink
Add Controller enable/disable flag in Helm Charts (#2620)
Browse files Browse the repository at this point in the history
* add controller enablement flag
* throw error if service not found
  • Loading branch information
neha-Gupta1 committed Nov 15, 2022
1 parent 3b2a86a commit d2f201b
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions charts/fission-all/templates/controller/clusterrole.yaml
@@ -1,3 +1,4 @@
{{- if or (.Values.controller.enabled) (.Values.influxdb.enabled) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -39,3 +40,4 @@ rules:
- get
- list
- watch
{{- end -}}
@@ -1,3 +1,4 @@
{{- if or (.Values.controller.enabled) (.Values.influxdb.enabled) }}
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand All @@ -10,3 +11,4 @@ roleRef:
kind: ClusterRole
name: {{ .Release.Name }}-controller
apiGroup: rbac.authorization.k8s.io
{{- end -}}
4 changes: 3 additions & 1 deletion charts/fission-all/templates/controller/deployment.yaml
@@ -1,3 +1,4 @@
{{- if or (.Values.controller.enabled) (.Values.influxdb.enabled) }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -93,4 +94,5 @@ spec:
{{- end }}
{{- if .Values.extraCoreComponentPodConfig }}
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
{{- end }}
{{- end }}
{{- end -}}
2 changes: 2 additions & 0 deletions charts/fission-all/templates/controller/role-fission-cr.yaml
@@ -1,7 +1,9 @@
{{- if or (.Values.controller.enabled) (.Values.influxdb.enabled) }}
{{- include "fission-role-generator" (merge (dict "namespace" .Values.defaultNamespace "component" "controller") .) }}

{{- if not .Values.singleDefaultNamespace }}
{{- range $namespace := $.Values.additionalFissionNamespaces }}
{{ include "fission-role-generator" (merge (dict "namespace" $namespace "component" "controller") $) }}
{{- end }}
{{- end }}
{{- end -}}
2 changes: 2 additions & 0 deletions charts/fission-all/templates/controller/serviceaccount.yaml
@@ -1,5 +1,7 @@
{{- if or (.Values.controller.enabled) (.Values.influxdb.enabled) }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: fission-controller
namespace: {{ .Release.Namespace }}
{{- end -}}
2 changes: 2 additions & 0 deletions charts/fission-all/templates/controller/servicemonitor.yaml
@@ -1,3 +1,4 @@
{{- if or (.Values.controller.enabled) (.Values.influxdb.enabled) }}
{{- if .Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
Expand All @@ -19,4 +20,5 @@ spec:
svc: controller
endpoints:
- targetPort: 8080
{{- end -}}
{{- end -}}
4 changes: 3 additions & 1 deletion charts/fission-all/templates/controller/svc.yaml
@@ -1,3 +1,4 @@
{{- if or (.Values.controller.enabled) (.Values.influxdb.enabled) }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -15,4 +16,5 @@ spec:
nodePort: {{ .Values.controllerPort }}
{{- end }}
selector:
svc: controller
svc: controller
{{- end -}}
1 change: 1 addition & 0 deletions charts/fission-all/values.yaml
Expand Up @@ -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.
##
controller:
enabled: false
## Pod resources as:
## resources:
## limits:
Expand Down
1 change: 1 addition & 0 deletions skaffold.yaml
Expand Up @@ -65,6 +65,7 @@ deploy:
kubewatcher.securityContext.enabled: true
webhook.securityContext.enabled: true
storagesvc.securityContext.enabled: true
controller.enabled: false
wait: true
flags:
install:
Expand Down

0 comments on commit d2f201b

Please sign in to comment.