UNCLASSIFIED

controlplane.yaml 8.66 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:
Nick Nellis's avatar
Nick Nellis committed
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
    pilot:
      k8s:
{{- if and .Values.istiod.hpaSpec.maxReplicas .Values.istiod.hpaSpec.minReplicas }}
        hpaSpec:
          maxReplicas: {{ .Values.istiod.hpaSpec.maxReplicas }}
          minReplicas: {{ .Values.istiod.hpaSpec.minReplicas }}
          scaleTargetRef:
            apiVersion: apps/v1
            kind: Deployment
            name: istiod
          metrics:
            {{- toYaml .Values.istiod.hpaSpec.metrics | nindent 12 }}
{{- end }}
        replicaCount: {{ .Values.istiod.replicaCount }}
        resources:
          {{- toYaml .Values.istiod.resources | nindent 10 }}
        strategy:
          {{- toYaml .Values.istiod.strategy | nindent 10 }}
        serviceAnnotations:
          {{- .Values.istiod.serviceAnnotations | default (dict) | toYaml | nindent 10 }}
        podAnnotations:
          {{- .Values.istiod.podAnnotations | default (dict) | toYaml | nindent 10 }}
        nodeSelector:
          {{- .Values.istiod.nodeSelector | default (dict) | toYaml | nindent 10 }}
        affinity:
          {{- .Values.istiod.affinity | default (dict) | toYaml | nindent 10 }}
        tolerations:
          {{- .Values.istiod.tolerations | default (list) | toYaml | nindent 10 }}
40
    {{- if .Values.openshift }}
Nick Nellis's avatar
Nick Nellis committed
41
    {{- with .Values.cni }}
42 43 44
    cni:
      enabled: true
      namespace: kube-system
Nick Nellis's avatar
Nick Nellis committed
45 46 47 48 49 50 51 52 53 54 55
      k8s:
        podAnnotations:
          {{- .podAnnotations | default (dict) | toYaml | nindent 10 }}
        nodeSelector:
          {{- .nodeSelector | default (dict) | toYaml | nindent 10 }}
        tolerations:
          {{- .tolerations | default (list) | toYaml | nindent 10 }}
        affinity:
          {{- .affinity | default (dict) | toYaml | nindent 10 }}
    {{- end }}
    {{- end }}
Josh Wolf's avatar
Josh Wolf committed
56 57 58 59
    ingressGateways:
      - name: istio-ingressgateway
        namespace: {{ .Release.Namespace }}
        enabled: true
60 61
        label:
          {{- toYaml .Values.ingressGateway.labels | default (dict) | nindent 10 }}
Josh Wolf's avatar
Josh Wolf committed
62
        k8s:
63
          service:
64
            type: {{ .Values.ingressGateway.type }}
65
            ports:
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
              {{- 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
85 86 87 88
          hpaSpec:
            minReplicas: {{ .Values.ingressGateway.minReplicas }}
            maxReplicas: {{ .Values.ingressGateway.maxReplicas }}
            metrics:
Nick Nellis's avatar
Nick Nellis committed
89
              {{- toYaml .Values.ingressGateway.scaleMetrics | nindent 12 }}
Josh Wolf's avatar
Josh Wolf committed
90 91 92 93 94 95 96 97
            scaleTargetRef:
              apiVersion: apps/v1
              kind: Deployment
              name: istio-ingressgateway
          strategy:
            rollingUpdate:
              maxSurge: 100%
              maxUnavailable: 25%
98
          resources:
Nick Nellis's avatar
Nick Nellis committed
99
            {{- toYaml .Values.ingressGateway.resources | indent 12 }}
Josh Wolf's avatar
Josh Wolf committed
100
          serviceAnnotations:
101 102 103 104 105
            {{- .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 }}
Nick Nellis's avatar
Nick Nellis committed
106 107
          affinity:
            {{- .Values.ingressGateway.affinity | default (dict) | toYaml | nindent 12 }}
108 109
          tolerations:
            {{- .Values.ingressGateway.tolerations | default (list) | toYaml | nindent 12 }}
110 111
      {{- range $i := .Values.extraIngressGateways }}
      - name: {{ $i.name }}
112
        namespace: {{ $.Release.Namespace }}
Josh Wolf's avatar
Josh Wolf committed
113
        enabled: true
114
        label:
115
          {{- toYaml $i.labels | default (dict) | nindent 10 }}
Josh Wolf's avatar
Josh Wolf committed
116
        k8s:
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
          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 }}
Nick Nellis's avatar
Nick Nellis committed
139
          {{- if $i.k8s.hpaSpec }}
Josh Wolf's avatar
Josh Wolf committed
140
          hpaSpec:
141 142
            minReplicas: {{ $i.k8s.hpaSpec.minReplicas }}
            maxReplicas: {{ $i.k8s.hpaSpec.maxReplicas }}
Josh Wolf's avatar
Josh Wolf committed
143
            metrics:
Nick Nellis's avatar
Nick Nellis committed
144 145 146 147
              {{ if $i.k8s.hpaSpec.metrics }}
              {{- toYaml $i.k8s.hpaSpec.metrics | indent 12 }}
              {{ else }}
              {{- /* default metrics, backwards compatible */}}
Josh Wolf's avatar
Josh Wolf committed
148 149 150 151
              - type: Resource
                resource:
                  name: cpu
                  targetAverageUtilization: 60
Nick Nellis's avatar
Nick Nellis committed
152
            {{- end }}
Josh Wolf's avatar
Josh Wolf committed
153 154 155
            scaleTargetRef:
              apiVersion: apps/v1
              kind: Deployment
156
              name: {{ $i.name }}
Nick Nellis's avatar
Nick Nellis committed
157
          {{- end }}
Josh Wolf's avatar
Josh Wolf committed
158 159 160 161
          strategy:
            rollingUpdate:
              maxSurge: 100%
              maxUnavailable: 25%
162
          resources:
Nick Nellis's avatar
Nick Nellis committed
163
            {{- toYaml .k8s.resources | nindent 12 }}
Josh Wolf's avatar
Josh Wolf committed
164
          serviceAnnotations:
165 166 167 168 169
            {{- .k8s.serviceAnnotations | default (dict) | toYaml | nindent 12 }}
          podAnnotations:
            {{- .k8s.podAnnotations | default (dict) | toYaml | nindent 12 }}
          nodeSelector:
            {{- .k8s.nodeSelector | default (dict) | toYaml | nindent 12 }}
Nick Nellis's avatar
Nick Nellis committed
170 171
          affinity:
            {{- .k8s.affinity | default (dict) | toYaml | nindent 12 }}
172 173
          tolerations:
            {{- .k8s.tolerations | default (list) | toYaml | nindent 12 }}
Josh Wolf's avatar
Josh Wolf committed
174 175 176 177
  {{- end }}

  meshConfig:
    accessLogFile: /dev/stdout
runyontr's avatar
runyontr committed
178 179 180 181 182
    enableTracing: {{ .Values.tracing.enabled }}
    defaultConfig:
      tracing:
        sampling: {{ .Values.tracing.sampling }}
      zipkinAddress: {{ .Values.tracing.address }}:{{.Values.tracing.port}}
Nick Nellis's avatar
Nick Nellis committed
183 184 185
    {{- if .Values.meshConfig }}
    {{- toYaml .Values.meshConfig | nindent 4 }}
    {{- end }}
Josh Wolf's avatar
Josh Wolf committed
186 187

  values:
188 189 190 191 192 193 194
    {{- if .Values.openshift }}
    cni:
      repair:
        enabled: false
      image: {{ .Values.cni.image.name }}
      hub: {{ .Values.cni.image.hub }}
      tag: {{ .Values.cni.image.tag }}
Nick Nellis's avatar
Nick Nellis committed
195 196
      cniBinDir: {{ .Values.cni.binDir | default "/var/lib/cni/bin" }}
      cniConfDir: {{ .Values.cni.confDir | default "/etc/cni/multus/net.d" }}
197
      chained: false
Nick Nellis's avatar
Nick Nellis committed
198
      cniConfFileName: {{ .Values.cni.confFileName | default "istio-cni.conf" }}
199 200 201
      excludeNamespaces:
       - istio-system
       - kube-system
Nick Nellis's avatar
Nick Nellis committed
202
      logLevel: {{ .Values.cni.logLevel | default "info" }}
203
    {{- end }}
Josh Wolf's avatar
Josh Wolf committed
204
    global:
Nick Nellis's avatar
Nick Nellis committed
205 206 207
      {{- if .Values.imagePullPolicy }}
      imagePullPolicy: {{ .Values.imagePullPolicy }}
      {{- end }}
Josh Wolf's avatar
Josh Wolf committed
208 209 210 211
      {{- with .Values.imagePullSecrets }}
      imagePullSecrets:
        {{- toYaml . | nindent 8 }}
      {{- end }}
Nick Nellis's avatar
Nick Nellis committed
212
      {{- if .Values.tracing.enabled }}
runyontr's avatar
runyontr committed
213 214 215
      tracer:
        zipkin:
          address: {{ .Values.tracing.address }}:{{.Values.tracing.port}}
Nick Nellis's avatar
Nick Nellis committed
216 217 218
      {{ end }}
      {{- if .Values.values.global }}
      {{- toYaml .Values.values.global | nindent 6 }}
219
      {{- end }}
Josh Wolf's avatar
Josh Wolf committed
220 221
    sidecarInjectorWebhook:
      rewriteAppHTTPProbe: true
222 223 224 225
      {{- if .Values.openshift }}
      injectedAnnotations:
        k8s.v1.cni.cncf.io/networks: istio-cni
      {{- end }}
Josh Wolf's avatar
Josh Wolf committed
226 227 228 229 230 231

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