From 9a9e924037cd29311f94003c2cd0c09e4a5af28b Mon Sep 17 00:00:00 2001 From: Kent Dong Date: Wed, 24 Jul 2024 11:25:16 +0800 Subject: [PATCH] feat: Make higress-core and higress-gateway as the default container (#1144) --- .../core/templates/controller-deployment.yaml | 116 +++++++++--------- helm/core/templates/deployment.yaml | 68 +++++----- 2 files changed, 92 insertions(+), 92 deletions(-) diff --git a/helm/core/templates/controller-deployment.yaml b/helm/core/templates/controller-deployment.yaml index c7cc08284..01b3e1fa3 100644 --- a/helm/core/templates/controller-deployment.yaml +++ b/helm/core/templates/controller-deployment.yaml @@ -32,6 +32,64 @@ spec: securityContext: {{- toYaml .Values.controller.podSecurityContext | nindent 8 }} containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.controller.securityContext | nindent 12 }} + image: "{{ .Values.controller.hub | default .Values.global.hub }}/{{ .Values.controller.image | default "higress" }}:{{ .Values.controller.tag | default .Chart.AppVersion }}" + args: + - "serve" + - --gatewaySelectorKey=higress + - --gatewaySelectorValue={{ .Release.Namespace }}-{{ include "gateway.name" . }} + - --gatewayHttpPort={{ .Values.gateway.httpPort }} + - --gatewayHttpsPort={{ .Values.gateway.httpsPort }} + {{- if not .Values.global.enableStatus }} + - --enableStatus={{ .Values.global.enableStatus }} + {{- end }} + - --ingressClass={{ .Values.global.ingressClass }} + {{- if .Values.global.watchNamespace }} + - --watchNamespace={{ .Values.global.watchNamespace }} + {{- end }} + - --enableAutomaticHttps={{ .Values.controller.automaticHttps.enabled }} + - --automaticHttpsEmail={{ .Values.controller.automaticHttps.email }} + env: + - name: POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: SERVICE_ACCOUNT + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.serviceAccountName + - name: DOMAIN_SUFFIX + value: {{ .Values.global.proxy.clusterDomain }} + {{- if .Values.controller.env }} + {{- range $key, $val := .Values.controller.env }} + - name: {{ $key }} + value: "{{ $val }}" + {{- end }} + {{- end }} + ports: + {{- range $idx, $port := .Values.controller.ports }} + - name: {{ $port.name }} + containerPort: {{ $port.port }} + protocol: {{ $port.protocol }} + {{- end }} + readinessProbe: + {{- toYaml .Values.controller.probe | nindent 12 }} + {{- if not (or .Values.global.local .Values.global.kind) }} + resources: + {{- toYaml .Values.controller.resources | nindent 12 }} + {{- end }} + volumeMounts: + - name: log + mountPath: /var/log {{- if not .Values.global.enableHigressIstio }} - name: discovery image: "{{ .Values.pilot.hub | default .Values.global.hub }}/{{ .Values.pilot.image | default "pilot" }}:{{ .Values.pilot.tag | default .Chart.AppVersion }}" @@ -194,64 +252,6 @@ spec: mountPath: /cacerts {{- end }} {{- end }} - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.controller.securityContext | nindent 12 }} - image: "{{ .Values.controller.hub | default .Values.global.hub }}/{{ .Values.controller.image | default "higress" }}:{{ .Values.controller.tag | default .Chart.AppVersion }}" - args: - - "serve" - - --gatewaySelectorKey=higress - - --gatewaySelectorValue={{ .Release.Namespace }}-{{ include "gateway.name" . }} - - --gatewayHttpPort={{ .Values.gateway.httpPort }} - - --gatewayHttpsPort={{ .Values.gateway.httpsPort }} - {{- if not .Values.global.enableStatus }} - - --enableStatus={{ .Values.global.enableStatus }} - {{- end }} - - --ingressClass={{ .Values.global.ingressClass }} - {{- if .Values.global.watchNamespace }} - - --watchNamespace={{ .Values.global.watchNamespace }} - {{- end }} - - --enableAutomaticHttps={{ .Values.controller.automaticHttps.enabled }} - - --automaticHttpsEmail={{ .Values.controller.automaticHttps.email }} - env: - - name: POD_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - - name: SERVICE_ACCOUNT - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: spec.serviceAccountName - - name: DOMAIN_SUFFIX - value: {{ .Values.global.proxy.clusterDomain }} - {{- if .Values.controller.env }} - {{- range $key, $val := .Values.controller.env }} - - name: {{ $key }} - value: "{{ $val }}" - {{- end }} - {{- end }} - ports: - {{- range $idx, $port := .Values.controller.ports }} - - name: {{ $port.name }} - containerPort: {{ $port.port }} - protocol: {{ $port.protocol }} - {{- end }} - readinessProbe: - {{- toYaml .Values.controller.probe | nindent 12 }} - {{- if not (or .Values.global.local .Values.global.kind) }} - resources: - {{- toYaml .Values.controller.resources | nindent 12 }} - {{- end }} - volumeMounts: - - name: log - mountPath: /var/log {{- with .Values.controller.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/helm/core/templates/deployment.yaml b/helm/core/templates/deployment.yaml index 8a085927d..3220d4a22 100644 --- a/helm/core/templates/deployment.yaml +++ b/helm/core/templates/deployment.yaml @@ -72,40 +72,6 @@ spec: value: "0" {{- end }} containers: - {{- if $o11y.enabled }} - {{- $config := $o11y.promtail }} - - name: promtail - image: {{ $config.image.repository }}:{{ $config.image.tag }} - imagePullPolicy: IfNotPresent - args: - - -config.file=/etc/promtail/promtail.yaml - env: - - name: 'HOSTNAME' - valueFrom: - fieldRef: - fieldPath: 'spec.nodeName' - ports: - - containerPort: {{ $config.port }} - name: http-metrics - protocol: TCP - readinessProbe: - failureThreshold: 3 - httpGet: - path: /ready - port: {{ $config.port }} - scheme: HTTP - initialDelaySeconds: 10 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 1 - volumeMounts: - - name: promtail-config - mountPath: "/etc/promtail" - - name: log - mountPath: /var/log/proxy - - name: tmp - mountPath: /tmp - {{- end }} - name: higress-gateway image: "{{ .Values.gateway.hub | default .Values.global.hub }}/{{ .Values.gateway.image | default "gateway" }}:{{ .Values.gateway.tag | default .Chart.AppVersion }}" args: @@ -264,6 +230,40 @@ spec: - mountPath: /var/log/proxy name: log {{- end }} + {{- if $o11y.enabled }} + {{- $config := $o11y.promtail }} + - name: promtail + image: {{ $config.image.repository }}:{{ $config.image.tag }} + imagePullPolicy: IfNotPresent + args: + - -config.file=/etc/promtail/promtail.yaml + env: + - name: 'HOSTNAME' + valueFrom: + fieldRef: + fieldPath: 'spec.nodeName' + ports: + - containerPort: {{ $config.port }} + name: http-metrics + protocol: TCP + readinessProbe: + failureThreshold: 3 + httpGet: + path: /ready + port: {{ $config.port }} + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + volumeMounts: + - name: promtail-config + mountPath: "/etc/promtail" + - name: log + mountPath: /var/log/proxy + - name: tmp + mountPath: /tmp + {{- end }} {{- if .Values.gateway.hostNetwork }} hostNetwork: {{ .Values.gateway.hostNetwork }} dnsPolicy: ClusterFirstWithHostNet