ReplicaSet generated by Deployment distributes pods to nodes based on nodes resource usage, which means in some cases the newly created pods may be assigned to only a few nodes. The requests will go to the same node if there multiple pods on it and may increase the node resource usage and overall request latency. To solve the problem mentioned above, this PR allows users to deploy the router as DaemonSet so that we can distribute requests across all nodes for better workload distribution and lower latency.
89 lines
3.1 KiB
YAML
89 lines
3.1 KiB
YAML
apiVersion: apps/v1
|
|
{{- if not .Values.router.deployAsDaemonSet }}
|
|
kind: Deployment
|
|
{{- else }}
|
|
kind: DaemonSet
|
|
{{- end }}
|
|
metadata:
|
|
name: router
|
|
labels:
|
|
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
|
svc: router
|
|
application: fission-router
|
|
spec:
|
|
{{- if not .Values.router.deployAsDaemonSet }}
|
|
replicas: 1
|
|
{{- end }}
|
|
selector:
|
|
matchLabels:
|
|
application: fission-router
|
|
svc: router
|
|
template:
|
|
metadata:
|
|
labels:
|
|
application: fission-router
|
|
svc: router
|
|
annotations:
|
|
prometheus.io/scrape: "true"
|
|
prometheus.io/path: "/metrics"
|
|
prometheus.io/port: "8080"
|
|
spec:
|
|
containers:
|
|
- name: router
|
|
image: {{ include "fission-bundleImage" . | quote }}
|
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
|
command: ["/fission-bundle"]
|
|
args: ["--routerPort", "8888", "--executorUrl", "http://executor.{{ .Release.Namespace }}", "--collectorEndpoint", "{{ .Values.traceCollectorEndpoint }}"]
|
|
env:
|
|
- name: POD_NAMESPACE
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.namespace
|
|
- name: ROUTER_ROUND_TRIP_TIMEOUT
|
|
value: {{ .Values.router.roundTrip.timeout | default "50ms" | quote }}
|
|
- name: ROUTER_ROUNDTRIP_TIMEOUT_EXPONENT
|
|
value: {{ .Values.router.roundTrip.timeoutExponent | default 2 | quote }}
|
|
- name: ROUTER_ROUND_TRIP_KEEP_ALIVE_TIME
|
|
value: {{ .Values.router.roundTrip.keepAliveTime | default "30s" | quote }}
|
|
- name: ROUTER_ROUND_TRIP_DISABLE_KEEP_ALIVE
|
|
value: {{ .Values.router.roundTrip.disableKeepAlive | default true | quote }}
|
|
- name: ROUTER_ROUND_TRIP_MAX_RETRIES
|
|
value: {{ .Values.router.roundTrip.maxRetries | default 10 | quote }}
|
|
- name: ROUTER_SVC_ADDRESS_MAX_RETRIES
|
|
value: {{ .Values.router.svcAddressMaxRetries | default 5 | quote }}
|
|
- name: ROUTER_SVC_ADDRESS_UPDATE_TIMEOUT
|
|
value: {{ .Values.router.svcAddressUpdateTimeout | default "30s" | quote }}
|
|
- name: DEBUG_ENV
|
|
value: {{ .Values.debugEnv | quote }}
|
|
- name: TRACING_SAMPLING_RATE
|
|
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
|
{{- if .Values.analytics }}
|
|
- name: ANALYTICS_URL
|
|
value: "https://g.fission.sh/metrics"
|
|
{{- else if .Values.analyticsNonHelmInstall }}
|
|
- name: ANALYTICS_URL
|
|
value: "https://g.fission.sh/metrics"
|
|
{{- end }}
|
|
readinessProbe:
|
|
httpGet:
|
|
path: "/router-healthz"
|
|
port: 8888
|
|
initialDelaySeconds: 1
|
|
periodSeconds: 1
|
|
failureThreshold: 30
|
|
livenessProbe:
|
|
httpGet:
|
|
path: "/router-healthz"
|
|
port: 8888
|
|
initialDelaySeconds: 35
|
|
periodSeconds: 5
|
|
ports:
|
|
- containerPort: 8080
|
|
name: metrics
|
|
- containerPort: 8888
|
|
name: http
|
|
serviceAccount: fission-svc
|
|
{{- if .Values.extraCoreComponentPodConfig }}
|
|
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
|
{{- end }}
|