From 06d73eec5e93f644ee4fa313ea70531b670f76d8 Mon Sep 17 00:00:00 2001 From: Arnob Kumar Saha Date: Mon, 6 Jul 2026 13:33:50 +0600 Subject: [PATCH] Support envoy replicas & resources in service-gateway charts Wire envoyDeployment.replicas (horizontal) and container.resources (vertical, e.g. limits.memory) through the service-gateway and service-gateway-presets charts, backed by the new EnvoySpec/EnvoyValues fields in go.bytebuilders.dev/catalog. Signed-off-by: Arnob Kumar Saha --- .../values.openapiv3_schema.yaml | 36 +++++++++++++++++++ charts/service-gateway-presets/values.yaml | 5 +++ .../templates/gateway/gwclass.yaml | 7 ++++ .../values.openapiv3_schema.yaml | 36 +++++++++++++++++++ charts/service-gateway/values.yaml | 5 +++ go.mod | 2 +- go.sum | 4 +-- .../gateway/v1alpha1/gatewayconfig_types.go | 8 +++++ .../gateway/v1alpha1/zz_generated.deepcopy.go | 12 +++++++ vendor/modules.txt | 2 +- 10 files changed, 113 insertions(+), 4 deletions(-) diff --git a/charts/service-gateway-presets/values.openapiv3_schema.yaml b/charts/service-gateway-presets/values.openapiv3_schema.yaml index 53f02f7a2..ab10c1870 100644 --- a/charts/service-gateway-presets/values.openapiv3_schema.yaml +++ b/charts/service-gateway-presets/values.openapiv3_schema.yaml @@ -158,6 +158,42 @@ properties: - Deployment - DaemonSet type: string + replicas: + format: int32 + type: integer + resources: + properties: + claims: + items: + properties: + name: + type: string + request: + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object securityContext: properties: allowPrivilegeEscalation: diff --git a/charts/service-gateway-presets/values.yaml b/charts/service-gateway-presets/values.yaml index e211cd182..7b7ae5b29 100644 --- a/charts/service-gateway-presets/values.yaml +++ b/charts/service-gateway-presets/values.yaml @@ -102,6 +102,11 @@ envoy: provisionerType: Deployment # DaemonSet image: ghcr.io/voyagermesh/envoy tag: "v1.37.2-ac" + # replicas only applies when provisionerType is Deployment + # replicas: 2 + # resources: + # limits: + # memory: 1.5Gi service: # Default listener portmanager range to use for gateway exposure portRange: "10000-12767" diff --git a/charts/service-gateway/templates/gateway/gwclass.yaml b/charts/service-gateway/templates/gateway/gwclass.yaml index d6b807d9c..c76bb510d 100644 --- a/charts/service-gateway/templates/gateway/gwclass.yaml +++ b/charts/service-gateway/templates/gateway/gwclass.yaml @@ -38,11 +38,18 @@ spec: kubernetes: {{- if eq .Values.envoy.provisionerType "Deployment" }} envoyDeployment: + {{- with .Values.envoy.replicas }} + replicas: {{ . }} + {{- end }} {{- else }} envoyDaemonSet: {{- end }} container: image: "{{ .Values.envoy.image }}:{{ .Values.envoy.tag }}" + {{- with .Values.envoy.resources }} + resources: + {{- toYaml . | nindent 12 }} + {{- end }} {{- if eq "true" ( include "distro.openshift" . ) }} securityContext: {{- toYaml (omit .Values.envoy.securityContext "runAsUser" "runAsGroup" "fsGroup" "supplementalGroups") | nindent 12 }} diff --git a/charts/service-gateway/values.openapiv3_schema.yaml b/charts/service-gateway/values.openapiv3_schema.yaml index eb885c60a..760d63d50 100644 --- a/charts/service-gateway/values.openapiv3_schema.yaml +++ b/charts/service-gateway/values.openapiv3_schema.yaml @@ -127,6 +127,42 @@ properties: - Deployment - DaemonSet type: string + replicas: + format: int32 + type: integer + resources: + properties: + claims: + items: + properties: + name: + type: string + request: + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object securityContext: properties: allowPrivilegeEscalation: diff --git a/charts/service-gateway/values.yaml b/charts/service-gateway/values.yaml index c5ee38167..7aca5e484 100644 --- a/charts/service-gateway/values.yaml +++ b/charts/service-gateway/values.yaml @@ -104,6 +104,11 @@ envoy: provisionerType: Deployment # DaemonSet image: ghcr.io/voyagermesh/envoy tag: "v1.37.2-ac" + # replicas only applies when provisionerType is Deployment + # replicas: 2 + # resources: + # limits: + # memory: 1.5Gi service: # Default listener portmanager range to use for gateway exposure portRange: "10000-12767" diff --git a/go.mod b/go.mod index 5474caf19..4a2945b42 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module go.bytebuilders.dev/installer go 1.25.6 require ( - go.bytebuilders.dev/catalog v0.0.23 + go.bytebuilders.dev/catalog v0.0.25-0.20260706073121-789173bab27a go.bytebuilders.dev/resource-model v0.4.0 go.bytebuilders.dev/ui-wizards v0.35.0 go.openviz.dev/installer v0.0.0-20260619044110-702becd1dd97 diff --git a/go.sum b/go.sum index 5db3830a5..4ead9245b 100644 --- a/go.sum +++ b/go.sum @@ -211,8 +211,8 @@ github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= go.appscode.dev/alerts v0.2.1-0.20260516020454-00c8e56b1991 h1:juyyBSMLxf/D/py8QidUT0wZUIhisivkdeCIvwXvob8= go.appscode.dev/alerts v0.2.1-0.20260516020454-00c8e56b1991/go.mod h1:oG1OnN2JTilTTqGAHv4CCoqnvT3u0J8c7YgNny0Rj7g= -go.bytebuilders.dev/catalog v0.0.23 h1:C2QLyWa5e32WfhhJLvXgorPwQ1LvEVqT6Ox4GSY2Rf8= -go.bytebuilders.dev/catalog v0.0.23/go.mod h1:o+3cekrGPUeG95FPtGfDMNiX0k4Lz0vK0Bc8b4F4S9U= +go.bytebuilders.dev/catalog v0.0.25-0.20260706073121-789173bab27a h1:isqMBmEUshUGEiaCP7kFeJc6Y/q9zE+TN99jBHcbz9c= +go.bytebuilders.dev/catalog v0.0.25-0.20260706073121-789173bab27a/go.mod h1:zXAS4yNzCueduM3glK0JDuPuJd2MDvCx2PtauRtzT7I= go.bytebuilders.dev/resource-model v0.4.0 h1:wDXg4SGYn3zNRuOj17gGo0qeSE//ytdzGPSxkHa8JvA= go.bytebuilders.dev/resource-model v0.4.0/go.mod h1:wGndjj3y+Yjh7+e8Wjc6joqzZCC16WZfKNx9adAFVkw= go.bytebuilders.dev/ui-wizards v0.35.0 h1:/JFbHqPFP/n57Igsg54ShFFENGcROiJHv+ENnE4nMqM= diff --git a/vendor/go.bytebuilders.dev/catalog/api/gateway/v1alpha1/gatewayconfig_types.go b/vendor/go.bytebuilders.dev/catalog/api/gateway/v1alpha1/gatewayconfig_types.go index f5d462aa6..535d49c07 100644 --- a/vendor/go.bytebuilders.dev/catalog/api/gateway/v1alpha1/gatewayconfig_types.go +++ b/vendor/go.bytebuilders.dev/catalog/api/gateway/v1alpha1/gatewayconfig_types.go @@ -219,6 +219,10 @@ type EnvoySpec struct { Image string `json:"image"` Tag string `json:"tag"` //+optional + Replicas *int32 `json:"replicas,omitempty"` + //+optional + Resources core.ResourceRequirements `json:"resources,omitempty"` + //+optional NodeSelector map[string]string `json:"nodeSelector"` //+optional SecurityContext *core.SecurityContext `json:"securityContext"` @@ -238,6 +242,10 @@ type EnvoyValues struct { Image string `json:"image"` Tag string `json:"tag"` //+optional + Replicas *int32 `json:"replicas,omitempty"` + //+optional + Resources core.ResourceRequirements `json:"resources,omitempty"` + //+optional NodeSelector map[string]string `json:"nodeSelector"` //+optional SecurityContext *core.SecurityContext `json:"securityContext"` diff --git a/vendor/go.bytebuilders.dev/catalog/api/gateway/v1alpha1/zz_generated.deepcopy.go b/vendor/go.bytebuilders.dev/catalog/api/gateway/v1alpha1/zz_generated.deepcopy.go index 7905a2873..adf43d8d1 100644 --- a/vendor/go.bytebuilders.dev/catalog/api/gateway/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/go.bytebuilders.dev/catalog/api/gateway/v1alpha1/zz_generated.deepcopy.go @@ -190,6 +190,12 @@ func (in *EnvoyServiceValues) DeepCopy() *EnvoyServiceValues { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *EnvoySpec) DeepCopyInto(out *EnvoySpec) { *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + in.Resources.DeepCopyInto(&out.Resources) if in.NodeSelector != nil { in, out := &in.NodeSelector, &out.NodeSelector *out = make(map[string]string, len(*in)) @@ -218,6 +224,12 @@ func (in *EnvoySpec) DeepCopy() *EnvoySpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *EnvoyValues) DeepCopyInto(out *EnvoyValues) { *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + in.Resources.DeepCopyInto(&out.Resources) if in.NodeSelector != nil { in, out := &in.NodeSelector, &out.NodeSelector *out = make(map[string]string, len(*in)) diff --git a/vendor/modules.txt b/vendor/modules.txt index 98151e179..062d18589 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -317,7 +317,7 @@ github.com/zeebo/xxh3 ## explicit; go 1.25 go.appscode.dev/alerts/apis/alerts go.appscode.dev/alerts/apis/alerts/v1alpha1 -# go.bytebuilders.dev/catalog v0.0.23 +# go.bytebuilders.dev/catalog v0.0.25-0.20260706073121-789173bab27a ## explicit; go 1.25.6 go.bytebuilders.dev/catalog/api/gateway/v1alpha1 # go.bytebuilders.dev/resource-model v0.4.0