From 41f892b26d9180227c401eadf30f9f7e9f104086 Mon Sep 17 00:00:00 2001 From: Kent Dong Date: Tue, 4 Apr 2023 19:46:26 +0800 Subject: [PATCH] feat: Support enabling local deployment mode using "global.local" property (#269) --- Makefile.core.mk | 6 +++--- helm/core/templates/controller-deployment.yaml | 4 ++-- helm/core/templates/deployment.yaml | 8 ++++---- helm/core/values.yaml | 3 ++- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Makefile.core.mk b/Makefile.core.mk index 54fa570ea..cbb90f0b2 100644 --- a/Makefile.core.mk +++ b/Makefile.core.mk @@ -130,20 +130,20 @@ endef install: pre-install cd helm/higress; helm dependency build - helm install higress helm/higress -n higress-system --create-namespace --set 'global.kind=true' + helm install higress helm/higress -n higress-system --create-namespace --set 'global.local=true' ENVOY_LATEST_IMAGE_TAG ?= 0.7.0 ISTIO_LATEST_IMAGE_TAG ?= 0.7.0 install-dev: pre-install - helm install higress helm/core -n higress-system --create-namespace --set 'controller.tag=$(TAG)' --set 'gateway.replicas=1' --set 'gateway.tag=$(ENVOY_LATEST_IMAGE_TAG)' --set 'global.kind=true' + helm install higress helm/core -n higress-system --create-namespace --set 'controller.tag=$(TAG)' --set 'gateway.replicas=1' --set 'gateway.tag=$(ENVOY_LATEST_IMAGE_TAG)' --set 'global.local=true' uninstall: helm uninstall higress -n higress-system upgrade: pre-install cd helm/higress; helm dependency build - helm upgrade higress helm/higress -n higress-system --set 'global.kind=true' + helm upgrade higress helm/higress -n higress-system --set 'global.local=true' helm-push: cp api/kubernetes/customresourcedefinitions.gen.yaml helm/core/crds diff --git a/helm/core/templates/controller-deployment.yaml b/helm/core/templates/controller-deployment.yaml index 78d6704a2..5f072d746 100644 --- a/helm/core/templates/controller-deployment.yaml +++ b/helm/core/templates/controller-deployment.yaml @@ -128,7 +128,7 @@ spec: - name: CUSTOM_CA_CERT_NAME value: "higress-ca-root-cert" {{- end }} - {{- if not .Values.global.kind }} + {{- if not (or .Values.global.local .Values.global.kind) }} resources: {{- if .Values.pilot.resources }} {{ toYaml .Values.pilot.resources | trim | indent 12 }} @@ -210,7 +210,7 @@ spec: {{- end }} readinessProbe: {{- toYaml .Values.controller.probe | nindent 12 }} - {{- if not .Values.global.kind }} + {{- if not (or .Values.global.local .Values.global.kind) }} resources: {{- toYaml .Values.controller.resources | nindent 12 }} {{- end }} diff --git a/helm/core/templates/deployment.yaml b/helm/core/templates/deployment.yaml index b79acd887..4f66c276c 100644 --- a/helm/core/templates/deployment.yaml +++ b/helm/core/templates/deployment.yaml @@ -9,7 +9,7 @@ metadata: {{- .Values.gateway.annotations | toYaml | nindent 4 }} spec: {{- if not .Values.gateway.autoscaling.enabled }} - {{- if not .Values.global.kind }} + {{- if not (or .Values.global.local .Values.global.kind) }} replicas: {{ .Values.gateway.replicas }} {{- else }} replicas: 1 @@ -21,7 +21,7 @@ spec: strategy: rollingUpdate: maxSurge: {{ .Values.gateway.rollingMaxSurge }} - {{- if .Values.global.kind }} + {{- if or .Values.global.local .Values.global.kind }} maxUnavailable: 100% {{- else }} maxUnavailable: {{ .Values.gateway.rollingMaxUnavailable }} @@ -152,7 +152,7 @@ spec: - containerPort: 15090 protocol: TCP name: http-envoy-prom - {{- if .Values.global.kind }} + {{- if or .Values.global.local .Values.global.kind }} - containerPort: 80 hostPort: 80 name: http @@ -172,7 +172,7 @@ spec: periodSeconds: 2 successThreshold: 1 timeoutSeconds: 3 - {{- if not .Values.global.kind }} + {{- if not (or .Values.global.local .Values.global.kind) }} resources: {{- toYaml .Values.gateway.resources | nindent 12 }} {{- end }} diff --git a/helm/core/values.yaml b/helm/core/values.yaml index 7f03625f5..5f3094e75 100644 --- a/helm/core/values.yaml +++ b/helm/core/values.yaml @@ -3,7 +3,8 @@ global: # whether to use autoscaling/v2 template for HPA settings # for internal usage only, not to be configured by users. autoscalingv2API: true - kind: false + local: false # When deploying to a local cluster (e.g.: kind cluster), set this to true. + kind: false # Deprecated. Please use "global.local" instead. Will be removed later. enableIstioAPI: false # Deprecated enableHigressIstio: false