mirror of
https://github.com/alibaba/higress.git
synced 2026-06-25 18:25:10 +08:00
feat: Plugin server supports k8s deployment and configures the default download URL of the plugin(#2232, #2280,#2312) (#2389)
Co-authored-by: xujingfeng <jingfeng.xjf@alibaba-inc.com> Co-authored-by: 澄潭 <zty98751@alibaba-inc.com>
This commit is contained in:
@@ -113,3 +113,36 @@ kind: VMPodScrape
|
|||||||
{{- fail "unexpected gateway.metrics.provider" -}}
|
{{- fail "unexpected gateway.metrics.provider" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- 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 }}
|
||||||
|
|||||||
39
helm/core/templates/plugin-server-deployment.yaml
Normal file
39
helm/core/templates/plugin-server-deployment.yaml
Normal file
@@ -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 }}
|
||||||
16
helm/core/templates/plugin-server-service.yaml
Normal file
16
helm/core/templates/plugin-server-service.yaml
Normal file
@@ -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 }}
|
||||||
@@ -11,6 +11,7 @@ global:
|
|||||||
enableSRDS: true
|
enableSRDS: true
|
||||||
# -- Whether to enable Redis(redis-stack-server) for Higress, default is false.
|
# -- Whether to enable Redis(redis-stack-server) for Higress, default is false.
|
||||||
enableRedis: false
|
enableRedis: false
|
||||||
|
enablePluginServer: false
|
||||||
onDemandRDS: false
|
onDemandRDS: false
|
||||||
hostRDSMergeSubset: false
|
hostRDSMergeSubset: false
|
||||||
onlyPushRouteCluster: true
|
onlyPushRouteCluster: true
|
||||||
@@ -768,3 +769,30 @@ redis:
|
|||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
# -- Persistent Volume size
|
# -- Persistent Volume size
|
||||||
size: 1Gi
|
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
|
||||||
@@ -165,6 +165,7 @@ The command removes all the Kubernetes components associated with the chart and
|
|||||||
| global.enableIPv6 | bool | `false` | |
|
| global.enableIPv6 | bool | `false` | |
|
||||||
| global.enableIstioAPI | bool | `true` | If true, Higress Controller will monitor istio resources as well |
|
| global.enableIstioAPI | bool | `true` | If true, Higress Controller will monitor istio resources as well |
|
||||||
| global.enableLDSCache | bool | `false` | |
|
| global.enableLDSCache | bool | `false` | |
|
||||||
|
| global.enablePluginServer | bool | `false` | |
|
||||||
| global.enableProxyProtocol | bool | `false` | |
|
| global.enableProxyProtocol | bool | `false` | |
|
||||||
| global.enablePushAllMCPClusters | bool | `true` | |
|
| global.enablePushAllMCPClusters | bool | `true` | |
|
||||||
| global.enableRedis | bool | `false` | Whether to enable Redis(redis-stack-server) for Higress, default is false. |
|
| 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.serviceAnnotations | object | `{}` | |
|
||||||
| pilot.tag | string | `""` | |
|
| pilot.tag | string | `""` | |
|
||||||
| pilot.traceSampling | float | `1` | |
|
| 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.affinity | object | `{}` | Affinity for Redis |
|
||||||
| redis.redis.image | string | `"redis-stack-server"` | Specify the image |
|
| redis.redis.image | string | `"redis-stack-server"` | Specify the image |
|
||||||
| redis.redis.name | string | `"redis-stack-server"` | |
|
| redis.redis.name | string | `"redis-stack-server"` | |
|
||||||
|
|||||||
Reference in New Issue
Block a user