diff --git a/helm/core/templates/_helpers.tpl b/helm/core/templates/_helpers.tpl index f10732342..b3125381f 100644 --- a/helm/core/templates/_helpers.tpl +++ b/helm/core/templates/_helpers.tpl @@ -113,3 +113,36 @@ kind: VMPodScrape {{- fail "unexpected gateway.metrics.provider" -}} {{- end -}} {{- end -}} + +{{- define "pluginServer.name" -}} +{{- .Values.pluginServer.name | default "higress-plugin-server" -}} +{{- end }} + +{{- define "pluginServer.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{- define "pluginServer.labels" -}} +helm.sh/chart: {{ include "pluginServer.chart" . }} +{{ include "pluginServer.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +app.kubernetes.io/name: {{ include "pluginServer.name" . }} +{{- end }} + +{{- define "pluginServer.selectorLabels" -}} +{{- if hasKey .Values.pluginServer.labels "app" }} +{{- with .Values.pluginServer.labels.app }}app: {{.|quote}} +{{- end}} +{{- else }}app: {{ include "pluginServer.name" . }} +{{- end }} +{{- if hasKey .Values.pluginServer.labels "higress" }} +{{- with .Values.pluginServer.labels.higress }} +higress: {{.|quote}} +{{- end}} +{{- else }} +higress: {{ include "pluginServer.name" . }} +{{- end }} +{{- end }} diff --git a/helm/core/templates/plugin-server-deployment.yaml b/helm/core/templates/plugin-server-deployment.yaml new file mode 100644 index 000000000..c39cdea16 --- /dev/null +++ b/helm/core/templates/plugin-server-deployment.yaml @@ -0,0 +1,39 @@ +{{- if .Values.global.enablePluginServer }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "pluginServer.name" . }} + namespace: {{ .Release.Namespace }} +spec: + replicas: {{ .Values.pluginServer.replicas }} + selector: + matchLabels: + {{- include "pluginServer.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- with .Values.pluginServer.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- include "pluginServer.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.pluginServer.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }} + image: {{ .Values.pluginServer.hub | default .Values.global.hub }}/{{ .Values.pluginServer.image | default "plugin-server" }}:{{ .Values.pluginServer.tag | default "1.0.0" }} + {{- if .Values.global.imagePullPolicy }} + imagePullPolicy: {{ .Values.global.imagePullPolicy }} + {{- end }} + ports: + - containerPort: 8080 + resources: + requests: + cpu: {{ .Values.pluginServer.resources.requests.cpu }} + memory: {{ .Values.pluginServer.resources.requests.memory }} + limits: + cpu: {{ .Values.pluginServer.resources.limits.cpu }} + memory: {{ .Values.pluginServer.resources.limits.memory }} +{{- end }} \ No newline at end of file diff --git a/helm/core/templates/plugin-server-service.yaml b/helm/core/templates/plugin-server-service.yaml new file mode 100644 index 000000000..3850403e1 --- /dev/null +++ b/helm/core/templates/plugin-server-service.yaml @@ -0,0 +1,16 @@ +{{- if .Values.global.enablePluginServer }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "pluginServer.name" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "pluginServer.labels" . | nindent 4 }} +spec: + ports: + - protocol: TCP + port: {{ .Values.pluginServer.service.port }} + targetPort: 8080 + selector: + {{- include "pluginServer.selectorLabels" . | nindent 4 }} +{{- end }} \ No newline at end of file diff --git a/helm/core/values.yaml b/helm/core/values.yaml index 33e49ba80..5e605c037 100644 --- a/helm/core/values.yaml +++ b/helm/core/values.yaml @@ -11,6 +11,7 @@ global: enableSRDS: true # -- Whether to enable Redis(redis-stack-server) for Higress, default is false. enableRedis: false + enablePluginServer: false onDemandRDS: false hostRDSMergeSubset: false onlyPushRouteCluster: true @@ -767,4 +768,31 @@ redis: accessModes: - ReadWriteOnce # -- Persistent Volume size - size: 1Gi \ No newline at end of file + size: 1Gi + +pluginServer: + name: "higress-plugin-server" + # -- Number of Higress Plugin Server pods, 2 recommended for high availability + replicas: 2 + image: plugin-server + + hub: higress-registry.cn-hangzhou.cr.aliyuncs.com/higress + tag: "" + + imagePullSecrets: [] + + labels: {} + # -- Labels to apply to the pod + podLabels: {} + + # Plugin-server Service configuration + service: + port: 80 # Container target port (usually fixed) + + resources: + requests: + cpu: 200m + memory: 128Mi + limits: + cpu: 500m + memory: 256Mi \ No newline at end of file diff --git a/helm/higress/README.md b/helm/higress/README.md index 835387f17..cbc25c398 100644 --- a/helm/higress/README.md +++ b/helm/higress/README.md @@ -165,6 +165,7 @@ The command removes all the Kubernetes components associated with the chart and | global.enableIPv6 | bool | `false` | | | global.enableIstioAPI | bool | `true` | If true, Higress Controller will monitor istio resources as well | | global.enableLDSCache | bool | `false` | | +| global.enablePluginServer | bool | `false` | | | global.enableProxyProtocol | bool | `false` | | | global.enablePushAllMCPClusters | bool | `true` | | | global.enableRedis | bool | `false` | Whether to enable Redis(redis-stack-server) for Higress, default is false. | @@ -273,6 +274,19 @@ The command removes all the Kubernetes components associated with the chart and | pilot.serviceAnnotations | object | `{}` | | | pilot.tag | string | `""` | | | pilot.traceSampling | float | `1` | | +| pluginServer.hub | string | `"higress-registry.cn-hangzhou.cr.aliyuncs.com/higress"` | | +| pluginServer.image | string | `"plugin-server"` | | +| pluginServer.imagePullSecrets | list | `[]` | | +| pluginServer.labels | object | `{}` | | +| pluginServer.name | string | `"higress-plugin-server"` | | +| pluginServer.podLabels | object | `{}` | Labels to apply to the pod | +| pluginServer.replicas | int | `2` | Number of Higress Plugin Server pods, 2 recommended for high availability | +| pluginServer.resources.limits.cpu | string | `"500m"` | | +| pluginServer.resources.limits.memory | string | `"256Mi"` | | +| pluginServer.resources.requests.cpu | string | `"200m"` | | +| pluginServer.resources.requests.memory | string | `"128Mi"` | | +| pluginServer.service.port | int | `80` | | +| pluginServer.tag | string | `""` | | | redis.redis.affinity | object | `{}` | Affinity for Redis | | redis.redis.image | string | `"redis-stack-server"` | Specify the image | | redis.redis.name | string | `"redis-stack-server"` | |