Skip to content

Commit c1df0db

Browse files
refactor: preparation for gateway conformance test (#266)
* refactor: improve performance Signed-off-by: Lin Yang <[email protected]> * fix: golang lint Signed-off-by: Lin Yang <[email protected]> * fix: mock Signed-off-by: Lin Yang <[email protected]> * fix: don't watch EndpointSlices on k8s 1.19 & 1.20 Signed-off-by: Lin Yang <[email protected]> * fix: golang lint Signed-off-by: Lin Yang <[email protected]> * fix: remove invocation to legacy informers Signed-off-by: Lin Yang <[email protected]> * refactor: housekeeping Signed-off-by: Lin Yang <[email protected]> * docs: comments on methods Signed-off-by: Lin Yang <[email protected]> * fix: ignore backend ref with nil port Signed-off-by: Lin Yang <[email protected]> * [skip ci] chore: bump k3d to 1.25.16-k3s4 Signed-off-by: Lin Yang <[email protected]> * feat: Gateway in NodePort mode Signed-off-by: Lin Yang <[email protected]> * fix: golang lint Signed-off-by: Lin Yang <[email protected]> * fix: e2e Signed-off-by: Lin Yang <[email protected]> * refactor: route status processor Signed-off-by: Lin Yang <[email protected]> * refactor: rename Signed-off-by: Lin Yang <[email protected]> * refactor: policy status processor Signed-off-by: Lin Yang <[email protected]> * fix: golang lint Signed-off-by: Lin Yang <[email protected]> * feat: add Timeouts config Signed-off-by: Lin Yang <[email protected]> * refactor: housekeeping Signed-off-by: Lin Yang <[email protected]> * refactor: rename variable [skip ci] Signed-off-by: Lin Yang <[email protected]> * refactor: rename method [skip ci] Signed-off-by: Lin Yang <[email protected]> * refactor: gateway status update Signed-off-by: Lin Yang <[email protected]> * fix: golang lint Signed-off-by: Lin Yang <[email protected]> * fix: golang lint Signed-off-by: Lin Yang <[email protected]> * fix: golang lint Signed-off-by: Lin Yang <[email protected]> * fix: nil pointer Signed-off-by: Lin Yang <[email protected]> * refactor: refine events Signed-off-by: Lin Yang <[email protected]> * fix: golang lint Signed-off-by: Lin Yang <[email protected]> * fix: remove restriction of ONLY ONE active FSM GatewayClass per cluster and ONLY ONE active gateway per namespace Signed-off-by: Lin Yang <[email protected]> * fix: golang lint Signed-off-by: Lin Yang <[email protected]> * refactor: change the name template of gateway Signed-off-by: Lin Yang <[email protected]> * fix: nil pointer Signed-off-by: Lin Yang <[email protected]> * fix: set accepted status of GatewayClass Signed-off-by: Lin Yang <[email protected]> * refactor: housekeeping Signed-off-by: Lin Yang <[email protected]> * refactor: housekeeping Signed-off-by: Lin Yang <[email protected]> * refactor: housekeeping Signed-off-by: Lin Yang <[email protected]> --------- Signed-off-by: Lin Yang <[email protected]>
1 parent 6f62449 commit c1df0db

File tree

106 files changed

+6067
-3827
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+6067
-3827
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
- name: golangci-lint
5757
uses: golangci/golangci-lint-action@v6
5858
with:
59-
version: v1.55
59+
version: v1.59
6060
skip-pkg-cache: true
6161

6262
codegen:

.golangci.yml

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ run:
33
timeout: 20m
44

55
linters:
6+
disable:
7+
- errcheck
68
enable:
79
- goconst
810
- gocyclo
@@ -22,12 +24,18 @@ linters-settings:
2224
rules:
2325
- name: unused-parameter
2426
disabled: true
27+
gosec:
28+
exclude-generated: true
29+
severity: medium
30+
confidence: medium
2531

2632
issues:
2733
exclude-dirs:
2834
- pkg/gen
35+
- pkg/bugreport
2936
exclude-files:
3037
- "zz_generated.deepcopy.go$"
38+
- "zz_generated.register.go$"
3139
exclude-rules:
3240
# Ignore error for ginkgo and gomega dot imports
3341
- linters:

charts/gateway/README.md

+43-37
Original file line numberDiff line numberDiff line change
@@ -59,44 +59,50 @@ The following table lists the configurable parameters of the fsm chart and their
5959

6060
| Key | Type | Default | Description |
6161
|-----|------|---------|-------------|
62-
| fsm.fsmGateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].key | string | `"kubernetes.io/os"` | |
63-
| fsm.fsmGateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].operator | string | `"In"` | |
64-
| fsm.fsmGateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].values[0] | string | `"linux"` | |
65-
| fsm.fsmGateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[1].key | string | `"kubernetes.io/arch"` | |
66-
| fsm.fsmGateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[1].operator | string | `"In"` | |
67-
| fsm.fsmGateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[1].values[0] | string | `"amd64"` | |
68-
| fsm.fsmGateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[1].values[1] | string | `"arm64"` | |
69-
| fsm.fsmGateway.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].podAffinityTerm.labelSelector.matchExpressions[0].key | string | `"app"` | |
70-
| fsm.fsmGateway.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].podAffinityTerm.labelSelector.matchExpressions[0].operator | string | `"In"` | |
71-
| fsm.fsmGateway.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].podAffinityTerm.labelSelector.matchExpressions[0].values[0] | string | `"fsm-gateway"` | |
72-
| fsm.fsmGateway.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].podAffinityTerm.topologyKey | string | `"kubernetes.io/hostname"` | |
73-
| fsm.fsmGateway.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].weight | int | `100` | |
74-
| fsm.fsmGateway.autoScale | object | `{"behavior":{"scaleDown":{"policies":[{"periodSeconds":60,"type":"Pods","value":1},{"periodSeconds":60,"type":"Percent","value":10}],"selectPolicy":"Min","stabilizationWindowSeconds":300},"scaleUp":{"policies":[{"periodSeconds":15,"type":"Percent","value":100},{"periodSeconds":15,"type":"Pods","value":2}],"selectPolicy":"Max","stabilizationWindowSeconds":0}},"cpu":{"targetAverageUtilization":80},"enable":false,"maxReplicas":10,"memory":{"targetAverageUtilization":80},"metrics":[{"resource":{"name":"cpu","target":{"averageUtilization":80,"type":"Utilization"}},"type":"Resource"},{"resource":{"name":"memory","target":{"averageUtilization":80,"type":"Utilization"}},"type":"Resource"}],"minReplicas":1}` | Auto scale configuration |
75-
| fsm.fsmGateway.autoScale.behavior | object | `{"scaleDown":{"policies":[{"periodSeconds":60,"type":"Pods","value":1},{"periodSeconds":60,"type":"Percent","value":10}],"selectPolicy":"Min","stabilizationWindowSeconds":300},"scaleUp":{"policies":[{"periodSeconds":15,"type":"Percent","value":100},{"periodSeconds":15,"type":"Pods","value":2}],"selectPolicy":"Max","stabilizationWindowSeconds":0}}` | Auto scale behavior, for v2 API |
76-
| fsm.fsmGateway.autoScale.cpu | object | `{"targetAverageUtilization":80}` | Auto scale cpu metrics, for v2beta2 API |
77-
| fsm.fsmGateway.autoScale.cpu.targetAverageUtilization | int | `80` | Average target CPU utilization (%) |
78-
| fsm.fsmGateway.autoScale.enable | bool | `false` | Enable Autoscale |
79-
| fsm.fsmGateway.autoScale.maxReplicas | int | `10` | Maximum replicas for autoscale |
80-
| fsm.fsmGateway.autoScale.memory | object | `{"targetAverageUtilization":80}` | Auto scale memory metrics, for v2beta2 API |
81-
| fsm.fsmGateway.autoScale.memory.targetAverageUtilization | int | `80` | Average target memory utilization (%) |
82-
| fsm.fsmGateway.autoScale.metrics | list | `[{"resource":{"name":"cpu","target":{"averageUtilization":80,"type":"Utilization"}},"type":"Resource"},{"resource":{"name":"memory","target":{"averageUtilization":80,"type":"Utilization"}},"type":"Resource"}]` | Auto scale metrics, for v2 API |
83-
| fsm.fsmGateway.autoScale.minReplicas | int | `1` | Minimum replicas for autoscale |
84-
| fsm.fsmGateway.env[0].name | string | `"GIN_MODE"` | |
85-
| fsm.fsmGateway.env[0].value | string | `"release"` | |
86-
| fsm.fsmGateway.initResources | object | `{"limits":{"cpu":"500m","memory":"512M"},"requests":{"cpu":"200m","memory":"128M"}}` | initContainer resource configuration |
87-
| fsm.fsmGateway.logLevel | string | `"info"` | |
88-
| fsm.fsmGateway.nodeSelector | object | `{}` | Node selector applied to control plane pods. |
89-
| fsm.fsmGateway.podAnnotations | object | `{}` | FSM Gateway Controller's pod annotations |
90-
| fsm.fsmGateway.podDisruptionBudget | object | `{"enabled":false,"minAvailable":1}` | Pod disruption budget configuration |
91-
| fsm.fsmGateway.podDisruptionBudget.enabled | bool | `false` | Enable Pod Disruption Budget |
92-
| fsm.fsmGateway.podDisruptionBudget.minAvailable | int | `1` | Minimum number of pods that must be available |
93-
| fsm.fsmGateway.podLabels | object | `{}` | FSM Gateway Controller's pod labels |
94-
| fsm.fsmGateway.podSecurityContext | object | `{"runAsGroup":65532,"runAsNonRoot":true,"runAsUser":65532,"seccompProfile":{"type":"RuntimeDefault"}}` | FSM Gateway Controller's pod security context |
95-
| fsm.fsmGateway.replicas | int | `1` | |
96-
| fsm.fsmGateway.resources | object | `{"limits":{"cpu":"2","memory":"1G"},"requests":{"cpu":"0.5","memory":"128M"}}` | FSM Gateway's container resource parameters. |
97-
| fsm.fsmGateway.securityContext | object | `{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]}}` | FSM Gateway Controller's container security context |
98-
| fsm.fsmGateway.tolerations | list | `[]` | Node tolerations applied to control plane pods. The specified tolerations allow pods to schedule onto nodes with matching taints. |
9962
| fsm.fsmNamespace | string | `""` | Namespace to deploy FSM in. If not specified, the Helm release namespace is used. |
63+
| fsm.gateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].key | string | `"kubernetes.io/os"` | |
64+
| fsm.gateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].operator | string | `"In"` | |
65+
| fsm.gateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].values[0] | string | `"linux"` | |
66+
| fsm.gateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[1].key | string | `"kubernetes.io/arch"` | |
67+
| fsm.gateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[1].operator | string | `"In"` | |
68+
| fsm.gateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[1].values[0] | string | `"amd64"` | |
69+
| fsm.gateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[1].values[1] | string | `"arm64"` | |
70+
| fsm.gateway.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].podAffinityTerm.labelSelector.matchExpressions[0].key | string | `"app"` | |
71+
| fsm.gateway.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].podAffinityTerm.labelSelector.matchExpressions[0].operator | string | `"In"` | |
72+
| fsm.gateway.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].podAffinityTerm.labelSelector.matchExpressions[0].values[0] | string | `"fsm-gateway"` | |
73+
| fsm.gateway.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].podAffinityTerm.topologyKey | string | `"kubernetes.io/hostname"` | |
74+
| fsm.gateway.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].weight | int | `100` | |
75+
| fsm.gateway.autoScale | object | `{"behavior":{"scaleDown":{"policies":[{"periodSeconds":60,"type":"Pods","value":1},{"periodSeconds":60,"type":"Percent","value":10}],"selectPolicy":"Min","stabilizationWindowSeconds":300},"scaleUp":{"policies":[{"periodSeconds":15,"type":"Percent","value":100},{"periodSeconds":15,"type":"Pods","value":2}],"selectPolicy":"Max","stabilizationWindowSeconds":0}},"cpu":{"targetAverageUtilization":80},"enable":false,"maxReplicas":10,"memory":{"targetAverageUtilization":80},"metrics":[{"resource":{"name":"cpu","target":{"averageUtilization":80,"type":"Utilization"}},"type":"Resource"},{"resource":{"name":"memory","target":{"averageUtilization":80,"type":"Utilization"}},"type":"Resource"}],"minReplicas":1}` | Auto scale configuration |
76+
| fsm.gateway.autoScale.behavior | object | `{"scaleDown":{"policies":[{"periodSeconds":60,"type":"Pods","value":1},{"periodSeconds":60,"type":"Percent","value":10}],"selectPolicy":"Min","stabilizationWindowSeconds":300},"scaleUp":{"policies":[{"periodSeconds":15,"type":"Percent","value":100},{"periodSeconds":15,"type":"Pods","value":2}],"selectPolicy":"Max","stabilizationWindowSeconds":0}}` | Auto scale behavior, for v2 API |
77+
| fsm.gateway.autoScale.cpu | object | `{"targetAverageUtilization":80}` | Auto scale cpu metrics, for v2beta2 API |
78+
| fsm.gateway.autoScale.cpu.targetAverageUtilization | int | `80` | Average target CPU utilization (%) |
79+
| fsm.gateway.autoScale.enable | bool | `false` | Enable Autoscale |
80+
| fsm.gateway.autoScale.maxReplicas | int | `10` | Maximum replicas for autoscale |
81+
| fsm.gateway.autoScale.memory | object | `{"targetAverageUtilization":80}` | Auto scale memory metrics, for v2beta2 API |
82+
| fsm.gateway.autoScale.memory.targetAverageUtilization | int | `80` | Average target memory utilization (%) |
83+
| fsm.gateway.autoScale.metrics | list | `[{"resource":{"name":"cpu","target":{"averageUtilization":80,"type":"Utilization"}},"type":"Resource"},{"resource":{"name":"memory","target":{"averageUtilization":80,"type":"Utilization"}},"type":"Resource"}]` | Auto scale metrics, for v2 API |
84+
| fsm.gateway.autoScale.minReplicas | int | `1` | Minimum replicas for autoscale |
85+
| fsm.gateway.env[0].name | string | `"GIN_MODE"` | |
86+
| fsm.gateway.env[0].value | string | `"release"` | |
87+
| fsm.gateway.infrastructure | object | `{"annotations":{},"labels":{}}` | Gateway's infrastructure, override by gateway.spec.infrastructure.annotations and gateway.spec.infrastructure.labels -- NOT override by parameterRef |
88+
| fsm.gateway.initResources | object | `{"limits":{"cpu":"500m","memory":"512M"},"requests":{"cpu":"200m","memory":"128M"}}` | initContainer resource configuration |
89+
| fsm.gateway.listeners | object | `{}` | Gateway's listeners, not overridable by parameterRef |
90+
| fsm.gateway.logLevel | string | `"info"` | |
91+
| fsm.gateway.name | string | `"UNKNOWN"` | Gateway's name, not overridable by parameterRef |
92+
| fsm.gateway.namespace | string | `"default"` | Gateway's namespace, not overridable by parameterRef |
93+
| fsm.gateway.nodePorts | list | `[]` | NodePort service configuration nodePorts: - port: 80 nodePort: 30080 - port: 443 nodePort: 30443 - port: 53 nodePort: 30053 |
94+
| fsm.gateway.nodeSelector | object | `{}` | Node selector applied to control plane pods. |
95+
| fsm.gateway.podAnnotations | object | `{}` | FSM Gateway Controller's pod annotations |
96+
| fsm.gateway.podDisruptionBudget | object | `{"enabled":false,"minAvailable":1}` | Pod disruption budget configuration |
97+
| fsm.gateway.podDisruptionBudget.enabled | bool | `false` | Enable Pod Disruption Budget |
98+
| fsm.gateway.podDisruptionBudget.minAvailable | int | `1` | Minimum number of pods that must be available |
99+
| fsm.gateway.podLabels | object | `{}` | FSM Gateway Controller's pod labels |
100+
| fsm.gateway.podSecurityContext | object | `{"runAsGroup":65532,"runAsNonRoot":true,"runAsUser":65532,"seccompProfile":{"type":"RuntimeDefault"}}` | FSM Gateway Controller's pod security context |
101+
| fsm.gateway.replicas | int | `1` | FSM Gateway's replica count |
102+
| fsm.gateway.resources | object | `{"limits":{"cpu":"2","memory":"1G"},"requests":{"cpu":"0.5","memory":"128M"}}` | FSM Gateway's container resource parameters. |
103+
| fsm.gateway.securityContext | object | `{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]}}` | FSM Gateway Controller's container security context |
104+
| fsm.gateway.serviceType | string | `"LoadBalancer"` | FSM Gateway's service type, only LoadBalancer and NodePort are supported |
105+
| fsm.gateway.tolerations | list | `[]` | Node tolerations applied to control plane pods. The specified tolerations allow pods to schedule onto nodes with matching taints. |
100106
| fsm.image.digest | object | `{"fsmCurl":"","fsmGateway":""}` | Image digest (defaults to latest compatible tag) |
101107
| fsm.image.digest.fsmCurl | string | `""` | fsm-curl's image digest |
102108
| fsm.image.digest.fsmGateway | string | `""` | fsm-gateway's image digest |

charts/gateway/templates/_helpers.tpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
ServiceAccountName - GatewayAPI
33
*/}}
44
{{- define "fsm.gateway.serviceAccountName" -}}
5-
{{ printf "fsm-gateway-%s" .Values.gwy.metadata.namespace }}
5+
{{ printf "fsm-gateway-%s-%s" .Values.fsm.gateway.namespace .Values.fsm.gateway.name }}
66
{{- end }}
77

88
{{/* fsm-gateway image */}}

charts/gateway/templates/deployment.yaml

+34-26
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,30 @@
22
apiVersion: apps/v1
33
kind: Deployment
44
metadata:
5-
name: {{ printf "fsm-gateway-%s" .Values.gwy.metadata.namespace }}
6-
namespace: {{ .Values.gwy.metadata.namespace }}
7-
{{- if .Values.gwy.spec.infrastructure }}
8-
{{- with .Values.gwy.spec.infrastructure.annotations }}
5+
name: {{ printf "fsm-gateway-%s-%s" .Values.fsm.gateway.namespace .Values.fsm.gateway.name }}
6+
namespace: {{ .Values.fsm.gateway.namespace }}
7+
{{- if .Values.fsm.gateway.infrastructure }}
8+
{{- with .Values.fsm.gateway.infrastructure.annotations }}
99
annotations:
1010
{{- toYaml . | nindent 4 }}
1111
{{- end }}
1212
{{- end }}
1313
labels:
1414
{{- include "fsm.labels" . | nindent 4 }}
15-
{{- if .Values.gwy.spec.infrastructure }}
16-
{{- with .Values.gwy.spec.infrastructure.labels }}
15+
{{- if .Values.fsm.gateway.infrastructure }}
16+
{{- with .Values.fsm.gateway.infrastructure.labels }}
1717
{{- toYaml . | nindent 4 }}
1818
{{- end }}
1919
{{- end }}
2020
app: fsm-gateway
2121
meshName: {{ .Values.fsm.meshName }}
2222
spec:
23-
replicas: {{ default 1 .Values.fsm.fsmGateway.replicas }}
23+
replicas: {{ default 1 .Values.fsm.gateway.replicas }}
2424
selector:
2525
matchLabels:
2626
app: fsm-gateway
27-
gateway.flomesh.io/ns: {{ .Values.gwy.metadata.namespace }}
27+
gateway.flomesh.io/ns: {{ .Values.fsm.gateway.namespace }}
28+
gateway.flomesh.io/name: {{ .Values.fsm.gateway.name }}
2829
strategy:
2930
rollingUpdate:
3031
maxSurge: 1
@@ -34,23 +35,24 @@ spec:
3435
metadata:
3536
labels:
3637
app: fsm-gateway
37-
gateway.flomesh.io/ns: {{ .Values.gwy.metadata.namespace }}
38-
{{- with .Values.fsm.fsmGateway.podLabels }}
38+
gateway.flomesh.io/ns: {{ .Values.fsm.gateway.namespace }}
39+
gateway.flomesh.io/name: {{ .Values.fsm.gateway.name }}
40+
{{- with .Values.fsm.gateway.podLabels }}
3941
{{- toYaml . | nindent 8 }}
4042
{{- end }}
41-
{{- if .Values.gwy.spec.infrastructure }}
42-
{{- with .Values.gwy.spec.infrastructure.labels }}
43+
{{- if .Values.fsm.gateway.infrastructure }}
44+
{{- with .Values.fsm.gateway.infrastructure.labels }}
4345
{{- toYaml . | nindent 8 }}
4446
{{- end }}
4547
{{- end }}
4648
annotations:
4749
prometheus.io/scrape: 'true'
4850
prometheus.io/port: '9091'
49-
{{- with .Values.fsm.fsmGateway.podAnnotations }}
51+
{{- with .Values.fsm.gateway.podAnnotations }}
5052
{{- toYaml . | nindent 8 }}
5153
{{- end }}
52-
{{- if .Values.gwy.spec.infrastructure }}
53-
{{- with .Values.gwy.spec.infrastructure.annotations }}
54+
{{- if .Values.fsm.gateway.infrastructure }}
55+
{{- with .Values.fsm.gateway.infrastructure.annotations }}
5456
{{- toYaml . | nindent 8 }}
5557
{{- end }}
5658
{{- end }}
@@ -71,8 +73,8 @@ spec:
7173
- --retry-delay
7274
- "5"
7375
resources:
74-
{{- toYaml .Values.fsm.fsmGateway.initResources | nindent 10 }}
75-
{{- with .Values.fsm.fsmGateway.securityContext }}
76+
{{- toYaml .Values.fsm.gateway.initResources | nindent 10 }}
77+
{{- with .Values.fsm.gateway.securityContext }}
7678
securityContext:
7779
{{- toYaml . | nindent 10 }}
7880
{{- end }}
@@ -81,19 +83,21 @@ spec:
8183
image: {{ include "fsmGateway.image" . }}
8284
imagePullPolicy: {{ .Values.fsm.image.pullPolicy }}
8385
ports:
84-
{{- range $listener := .Values.listeners }}
86+
{{- range $listener := .Values.fsm.gateway.listeners }}
8587
- name: {{ $listener.name }}
8688
containerPort: {{ ternary (add 60000 $listener.port) $listener.port (lt (int $listener.port) 1024)}}
8789
{{- end }}
8890
- name: health
8991
containerPort: 8081
9092
args:
91-
- --verbosity={{ .Values.fsm.fsmGateway.logLevel }}
93+
- --verbosity={{ .Values.fsm.gateway.logLevel }}
9294
- --fsm-namespace={{ .Values.fsm.fsmNamespace }}
9395
- --fsm-version={{ .Chart.AppVersion }}
9496
- --mesh-name={{ .Values.fsm.meshName }}
97+
- --gateway-namespace={{ .Values.fsm.gateway.namespace }}
98+
- --gateway-name={{ .Values.fsm.gateway.name }}
9599
resources:
96-
{{- toYaml .Values.fsm.fsmGateway.resources | nindent 10 }}
100+
{{- toYaml .Values.fsm.gateway.resources | nindent 10 }}
97101
env:
98102
- name: FSM_NAMESPACE
99103
value: {{ .Values.fsm.fsmNamespace }}
@@ -105,10 +109,10 @@ spec:
105109
valueFrom:
106110
fieldRef:
107111
fieldPath: metadata.namespace
108-
{{- with .Values.fsm.fsmGateway.env }}
112+
{{- with .Values.fsm.gateway.env }}
109113
{{- toYaml . | nindent 8 }}
110114
{{- end }}
111-
{{- with .Values.fsm.fsmGateway.securityContext }}
115+
{{- with .Values.fsm.gateway.securityContext }}
112116
securityContext:
113117
{{- toYaml . | nindent 10 }}
114118
{{- end }}
@@ -123,7 +127,7 @@ spec:
123127
tcpSocket:
124128
port: 9091
125129
terminationGracePeriodSeconds: 60
126-
{{- with .Values.fsm.fsmGateway.podSecurityContext }}
130+
{{- with .Values.fsm.gateway.podSecurityContext }}
127131
securityContext:
128132
{{- toYaml . | nindent 8 }}
129133
{{- end }}
@@ -132,7 +136,7 @@ spec:
132136
imagePullSecrets:
133137
{{- toYaml . | nindent 8 }}
134138
{{- end }}
135-
{{- with .Values.fsm.fsmGateway.nodeSelector }}
139+
{{- with .Values.fsm.gateway.nodeSelector }}
136140
nodeSelector:
137141
{{- toYaml . | nindent 8 }}
138142
{{- end }}
@@ -162,10 +166,14 @@ spec:
162166
- key: gateway.flomesh.io/ns
163167
operator: In
164168
values:
165-
- {{ .Values.gwy.metadata.namespace }}
169+
- {{ .Values.fsm.gateway.namespace }}
170+
- key: gateway.flomesh.io/name
171+
operator: In
172+
values:
173+
- {{ .Values.fsm.gateway.name }}
166174
topologyKey: kubernetes.io/hostname
167175
weight: 100
168-
{{- with .Values.fsm.fsmGateway.tolerations }}
176+
{{- with .Values.fsm.gateway.tolerations }}
169177
tolerations:
170178
{{- toYaml . | nindent 8 }}
171179
{{- end }}

0 commit comments

Comments
 (0)