Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: preparation for gateway conformance test #266

Merged
merged 43 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
0cd2ec5
refactor: improve performance
reaver-flomesh May 28, 2024
beecc1b
fix: golang lint
reaver-flomesh May 28, 2024
54d52fd
fix: mock
reaver-flomesh May 28, 2024
4566297
fix: don't watch EndpointSlices on k8s 1.19 & 1.20
reaver-flomesh May 28, 2024
ab1d741
fix: golang lint
reaver-flomesh May 28, 2024
2c0d165
fix: remove invocation to legacy informers
reaver-flomesh May 28, 2024
0134178
refactor: housekeeping
reaver-flomesh May 28, 2024
a829dca
Merge branch 'release/v1.3' into feature/gateway-comformance
reaver-flomesh May 28, 2024
aeff896
docs: comments on methods
reaver-flomesh May 28, 2024
98f3617
fix: ignore backend ref with nil port
reaver-flomesh May 29, 2024
2dfd919
[skip ci] chore: bump k3d to 1.25.16-k3s4
reaver-flomesh May 29, 2024
d1f6cd5
Merge branch 'release/v1.3' into feature/gateway-comformance
reaver-flomesh May 30, 2024
4f75c7c
Merge branch 'release/v1.3' into feature/gateway-comformance
reaver-flomesh May 30, 2024
5610ec0
Merge branch 'release/v1.3' into feature/gateway-comformance
reaver-flomesh May 31, 2024
0a418f2
feat: Gateway in NodePort mode
reaver-flomesh Jun 2, 2024
14ec1a9
fix: golang lint
reaver-flomesh Jun 2, 2024
ffedecd
fix: e2e
reaver-flomesh Jun 2, 2024
fee1cfb
Merge branch 'release/v1.3' into feature/gateway-comformance
reaver-flomesh Jun 2, 2024
c16a1ae
refactor: route status processor
reaver-flomesh Jun 4, 2024
f408fff
refactor: rename
reaver-flomesh Jun 4, 2024
0880d16
refactor: policy status processor
reaver-flomesh Jun 4, 2024
bac5da6
fix: golang lint
reaver-flomesh Jun 4, 2024
516096b
feat: add Timeouts config
reaver-flomesh Jun 4, 2024
5d7af50
refactor: housekeeping
reaver-flomesh Jun 4, 2024
2c35048
refactor: rename variable [skip ci]
reaver-flomesh Jun 4, 2024
1977838
refactor: rename method [skip ci]
reaver-flomesh Jun 4, 2024
52f93a3
refactor: gateway status update
reaver-flomesh Jun 6, 2024
4ebaafb
fix: golang lint
reaver-flomesh Jun 6, 2024
4a1a10a
fix: golang lint
reaver-flomesh Jun 6, 2024
47606d8
fix: golang lint
reaver-flomesh Jun 6, 2024
001c5ff
fix: nil pointer
reaver-flomesh Jun 6, 2024
2f655c5
refactor: refine events
reaver-flomesh Jun 6, 2024
a274124
fix: golang lint
reaver-flomesh Jun 6, 2024
23bca18
Merge branch 'release/v1.3' into feature/gateway-comformance
reaver-flomesh Jun 7, 2024
9983a0a
Merge branch 'release/v1.3' into feature/gateway-comformance
reaver-flomesh Jun 7, 2024
a1708b8
fix: remove restriction of ONLY ONE active FSM GatewayClass per clust…
reaver-flomesh Jun 7, 2024
2fc145f
fix: golang lint
reaver-flomesh Jun 7, 2024
e2dba90
refactor: change the name template of gateway
reaver-flomesh Jun 7, 2024
2e09a89
fix: nil pointer
reaver-flomesh Jun 7, 2024
501d82c
fix: set accepted status of GatewayClass
reaver-flomesh Jun 7, 2024
638bf83
refactor: housekeeping
reaver-flomesh Jun 7, 2024
db7db22
refactor: housekeeping
reaver-flomesh Jun 7, 2024
8c0a81f
refactor: housekeeping
reaver-flomesh Jun 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.55
version: v1.59
skip-pkg-cache: true

codegen:
Expand Down
8 changes: 8 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ run:
timeout: 20m

linters:
disable:
- errcheck
enable:
- goconst
- gocyclo
Expand All @@ -22,12 +24,18 @@ linters-settings:
rules:
- name: unused-parameter
disabled: true
gosec:
exclude-generated: true
severity: medium
confidence: medium

issues:
exclude-dirs:
- pkg/gen
- pkg/bugreport
exclude-files:
- "zz_generated.deepcopy.go$"
- "zz_generated.register.go$"
exclude-rules:
# Ignore error for ginkgo and gomega dot imports
- linters:
Expand Down
80 changes: 43 additions & 37 deletions charts/gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,44 +59,50 @@ The following table lists the configurable parameters of the fsm chart and their

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| fsm.fsmGateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].key | string | `"kubernetes.io/os"` | |
| fsm.fsmGateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].operator | string | `"In"` | |
| fsm.fsmGateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].values[0] | string | `"linux"` | |
| fsm.fsmGateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[1].key | string | `"kubernetes.io/arch"` | |
| fsm.fsmGateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[1].operator | string | `"In"` | |
| fsm.fsmGateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[1].values[0] | string | `"amd64"` | |
| fsm.fsmGateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[1].values[1] | string | `"arm64"` | |
| fsm.fsmGateway.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].podAffinityTerm.labelSelector.matchExpressions[0].key | string | `"app"` | |
| fsm.fsmGateway.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].podAffinityTerm.labelSelector.matchExpressions[0].operator | string | `"In"` | |
| fsm.fsmGateway.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].podAffinityTerm.labelSelector.matchExpressions[0].values[0] | string | `"fsm-gateway"` | |
| fsm.fsmGateway.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].podAffinityTerm.topologyKey | string | `"kubernetes.io/hostname"` | |
| fsm.fsmGateway.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].weight | int | `100` | |
| 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 |
| 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 |
| fsm.fsmGateway.autoScale.cpu | object | `{"targetAverageUtilization":80}` | Auto scale cpu metrics, for v2beta2 API |
| fsm.fsmGateway.autoScale.cpu.targetAverageUtilization | int | `80` | Average target CPU utilization (%) |
| fsm.fsmGateway.autoScale.enable | bool | `false` | Enable Autoscale |
| fsm.fsmGateway.autoScale.maxReplicas | int | `10` | Maximum replicas for autoscale |
| fsm.fsmGateway.autoScale.memory | object | `{"targetAverageUtilization":80}` | Auto scale memory metrics, for v2beta2 API |
| fsm.fsmGateway.autoScale.memory.targetAverageUtilization | int | `80` | Average target memory utilization (%) |
| 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 |
| fsm.fsmGateway.autoScale.minReplicas | int | `1` | Minimum replicas for autoscale |
| fsm.fsmGateway.env[0].name | string | `"GIN_MODE"` | |
| fsm.fsmGateway.env[0].value | string | `"release"` | |
| fsm.fsmGateway.initResources | object | `{"limits":{"cpu":"500m","memory":"512M"},"requests":{"cpu":"200m","memory":"128M"}}` | initContainer resource configuration |
| fsm.fsmGateway.logLevel | string | `"info"` | |
| fsm.fsmGateway.nodeSelector | object | `{}` | Node selector applied to control plane pods. |
| fsm.fsmGateway.podAnnotations | object | `{}` | FSM Gateway Controller's pod annotations |
| fsm.fsmGateway.podDisruptionBudget | object | `{"enabled":false,"minAvailable":1}` | Pod disruption budget configuration |
| fsm.fsmGateway.podDisruptionBudget.enabled | bool | `false` | Enable Pod Disruption Budget |
| fsm.fsmGateway.podDisruptionBudget.minAvailable | int | `1` | Minimum number of pods that must be available |
| fsm.fsmGateway.podLabels | object | `{}` | FSM Gateway Controller's pod labels |
| fsm.fsmGateway.podSecurityContext | object | `{"runAsGroup":65532,"runAsNonRoot":true,"runAsUser":65532,"seccompProfile":{"type":"RuntimeDefault"}}` | FSM Gateway Controller's pod security context |
| fsm.fsmGateway.replicas | int | `1` | |
| fsm.fsmGateway.resources | object | `{"limits":{"cpu":"2","memory":"1G"},"requests":{"cpu":"0.5","memory":"128M"}}` | FSM Gateway's container resource parameters. |
| fsm.fsmGateway.securityContext | object | `{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]}}` | FSM Gateway Controller's container security context |
| fsm.fsmGateway.tolerations | list | `[]` | Node tolerations applied to control plane pods. The specified tolerations allow pods to schedule onto nodes with matching taints. |
| fsm.fsmNamespace | string | `""` | Namespace to deploy FSM in. If not specified, the Helm release namespace is used. |
| fsm.gateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].key | string | `"kubernetes.io/os"` | |
| fsm.gateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].operator | string | `"In"` | |
| fsm.gateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].values[0] | string | `"linux"` | |
| fsm.gateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[1].key | string | `"kubernetes.io/arch"` | |
| fsm.gateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[1].operator | string | `"In"` | |
| fsm.gateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[1].values[0] | string | `"amd64"` | |
| fsm.gateway.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[1].values[1] | string | `"arm64"` | |
| fsm.gateway.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].podAffinityTerm.labelSelector.matchExpressions[0].key | string | `"app"` | |
| fsm.gateway.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].podAffinityTerm.labelSelector.matchExpressions[0].operator | string | `"In"` | |
| fsm.gateway.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].podAffinityTerm.labelSelector.matchExpressions[0].values[0] | string | `"fsm-gateway"` | |
| fsm.gateway.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].podAffinityTerm.topologyKey | string | `"kubernetes.io/hostname"` | |
| fsm.gateway.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].weight | int | `100` | |
| 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 |
| 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 |
| fsm.gateway.autoScale.cpu | object | `{"targetAverageUtilization":80}` | Auto scale cpu metrics, for v2beta2 API |
| fsm.gateway.autoScale.cpu.targetAverageUtilization | int | `80` | Average target CPU utilization (%) |
| fsm.gateway.autoScale.enable | bool | `false` | Enable Autoscale |
| fsm.gateway.autoScale.maxReplicas | int | `10` | Maximum replicas for autoscale |
| fsm.gateway.autoScale.memory | object | `{"targetAverageUtilization":80}` | Auto scale memory metrics, for v2beta2 API |
| fsm.gateway.autoScale.memory.targetAverageUtilization | int | `80` | Average target memory utilization (%) |
| 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 |
| fsm.gateway.autoScale.minReplicas | int | `1` | Minimum replicas for autoscale |
| fsm.gateway.env[0].name | string | `"GIN_MODE"` | |
| fsm.gateway.env[0].value | string | `"release"` | |
| fsm.gateway.infrastructure | object | `{"annotations":{},"labels":{}}` | Gateway's infrastructure, override by gateway.spec.infrastructure.annotations and gateway.spec.infrastructure.labels -- NOT override by parameterRef |
| fsm.gateway.initResources | object | `{"limits":{"cpu":"500m","memory":"512M"},"requests":{"cpu":"200m","memory":"128M"}}` | initContainer resource configuration |
| fsm.gateway.listeners | object | `{}` | Gateway's listeners, not overridable by parameterRef |
| fsm.gateway.logLevel | string | `"info"` | |
| fsm.gateway.name | string | `"UNKNOWN"` | Gateway's name, not overridable by parameterRef |
| fsm.gateway.namespace | string | `"default"` | Gateway's namespace, not overridable by parameterRef |
| fsm.gateway.nodePorts | list | `[]` | NodePort service configuration nodePorts: - port: 80 nodePort: 30080 - port: 443 nodePort: 30443 - port: 53 nodePort: 30053 |
| fsm.gateway.nodeSelector | object | `{}` | Node selector applied to control plane pods. |
| fsm.gateway.podAnnotations | object | `{}` | FSM Gateway Controller's pod annotations |
| fsm.gateway.podDisruptionBudget | object | `{"enabled":false,"minAvailable":1}` | Pod disruption budget configuration |
| fsm.gateway.podDisruptionBudget.enabled | bool | `false` | Enable Pod Disruption Budget |
| fsm.gateway.podDisruptionBudget.minAvailable | int | `1` | Minimum number of pods that must be available |
| fsm.gateway.podLabels | object | `{}` | FSM Gateway Controller's pod labels |
| fsm.gateway.podSecurityContext | object | `{"runAsGroup":65532,"runAsNonRoot":true,"runAsUser":65532,"seccompProfile":{"type":"RuntimeDefault"}}` | FSM Gateway Controller's pod security context |
| fsm.gateway.replicas | int | `1` | FSM Gateway's replica count |
| fsm.gateway.resources | object | `{"limits":{"cpu":"2","memory":"1G"},"requests":{"cpu":"0.5","memory":"128M"}}` | FSM Gateway's container resource parameters. |
| fsm.gateway.securityContext | object | `{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]}}` | FSM Gateway Controller's container security context |
| fsm.gateway.serviceType | string | `"LoadBalancer"` | FSM Gateway's service type, only LoadBalancer and NodePort are supported |
| fsm.gateway.tolerations | list | `[]` | Node tolerations applied to control plane pods. The specified tolerations allow pods to schedule onto nodes with matching taints. |
| fsm.image.digest | object | `{"fsmCurl":"","fsmGateway":""}` | Image digest (defaults to latest compatible tag) |
| fsm.image.digest.fsmCurl | string | `""` | fsm-curl's image digest |
| fsm.image.digest.fsmGateway | string | `""` | fsm-gateway's image digest |
Expand Down
2 changes: 1 addition & 1 deletion charts/gateway/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ServiceAccountName - GatewayAPI
*/}}
{{- define "fsm.gateway.serviceAccountName" -}}
{{ printf "fsm-gateway-%s" .Values.gwy.metadata.namespace }}
{{ printf "fsm-gateway-%s-%s" .Values.fsm.gateway.namespace .Values.fsm.gateway.name }}
{{- end }}

{{/* fsm-gateway image */}}
Expand Down
60 changes: 34 additions & 26 deletions charts/gateway/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,30 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ printf "fsm-gateway-%s" .Values.gwy.metadata.namespace }}
namespace: {{ .Values.gwy.metadata.namespace }}
{{- if .Values.gwy.spec.infrastructure }}
{{- with .Values.gwy.spec.infrastructure.annotations }}
name: {{ printf "fsm-gateway-%s-%s" .Values.fsm.gateway.namespace .Values.fsm.gateway.name }}
namespace: {{ .Values.fsm.gateway.namespace }}
{{- if .Values.fsm.gateway.infrastructure }}
{{- with .Values.fsm.gateway.infrastructure.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
labels:
{{- include "fsm.labels" . | nindent 4 }}
{{- if .Values.gwy.spec.infrastructure }}
{{- with .Values.gwy.spec.infrastructure.labels }}
{{- if .Values.fsm.gateway.infrastructure }}
{{- with .Values.fsm.gateway.infrastructure.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
app: fsm-gateway
meshName: {{ .Values.fsm.meshName }}
spec:
replicas: {{ default 1 .Values.fsm.fsmGateway.replicas }}
replicas: {{ default 1 .Values.fsm.gateway.replicas }}
selector:
matchLabels:
app: fsm-gateway
gateway.flomesh.io/ns: {{ .Values.gwy.metadata.namespace }}
gateway.flomesh.io/ns: {{ .Values.fsm.gateway.namespace }}
gateway.flomesh.io/name: {{ .Values.fsm.gateway.name }}
strategy:
rollingUpdate:
maxSurge: 1
Expand All @@ -34,23 +35,24 @@ spec:
metadata:
labels:
app: fsm-gateway
gateway.flomesh.io/ns: {{ .Values.gwy.metadata.namespace }}
{{- with .Values.fsm.fsmGateway.podLabels }}
gateway.flomesh.io/ns: {{ .Values.fsm.gateway.namespace }}
gateway.flomesh.io/name: {{ .Values.fsm.gateway.name }}
{{- with .Values.fsm.gateway.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.gwy.spec.infrastructure }}
{{- with .Values.gwy.spec.infrastructure.labels }}
{{- if .Values.fsm.gateway.infrastructure }}
{{- with .Values.fsm.gateway.infrastructure.labels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
annotations:
prometheus.io/scrape: 'true'
prometheus.io/port: '9091'
{{- with .Values.fsm.fsmGateway.podAnnotations }}
{{- with .Values.fsm.gateway.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.gwy.spec.infrastructure }}
{{- with .Values.gwy.spec.infrastructure.annotations }}
{{- if .Values.fsm.gateway.infrastructure }}
{{- with .Values.fsm.gateway.infrastructure.annotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Expand All @@ -71,8 +73,8 @@ spec:
- --retry-delay
- "5"
resources:
{{- toYaml .Values.fsm.fsmGateway.initResources | nindent 10 }}
{{- with .Values.fsm.fsmGateway.securityContext }}
{{- toYaml .Values.fsm.gateway.initResources | nindent 10 }}
{{- with .Values.fsm.gateway.securityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
Expand All @@ -81,19 +83,21 @@ spec:
image: {{ include "fsmGateway.image" . }}
imagePullPolicy: {{ .Values.fsm.image.pullPolicy }}
ports:
{{- range $listener := .Values.listeners }}
{{- range $listener := .Values.fsm.gateway.listeners }}
- name: {{ $listener.name }}
containerPort: {{ ternary (add 60000 $listener.port) $listener.port (lt (int $listener.port) 1024)}}
{{- end }}
- name: health
containerPort: 8081
args:
- --verbosity={{ .Values.fsm.fsmGateway.logLevel }}
- --verbosity={{ .Values.fsm.gateway.logLevel }}
- --fsm-namespace={{ .Values.fsm.fsmNamespace }}
- --fsm-version={{ .Chart.AppVersion }}
- --mesh-name={{ .Values.fsm.meshName }}
- --gateway-namespace={{ .Values.fsm.gateway.namespace }}
- --gateway-name={{ .Values.fsm.gateway.name }}
resources:
{{- toYaml .Values.fsm.fsmGateway.resources | nindent 10 }}
{{- toYaml .Values.fsm.gateway.resources | nindent 10 }}
env:
- name: FSM_NAMESPACE
value: {{ .Values.fsm.fsmNamespace }}
Expand All @@ -105,10 +109,10 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- with .Values.fsm.fsmGateway.env }}
{{- with .Values.fsm.gateway.env }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.fsm.fsmGateway.securityContext }}
{{- with .Values.fsm.gateway.securityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
Expand All @@ -123,7 +127,7 @@ spec:
tcpSocket:
port: 9091
terminationGracePeriodSeconds: 60
{{- with .Values.fsm.fsmGateway.podSecurityContext }}
{{- with .Values.fsm.gateway.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand All @@ -132,7 +136,7 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.fsm.fsmGateway.nodeSelector }}
{{- with .Values.fsm.gateway.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -162,10 +166,14 @@ spec:
- key: gateway.flomesh.io/ns
operator: In
values:
- {{ .Values.gwy.metadata.namespace }}
- {{ .Values.fsm.gateway.namespace }}
- key: gateway.flomesh.io/name
operator: In
values:
- {{ .Values.fsm.gateway.name }}
topologyKey: kubernetes.io/hostname
weight: 100
{{- with .Values.fsm.fsmGateway.tolerations }}
{{- with .Values.fsm.gateway.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
Loading
Loading