istio.io/istio@v0.0.0-20240520182934-d79c90f27776/manifests/charts/istiod-remote/templates/configmap.yaml (about)

     1  {{- define "mesh" }}
     2      # The trust domain corresponds to the trust root of a system.
     3      # Refer to https://github.com/spiffe/spiffe/blob/master/standards/SPIFFE-ID.md#21-trust-domain
     4      trustDomain: "cluster.local"
     5  
     6      # The namespace to treat as the administrative root namespace for Istio configuration.
     7      # When processing a leaf namespace Istio will search for declarations in that namespace first
     8      # and if none are found it will search in the root namespace. Any matching declaration found in the root namespace
     9      # is processed as if it were declared in the leaf namespace.
    10      rootNamespace: {{ .Values.meshConfig.rootNamespace | default .Values.global.istioNamespace }}
    11  
    12    {{ $prom := include "default-prometheus" . | eq "true" }}
    13    {{ $sdMetrics := include "default-sd-metrics" . | eq "true" }}
    14    {{ $sdLogs := include "default-sd-logs" . | eq "true" }}
    15    {{- if or $prom $sdMetrics $sdLogs }}
    16      defaultProviders:
    17      {{- if or $prom $sdMetrics }}
    18        metrics:
    19        {{ if $prom }}- prometheus{{ end }}
    20        {{ if and $sdMetrics $sdLogs }}- stackdriver{{ end }}
    21      {{- end }}
    22      {{- if and $sdMetrics $sdLogs }}
    23        accessLogging:
    24        - stackdriver
    25      {{- end }}
    26    {{- end }}
    27  
    28      defaultConfig:
    29        {{- if .Values.global.meshID }}
    30        meshId: "{{ .Values.global.meshID }}"
    31        {{- end }}
    32        {{- with (.Values.global.proxy.variant | default .Values.global.variant) }}
    33        image:
    34          imageType: {{. | quote}}
    35        {{- end }}
    36        {{- if not (eq .Values.global.proxy.tracer "none") }}
    37        tracing:
    38        {{- if eq .Values.global.proxy.tracer "lightstep" }}
    39          lightstep:
    40            # Address of the LightStep Satellite pool
    41            address: {{ .Values.global.tracer.lightstep.address }}
    42            # Access Token used to communicate with the Satellite pool
    43            accessToken: {{ .Values.global.tracer.lightstep.accessToken }}
    44        {{- else if eq .Values.global.proxy.tracer "zipkin" }}
    45          zipkin:
    46            # Address of the Zipkin collector
    47            address: {{ ((.Values.global.tracer).zipkin).address | default (print "zipkin." .Values.global.istioNamespace ":9411") }}
    48        {{- else if eq .Values.global.proxy.tracer "datadog" }}
    49          datadog:
    50            # Address of the Datadog Agent
    51            address: {{ ((.Values.global.tracer).datadog).address | default "$(HOST_IP):8126" }}
    52        {{- else if eq .Values.global.proxy.tracer "stackdriver" }}
    53          stackdriver:
    54            # enables trace output to stdout.
    55            debug: {{ (($.Values.global.tracer).stackdriver).debug | default "false" }}
    56            # The global default max number of attributes per span.
    57            maxNumberOfAttributes: {{ (($.Values.global.tracer).stackdriver).maxNumberOfAttributes | default "200" }}
    58            # The global default max number of annotation events per span.
    59            maxNumberOfAnnotations: {{ (($.Values.global.tracer).stackdriver).maxNumberOfAnnotations | default "200" }}
    60            # The global default max number of message events per span.
    61            maxNumberOfMessageEvents: {{ (($.Values.global.tracer).stackdriver).maxNumberOfMessageEvents | default "200" }}
    62        {{- else if eq .Values.global.proxy.tracer "openCensusAgent" }}
    63        {{/* Fill in openCensusAgent configuration from meshConfig so it isn't overwritten below */}}
    64  {{ toYaml $.Values.meshConfig.defaultConfig.tracing | indent 8 }}
    65        {{- end }}
    66        {{- end }}
    67        {{- if .Values.global.remotePilotAddress }}
    68        {{- if .Values.pilot.enabled }}
    69        discoveryAddress: {{ printf "istiod-remote.%s.svc" .Release.Namespace }}:15012
    70        {{- else }}
    71        discoveryAddress: {{ printf "istiod.%s.svc" .Release.Namespace }}:15012
    72        {{- end }}
    73        {{- else }}
    74        discoveryAddress: istiod{{- if not (eq .Values.revision "") }}-{{ .Values.revision }}{{- end }}.{{.Release.Namespace}}.svc:15012
    75        {{- end }}
    76  {{- end }}
    77  
    78  {{/* We take the mesh config above, defined with individual values.yaml, and merge with .Values.meshConfig */}}
    79  {{/* The intent here is that meshConfig.foo becomes the API, rather than re-inventing the API in values.yaml */}}
    80  {{- $originalMesh := include "mesh" . | fromYaml }}
    81  {{- $mesh := mergeOverwrite $originalMesh .Values.meshConfig }}
    82  
    83  {{- if .Values.pilot.configMap }}
    84  apiVersion: v1
    85  kind: ConfigMap
    86  metadata:
    87    name: istio{{- if not (eq .Values.revision "") }}-{{ .Values.revision }}{{- end }}
    88    namespace: {{ .Release.Namespace }}
    89    labels:
    90      istio.io/rev: {{ .Values.revision | default "default" | quote }}
    91      install.operator.istio.io/owning-resource: {{ .Values.ownerName | default "unknown" }}
    92      operator.istio.io/component: "Pilot"
    93      release: {{ .Release.Name }}
    94  data:
    95  
    96    # Configuration file for the mesh networks to be used by the Split Horizon EDS.
    97    meshNetworks: |-
    98    {{- if .Values.global.meshNetworks }}
    99      networks:
   100  {{ toYaml .Values.global.meshNetworks | trim | indent 6 }}
   101    {{- else }}
   102      networks: {}
   103    {{- end }}
   104  
   105    mesh: |-
   106  {{- if .Values.meshConfig }}
   107  {{ $mesh | toYaml | indent 4 }}
   108  {{- else }}
   109  {{- include "mesh" . }}
   110  {{- end }}
   111  ---
   112  {{- end }}