Allow namespace configuration for different CRD resources in Fission (#2539)

* Allow multiple namespaces for builder manager
* Enable multiple namespaces for executor informers
* Added missing context
* helm chart support for multiple namespaces
* Directly consume map type from GetInformerForNamespaces fn
* Optimize function resolver by choosing namespace-specific informer
* helm chart support for multiple namespaces
* consider default namespace and move duplicate code to helm template
* Improve documentation for fission namespace values

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Co-authored-by: shubham bansal <shubhambansaliimtgn@gmail.com>
This commit is contained in:
Sanket Sudake
2022-10-19 15:48:47 +05:30
committed by GitHub
co-authored by shubham bansal
parent facd14de90
commit 827baea974
27 changed files with 430 additions and 219 deletions
@@ -71,3 +71,12 @@ This template generates the image name for the deployment depending on the value
- name: OTEL_PROPAGATORS
value: "{{ .Values.openTelemetry.propagators }}"
{{- end }}
{{- define "fission-resource-namespace.envs" }}
- name: FISSION_RESOURCE_NAMESPACES
{{- if not .Values.singleDefaultNamespace }}
value: "{{ .Values.defaultNamespace }},{{ join "," .Values.additionalFissionNamespaces }}"
{{- else }}
value: {{ .Values.defaultNamespace }}
{{- end }}
{{- end }}
@@ -55,6 +55,7 @@ spec:
value: {{ .Values.pprof.enabled | quote }}
- name: HELM_RELEASE_NAME
value: {{ .Release.Name | quote }}
{{- include "fission-resource-namespace.envs" . | indent 8 }}
{{- include "opentelemtry.envs" . | indent 8 }}
ports:
- containerPort: 8080
@@ -38,6 +38,7 @@ spec:
value: {{ .Values.debugEnv | quote }}
- name: PPROF_ENABLED
value: {{ .Values.pprof.enabled | quote }}
{{- include "fission-resource-namespace.envs" . | indent 8 }}
- name: POD_NAMESPACE
valueFrom:
fieldRef:
@@ -71,6 +71,7 @@ spec:
- name: CONTAINER_OBJECT_REAPER_INTERVAL
value: {{ .Values.executor.container.objectReaperInterval | quote }}
{{- end}}
{{- include "fission-resource-namespace.envs" . | indent 8 }}
- name: HELM_RELEASE_NAME
value: {{ .Release.Name | quote }}
{{- include "opentelemtry.envs" . | indent 8 }}
@@ -29,6 +29,7 @@ spec:
value: {{ .Values.debugEnv | quote }}
- name: PPROF_ENABLED
value: {{ .Values.pprof.enabled | quote }}
{{- include "fission-resource-namespace.envs" . | indent 8 }}
{{- include "opentelemtry.envs" . | indent 8 }}
resources:
{{- toYaml .Values.kubewatcher.resources | nindent 10 }}
@@ -47,6 +47,7 @@ spec:
value: {{ .Values.debugEnv | quote }}
- name: PPROF_ENABLED
value: {{ .Values.pprof.enabled | quote }}
{{- include "fission-resource-namespace.envs" . | indent 8 }}
{{- include "opentelemtry.envs" . | indent 8 }}
# TLS authentication is TLS with authentication (2 way)
# More info: https://docs.confluent.io/current/kafka/authentication_ssl.html#ssl-overview
@@ -46,6 +46,7 @@ spec:
value: "{{ .Values.mqt_keda.connector_images.gcp_pubsub.image }}:{{ .Values.mqt_keda.connector_images.gcp_pubsub.tag }}"
- name: REDIS_IMAGE
value: "{{ .Values.mqt_keda.connector_images.redis.image }}:{{ .Values.mqt_keda.connector_images.redis.tag }}"
{{- include "fission-resource-namespace.envs" . | indent 8 }}
{{- include "opentelemtry.envs" . | indent 8 }}
resources:
{{- toYaml .Values.mqt_keda.resources | nindent 10 }}
@@ -83,6 +83,7 @@ spec:
value: {{ .Values.pprof.enabled | quote }}
- name: DISPLAY_ACCESS_LOG
value: {{ .Values.router.displayAccessLog | default false | quote }}
{{- include "fission-resource-namespace.envs" . | indent 8 }}
{{- include "opentelemtry.envs" . | indent 8 }}
resources:
{{- toYaml .Values.router.resources | nindent 10 }}
@@ -60,6 +60,7 @@ spec:
- name: STORAGE_S3_REGION
value: {{ .Values.persistence.s3.region }}
{{- end }}
{{- include "fission-resource-namespace.envs" . | indent 8 }}
{{- include "opentelemtry.envs" . | indent 8 }}
resources:
{{- toYaml .Values.storagesvc.resources | nindent 10 }}
@@ -29,6 +29,7 @@ spec:
value: {{ .Values.debugEnv | quote }}
- name: PPROF_ENABLED
value: {{ .Values.pprof.enabled | quote }}
{{- include "fission-resource-namespace.envs" . | indent 8 }}
{{- include "opentelemtry.envs" . | indent 8 }}
resources:
{{- toYaml .Values.timer.resources | nindent 10 }}
+23 -7
View File
@@ -71,10 +71,26 @@ functionNamespace: fission-function
##
builderNamespace: fission-builder
## defaultNamespace represents the default namespace in Kubernetes.
## defaultNamespace represents the namespace in which Fission custom resources will be created by the Fission user.
## This is different from the release namespace.
## Please consider setting `singleDefaultNamespace` and `additionalFissionNamespaces` if you want
## more than one namespace to be used for Fission custom resources.
## Fission will watch the defaultNamespace only if `singleDefaultNamespace` is true.
##
defaultNamespace: default
## If true, fission will only watch for fission custom resources created in the `defaultNamespace` above.
##
singleDefaultNamespace: true
## Fission will watch the following namespaces along with the `defaultNamespace` for fission custom resources.
## Only works if `singleDefaultNamespace` is false.
## additionalFissionNamespaces:
## - namespace1
## - namespace2
## - namespace3
additionalFissionNamespaces: []
## createNamespace decides to create namespaces by the chart.
## If set to true, functionNamespace and builderNamespace namespaces mentioned above will be created by the chart.
## Set to false if you want to create the namespaces manually.
@@ -251,7 +267,7 @@ router:
maxRetries: 10
## Extend the container specs for the core fission pods.
## Can be used to add things like affinty/tolerations/nodeSelectors/etc.
## Can be used to add things like affinity/tolerations/nodeSelectors/etc.
## For example:
## extraCoreComponentPodConfig:
## affinity:
@@ -479,8 +495,8 @@ serviceMonitor:
##namespace in which you want to deploy servicemonitor
##
namespace: ""
## Map of additional lables to add to the ServiceMonitor resources
# to allow selecting sepcific ServiceMonitors
## Map of additional labels to add to the ServiceMonitor resources
# to allow selecting specific ServiceMonitors
# in case of multiple prometheus deployments
additionalServiceMonitorLabels: {}
# release: "monitoring"
@@ -493,8 +509,8 @@ podMonitor:
##namespace in which you want to deploy podmonitor
##
namespace: ""
## Map of additional lables to add to the PodMonitor resources
# to allow selecting sepcific PodMonitor
## Map of additional labels to add to the PodMonitor resources
# to allow selecting specific PodMonitor
# in case of multiple prometheus deployments
additionalPodMonitorLabels: {}
# release: "monitoring"
@@ -542,7 +558,7 @@ persistence:
size: 8Gi
## Extend the container specs for the core fission pods.
## Can be used to add things like affinty/tolerations/nodeSelectors/etc.
## Can be used to add things like affinity/tolerations/nodeSelectors/etc.
## For example:
## extraCoreComponentPodConfig:
## affinity: