Tim Schwalbe
Tim Schwalbe

Reputation: 1736

How to assign an external IP to the Istio Ingress Gateway with IstioOperator? [GKE]

I want to assign an external IP to the Ingress Gateway of Istio.

I want to use the Istio Operator Spec. So far I got this:

apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
  namespace: istio-system
  name: istiocontrolplane
spec:
  profile: demo
  components:
    ingressGateways:
    - name: istio-ingressgateway
      enabled: true
      loadBalancerIP: 1.2.3.4
  addonComponents:
    grafana:
      enabled: false
    prometheus:
      enabled: true

It's assigning an automatically IP to the Service:

kubectl get svc -n istio-system

Is not showing 1.2.3.4. for the EXTERNAL-IP

Is it only possible if I really own this IP over GCP?

Upvotes: 1

Views: 1471

Answers (1)

Nadeem Hussain
Nadeem Hussain

Reputation: 186

First you have to create an IP resource in GCP, and then you can give that IP here in the yaml below.

apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
  components:
    ingressGateways:
      - enabled: true
        k8s:
          overlays:
            - api_version: autoscaling/v1
              kind: HorizontalPodAutoscaler
              name: istio-ingressgateway
              patches:
                - path: spec.minReplicas
                  value: 3
                - path: spec.maxReplicas
                  value: 5
                - path: spec.metrics[0].resource.targetAverageUtilization
                  value: 60
          service:
            loadBalancerIP: XXX.XXX.XXX.XXX
            loadBalancerSourceRanges: []
            ports:
              - name: status-port
                port: 15020
                targetPort: 15020
              - name: http2
                port: 80
                targetPort: 80
              - name: https
                port: 443
              - name: tcp
                port: 31400
                targetPort: 31400
              - name: tls
                port: 15443
                targetPort: 15443
        label:
          app: istio-ingressgateway
          istio: ingressgateway
        name: istio-ingressgateway

Upvotes: 4

Related Questions