<p>Is it possible to assign a LoadbalancerIP to the ingressgateway using metalLB? Given this yaml it throws an error about loadBalancerIP (&quot;unknown field &quot;loadBalancerIP&quot; in io.istio.networking.v1alpha3.Gateway.spec&quot;), I can get around it by using the '--validate=false' flag but metalLB is not assigning the right IP address?</p>
<p>test.yaml:</p>
<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: httpbin-gateway
spec:
  loadBalancerIP: 10.0.0.242
  selector:
    istio: ingressgateway # use Istio default gateway implementation
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - &quot;*&quot;
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: httpbin
spec:
  hosts:
  - &quot;*&quot;
  gateways:
  - httpbin-gateway
  http:
  - match:
    - uri:
        prefix: /headers
    route:
    - destination:
        port:
          number: 8000
        host: httpbin
</code></pre>
<p>layer2.yaml:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  namespace: metallb-system
  name: config
data:
  config: |
    address-pools:
    - name: nips
      protocol: layer2
      addresses:
      - 10.0.0.206-10.0.0.225
      auto-assign: true
    - name: mainips
      protocol: layer2
      addresses:
      - 10.0.0.230-10.0.0.239
      auto-assign: false
    - name: cheapips
      protocol: layer2
      addresses:
      - 10.0.0.240-10.0.0.249
      auto-assign: false
    - name: web 
      protocol: layer2
      addresses:
      - 10.0.0.203-10.0.0.205
      auto-assign: false
</code></pre>
<p>running the kubectl commands:</p>
<pre><code>$ kubectl apply -f /tmp/test.yaml
error: error validating &quot;/tmp/test.yaml&quot;: error validating data: ValidationError(Gateway.spec): unknown field &quot;loadBalancerIP&quot; in io.istio.networking.v1alpha3.Gateway.spec; if you choose to ignore these errors, turn validation off with --validate=false
$ kubectl apply --validate=false -f /tmp/test.yaml
gateway.networking.istio.io/httpbin-gateway created
virtualservice.networking.istio.io/httpbin created

$ kubectl get svc -n istio-system -o wide istio-ingressgateway
NAME                   TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                                      AGE   SELECTOR
istio-ingressgateway   LoadBalancer   10.108.199.32   10.0.0.206   15021:31659/TCP,80:30780/TCP,443:30769/TCP   17h   app=istio-ingressgateway,istio=ingressgateway
</code></pre>
<p>Notice it got the wrong EXTERNAL-IP address from MetalLB.</p>

thoth
<p>I think you need to set the IP address on the ingressGateway with an IstioOperator when installing Istio. not on your virtual gateway.</p>
<p>Create a yaml file with your config:</p>
<pre><code>apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
  components:
    ingressGateways:
    - name: istio-ingressgateway
      enabled: true
      k8s:
        service:
          type: LoadBalancer
          loadBalancerIP: 10.0.0.242
</code></pre>
<p>If you don't supply an operator when installing Istio at the moment, the default config will be used so make sure you add any values you would like to keep to the <code>ingressGateway</code> part. This config will be merged with the default.</p>
<p>To get your current config:</p>
<p><code>kubectl get istiooperators.install.istio.io -n istio-system installed-state -o yaml</code></p>
<p>Then apply this config when installing Istio:</p>
<pre><code>istioctl install \
    -f k8s/istio/gateways.yaml
</code></pre>
<p>All options for the IstioOperator:</p>
<p><a href="https://istio.io/latest/docs/reference/config/istio.operator.v1alpha1/" rel="nofollow noreferrer">https://istio.io/latest/docs/reference/config/istio.operator.v1alpha1/</a></p>
