Repository: fission/fission (language: go)

Issue:
Allow specifying different extraCoreComponentPodConfig unique for router
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Helm users should be able to specify a separate set of extraCoreComponentPodConfig for the router. The use case is that if the router is running in daemonset mode, it may need different nodeSelectors and tolerations than everything else

for example users may want to run the core components on a dedicated set of hardware (specific node selectors and tolerations), but the router should run as a daemonset on all nodes (tolerate everything, no node selector)

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

expose another extraCoreComponentPodConfig that is specific to `router`

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.



Discussion / hints:

Fix patch:
diff --git a/charts/README.md b/charts/README.md
index 92ec3d3e43..ac30565aab 100644
--- a/charts/README.md
+++ b/charts/README.md
@@ -68,6 +68,7 @@ Parameter | Description | Default
 `extraCoreComponentPodConfig` | Extend the container specs for the core fission pods. Can be used to add things like affinty/tolerations/nodeSelectors/etc. | None
 `executor.adoptExistingResources` | If true, executor will try to adopt existing resources created by the old executor instance. | `false`
 `router.deployAsDaemonSet` | Deploy router as DaemonSet instead of Deployment | `false`
+`router.extraCoreComponentPodConfig` | Extend the container specs for the router fission pods. Can be used to add things like affinty/tolerations/nodeSelectors/etc. Overrides the generic `extraCoreComponentPodConfig`| None
 `router.svcAddressMaxRetries` | Max retries times for router to retry on a certain service URL returns from cache/executor | `5`
 `router.svcAddressUpdateTimeout` | The length of update lock expiry time for router to get a service URL returns from executor | `30`
 `router.svcAnnotations` | Annotations for router service | None
diff --git a/charts/fission-all/templates/router.yaml b/charts/fission-all/templates/router.yaml
index d598e27f17..e9f662bf0f 100644
--- a/charts/fission-all/templates/router.yaml
+++ b/charts/fission-all/templates/router.yaml
@@ -84,6 +84,10 @@ spec:
         - containerPort: 8888
           name: http
       serviceAccountName: fission-svc
+{{- if .Values.router.extraCoreComponentPodConfig }}
+{{ toYaml .Values.router.extraCoreComponentPodConfig | indent 6 -}}
+{{- else }}
 {{- if .Values.extraCoreComponentPodConfig }}
 {{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
 {{- end }}
+{{- end }}
diff --git a/charts/fission-all/values.yaml b/charts/fission-all/values.yaml
index 6611daff6c..fa8f01a92a 100644
--- a/charts/fission-all/values.yaml
+++ b/charts/fission-all/values.yaml
@@ -140,6 +140,24 @@ router:
 
   ## Sample with a rate per time window (traces/second)
   traceSamplingRate: 0.5
+  
+  ## Extend the container specs for the core fission pods.
+  ## Can be used to add things like affinty/tolerations/nodeSelectors/etc.
+  ## For example:
+  ## extraCoreComponentPodConfig:
+  ##   affinity:
+  ##     nodeAffinity:
+  ##       requiredDuringSchedulingIgnoredDuringExecution:
+  ##         nodeSelectorTerms:
+  ##           - matchExpressions:
+  ##             - key: capability
+  ##               operator: In
+  ##               values:
+  ##                 - app
+  #extraCoreComponentPodConfig:
+  #  affinity:
+  #  tolerations:
+  #  nodeSelector:
 
 ## Message queue trigger config
 ### NATS Streaming, enabled by default
@@ -334,4 +352,4 @@ mqt_keda:
       tag: v0.5
     nats_steaming:
       image: fission/keda-nats-streaming-http-connector
-      tag: v0.5
\ No newline at end of file
+      tag: v0.5
diff --git a/charts/fission-core/templates/router.yaml b/charts/fission-core/templates/router.yaml
index d598e27f17..e9f662bf0f 100644
--- a/charts/fission-core/templates/router.yaml
+++ b/charts/fission-core/templates/router.yaml
@@ -84,6 +84,10 @@ spec:
         - containerPort: 8888
           name: http
       serviceAccountName: fission-svc
+{{- if .Values.router.extraCoreComponentPodConfig }}
+{{ toYaml .Values.router.extraCoreComponentPodConfig | indent 6 -}}
+{{- else }}
 {{- if .Values.extraCoreComponentPodConfig }}
 {{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
 {{- end }}
+{{- end }}
diff --git a/charts/fission-core/values.yaml b/charts/fission-core/values.yaml
index 984eb648f7..8dc6d996ac 100644
--- a/charts/fission-core/values.yaml
+++ b/charts/fission-core/values.yaml
@@ -108,6 +108,24 @@ router:
 
   ## Sample with a rate per time window (traces/second)
   traceSamplingRate: 0.5
+  
+  ## Extend the container specs for the router fission pods.
+  ## Can be used to add things like affinty/tolerations/nodeSelectors/etc.
+  ## For example:
+  ## extraCoreComponentPodConfig:
+  ##   affinity:
+  ##     nodeAffinity:
+  ##       requiredDuringSchedulingIgnoredDuringExecution:
+  ##         nodeSelectorTerms:
+  ##           - matchExpressions:
+  ##             - key: capability
+  ##               operator: In
+  ##               values:
+  ##                 - app
+  #extraCoreComponentPodConfig:
+  #  affinity:
+  #  tolerations:
+  #  nodeSelector:
 
 ## Persist data to a persistent volume.
 persistence:


Test patch: