UNCLASSIFIED

controlplane.yaml 6.74 KB
Newer Older
Josh Wolf's avatar
Josh Wolf committed
1 2 3 4 5 6 7 8 9 10 11
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
  name: istiocontrolplane
  namespace: {{ .Release.Namespace }}
spec:
  profile: {{ .Values.profile }}
  hub: {{ .Values.hub }}
  tag: {{ .Values.tag }}

  components:
12 13 14 15 16
    {{- if .Values.openshift }}
    cni:
      enabled: true
      namespace: kube-system
    {{- end  }}
Josh Wolf's avatar
Josh Wolf committed
17 18 19 20
    ingressGateways:
      - name: istio-ingressgateway
        namespace: {{ .Release.Namespace }}
        enabled: true
21 22
        label:
          {{- toYaml .Values.ingressGateway.labels | default (dict) | nindent 10 }}
Josh Wolf's avatar
Josh Wolf committed
23
        k8s:
24
          service:
25
            type: {{ .Values.ingressGateway.type }}
26
            ports:
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
              {{- range $k, $v := .Values.ingressGateway.ports }}
              {{- /* Input validation */}}
              {{- if not $v.name }}
                {{- fail "missing field 'name' in ports object" }}
              {{- else if not $v.port }}
                {{- fail "missing field 'port' in ports object" }}
              {{- else if eq $.Values.ingressGateway.type "NodePort" }}
                {{- if not $v.nodePort }}
                  {{- fail "'nodePort' must be defined when type is NodePort" }}
                {{- else if or (lt (int $v.nodePort) 30000) (gt (int $v.nodePort) 32767) }}
                  {{- fail "nodePort value outside of acceptable range (30000-32767)" }}
                {{- end }}
              {{- end }}
              {{- /* Actual port object rendering */}}
              -
                {{- range $pk, $pv := $v }}
                {{ $pk }}: {{ $pv }}
                {{- end }}
              {{- end }}
Josh Wolf's avatar
Josh Wolf committed
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
          hpaSpec:
            minReplicas: {{ .Values.ingressGateway.minReplicas }}
            maxReplicas: {{ .Values.ingressGateway.maxReplicas }}
            metrics:
              - type: Resource
                resource:
                  name: cpu
                  targetAverageUtilization: 60
            scaleTargetRef:
              apiVersion: apps/v1
              kind: Deployment
              name: istio-ingressgateway
          strategy:
            rollingUpdate:
              maxSurge: 100%
              maxUnavailable: 25%
          serviceAnnotations:
63 64 65 66 67 68 69
            {{- .Values.ingressGateway.serviceAnnotations | default (dict) | toYaml | nindent 12 }}
          podAnnotations:
            {{- .Values.ingressGateway.podAnnotations | default (dict) | toYaml | nindent 12 }}
          nodeSelector:
            {{- .Values.ingressGateway.nodeSelector | default (dict) | toYaml | nindent 12 }}
          tolerations:
            {{- .Values.ingressGateway.tolerations | default (list) | toYaml | nindent 12 }}
70 71
      {{- range $i := .Values.extraIngressGateways }}
      - name: {{ $i.name }}
Josh Wolf's avatar
Josh Wolf committed
72
        enabled: true
73 74
        label:
          {{- $i.labels | default (dict) | toYaml | nindent 10 }}
Josh Wolf's avatar
Josh Wolf committed
75
        k8s:
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
          service:
            type: {{ $i.type }}
            ports:
              {{- range $k, $v := $i.ports }}
              {{- /* Input validation */}}
              {{- if not $v.name }}
                {{- fail "missing field 'name' in ports object" }}
              {{- else if not $v.port }}
                {{- fail "missing field 'port' in ports object" }}
              {{- else if eq $i.type "NodePort" }}
                {{- if not $v.nodePort }}
                  {{- fail "'nodePort' must be defined when type is NodePort" }}
                {{- else if or (lt (int $v.nodePort) 30000) (gt (int $v.nodePort) 32767) }}
                  {{- fail "nodePort value outside of acceptable range (30000-32767)" }}
                {{- end }}
              {{- end }}
              {{- /* Actual port object rendering */}}
              -
                {{- range $pk, $pv := $v }}
                {{ $pk }}: {{ $pv }}
                {{- end }}
              {{- end }}
Josh Wolf's avatar
Josh Wolf committed
98
          hpaSpec:
99 100
            minReplicas: {{ $i.k8s.hpaSpec.minReplicas }}
            maxReplicas: {{ $i.k8s.hpaSpec.maxReplicas }}
Josh Wolf's avatar
Josh Wolf committed
101 102 103 104 105 106 107 108
            metrics:
              - type: Resource
                resource:
                  name: cpu
                  targetAverageUtilization: 60
            scaleTargetRef:
              apiVersion: apps/v1
              kind: Deployment
109
              name: {{ $i.name }}
Josh Wolf's avatar
Josh Wolf committed
110 111 112 113 114
          strategy:
            rollingUpdate:
              maxSurge: 100%
              maxUnavailable: 25%
          serviceAnnotations:
115 116 117 118 119 120 121
            {{- .k8s.serviceAnnotations | default (dict) | toYaml | nindent 12 }}
          podAnnotations:
            {{- .k8s.podAnnotations | default (dict) | toYaml | nindent 12 }}
          nodeSelector:
            {{- .k8s.nodeSelector | default (dict) | toYaml | nindent 12 }}
          tolerations:
            {{- .k8s.tolerations | default (list) | toYaml | nindent 12 }}
Josh Wolf's avatar
Josh Wolf committed
122 123 124 125 126 127 128 129 130 131 132 133
  {{- end }}

  addonComponents:
    kiali:
      enabled: {{ .Values.kiali.enabled }}
    tracing:
      enabled: {{ .Values.tracing.enabled }}

  meshConfig:
    accessLogFile: /dev/stdout

  values:
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
    {{- if .Values.openshift }}
    cni:
      repair:
        enabled: false
      image: {{ .Values.cni.image.name }}
      hub: {{ .Values.cni.image.hub }}
      tag: {{ .Values.cni.image.tag }}
      cniBinDir: /var/lib/cni/bin
      cniConfDir: /etc/cni/multus/net.d
      chained: false
      cniConfFileName: "istio-cni.conf"
      excludeNamespaces:
       - istio-system
       - kube-system
      logLevel: info
    {{- end }}
Josh Wolf's avatar
Josh Wolf committed
150 151 152 153 154
    global:
      {{- with .Values.imagePullSecrets }}
      imagePullSecrets:
        {{- toYaml . | nindent 8 }}
      {{- end }}
Nick Nellis's avatar
Nick Nellis committed
155 156 157 158 159 160 161 162
      {{- if .Values.proxy }}
      {{- if .Values.proxy.image }}
      proxy:
        image: {{ .Values.proxy.image }}
      proxy_init:
        image: {{ .Values.proxy.image }}
      {{- end }}
      {{- end }}
163
    # https://istio.io/v1.5/docs/reference/config/installation-options/#kiali-options
Josh Wolf's avatar
Josh Wolf committed
164 165 166 167
    kiali:
      image: {{ .Values.kiali.image.name }}
      hub: {{ .Values.kiali.image.hub }}
      tag: {{ .Values.kiali.image.tag }}
168 169 170
      {{- if .Values.monitoring.enabled }}
      prometheusAddr: http://monitoring-monitoring-kube-prometheus.monitoring.svc:9090
      {{- end }}
Josh Wolf's avatar
Josh Wolf committed
171
      dashboard:
172
        jaegerURL: "https://{{ tpl (index .Values.istio.jaeger.hosts 0) .}}"
173
        grafanaInClusterURL: http://monitoring-monitoring-grafana.monitoring.svc
Josh Wolf's avatar
Josh Wolf committed
174 175 176 177 178
        auth:
          strategy: {{ .Values.kiali.dashboard.auth.strategy }}

    sidecarInjectorWebhook:
      rewriteAppHTTPProbe: true
179 180 181 182
      {{- if .Values.openshift }}
      injectedAnnotations:
        k8s.v1.cni.cncf.io/networks: istio-cni
      {{- end }}
Josh Wolf's avatar
Josh Wolf committed
183 184 185 186 187 188 189 190 191 192 193 194

      neverInjectSelector:
        - matchExpressions:
            - key: app.kubernetes.io/component
              operator: In
              values: [fluentd-configcheck]

    tracing:
      jaeger:
        image: {{ .Values.tracing.image.name }}
        hub: {{ .Values.tracing.image.hub }}
        tag: {{ .Values.tracing.image.tag}}