diff --git a/helm/core/templates/configmap.yaml b/helm/core/templates/configmap.yaml index bc687280f..e01e8444a 100644 --- a/helm/core/templates/configmap.yaml +++ b/helm/core/templates/configmap.yaml @@ -115,4 +115,64 @@ data: {{- include "mesh" . }} {{- end }} --- +{{- if .Values.enableSkywalking }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: higress-custom-bootstrap + namespace: {{ .Release.Namespace }} + labels: + {{- include "gateway.labels" . | nindent 4 }} +data: + custom_bootstrap.json: |- + { + "stats_sinks": [ + { + "name": "envoy.metrics_service", + "typed_config": { + "@type": "type.googleapis.com/envoy.config.metrics.v3.MetricsServiceConfig", + "transport_api_version": "V3", + "grpc_service": { + "envoy_grpc": { + "cluster_name": "service_skywalking" + } + } + } + } + ], + "static_resources": { + "clusters": [ + { + "name": "service_skywalking", + "type": "LOGICAL_DNS", + "connect_timeout": "5s", + "http2_protocol_options": { + }, + "dns_lookup_family": "V4_ONLY", + "lb_policy": "ROUND_ROBIN", + "load_assignment": { + "cluster_name": "service_skywalking", + "endpoints": [ + { + "lb_endpoints": [ + { + "endpoint": { + "address": { + "socket_address": { + "address": "{{ .Values.Skywalking.address }}", + "port_value": "{{ .Values.Skywalking.port }}" + } + } + } + } + ] + } + ] + } + } + ] + } + } +--- +{{- end }} diff --git a/helm/core/templates/deployment.yaml b/helm/core/templates/deployment.yaml index 18ace4154..cdc425e0c 100644 --- a/helm/core/templates/deployment.yaml +++ b/helm/core/templates/deployment.yaml @@ -136,6 +136,10 @@ spec: value: "{{ $.Values.clusterName | default `Kubernetes` }}" - name: INSTANCE_NAME value: "higress-gateway" + {{- if .Values.enableSkywalking }} + - name: ISTIO_BOOTSTRAP_OVERRIDE + value: /etc/istio/custom-bootstrap/custom_bootstrap.json + {{- end }} {{- with .Values.gateway.networkGateway }} - name: ISTIO_META_REQUESTED_NETWORK_VIEW value: "{{.}}" @@ -188,6 +192,10 @@ spec: mountPath: /etc/istio/pod - name: proxy-socket mountPath: /etc/istio/proxy + {{- if .Values.enableSkywalking }} + - mountPath: /etc/istio/custom-bootstrap + name: custom-bootstrap-volume + {{- end }} {{- if .Values.gateway.hostNetwork }} hostNetwork: {{ .Values.gateway.hostNetwork }} dnsPolicy: ClusterFirstWithHostNet @@ -224,7 +232,13 @@ spec: - name: config configMap: name: higress-config - - name: istio-data + {{- if .Values.enableSkywalking }} + - configMap: + defaultMode: 420 + name: higress-custom-bootstrap + name: custom-bootstrap-volume + {{- end }} + - name: istio-data emptyDir: {} - name: proxy-socket emptyDir: {} diff --git a/helm/core/values.yaml b/helm/core/values.yaml index 0aae899bb..5ca5f5b14 100644 --- a/helm/core/values.yaml +++ b/helm/core/values.yaml @@ -603,3 +603,10 @@ pilot: # Additional labels to apply on the pod level for monitoring and logging configuration. podLabels: {} + + +# Skywalking config settings +enableSkywalking: false +Skywalking: + address: "skywalking-oap.higress-system.svc" + port: 11800 \ No newline at end of file