<p>I configure Ingress on google Kubernetes engine. I am new on ingress but as i understood ingress can serve different Loadbalancers and different LBs should be differently configured. </p>

<p>I have started with a simple ingress config on GKE :</p>

<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: basic-ingress

spec:
  rules:
  - http:
      paths:
      - path: /*
        backend:
          serviceName: web-np
          servicePort: 8080
      - path: /v2/keys
        backend:
          serviceName: etcd-np
          servicePort: 2379
</code></pre>

<p>And it works fine so I have 2 different NodePort services web-np and <code>etcd-np</code> . But now I need to extend this logic with some rewrite rules so that request that points to <code>/service1</code> - will be redirected to the other <code>service1-np</code> service but before <code>/service1/hello.html</code> must be replaced to <code>/hello.html</code>. That's why I have the following questions: </p>

<ul>
<li>How can I configure rewrite in ingress and if it is possible with default load balancer.</li>
<li>What is default load balancer on GKE.</li>
<li>Where can I find a list of all annotations to it. I have thought that the full list is on <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/</a> but there is a completly different list and there is no <code>kubernetes.io/ingress.global-static-ip-name</code> annotation that is widely used in google examples. </li>
</ul>

Oleg
<blockquote>
  <p><code>Ingress</code> - API object that manages external access to the services in a cluster, typically HTTP.</p>
  
  <p>Ingress may provide load balancing, SSL termination and name-based virtual hosting.</p>
  
  <p> <em><a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="noreferrer">Kubernetes.io: Ingress</a></em>  </p>
</blockquote>

<p>Kubernetes can have multiple <code>Ingress</code> controllers. This controllers are different from each other. The <code>Ingress</code> controllers mentioned by you in this particular question are:</p>

<ul>
<li><code>Ingress-GCE</code> - a default <code>Ingress</code> resource for <code>GKE</code> cluster:

<ul>
<li><a href="https://github.com/kubernetes/ingress-gce" rel="noreferrer">Github.com: Kubernetes: Ingress GCE</a></li>
</ul></li>
<li><code>Ingress-nginx</code> - an alternative <code>Ingress</code> controller which can be deployed to your <code>GKE</code> cluster: 

<ul>
<li><a href="https://github.com/kubernetes/ingress-nginx" rel="noreferrer">Github.com: Kubernetes: Ingress-nginx</a></li>
</ul></li>
</ul>

<p><code>Ingress</code> configuration you pasted will use the <code>Ingress-GCE</code> controller. If you want to switch to <code>Ingress-nginx</code> one, you will need to deploy it and set an annotation like: </p>

<ul>
<li><code>kubernetes.io/ingress.class: "nginx"</code></li>
</ul>

<hr>

<blockquote>
  <p>How can I configure rewrite in ingress and if it is possible with default load balancer.</p>
</blockquote>

<p>There is an ongoing feature request to support rewrites with <code>Ingress-GCE</code> here: <a href="https://github.com/kubernetes/ingress-gce/issues/109" rel="noreferrer">Github.com: Ingress-GCE: Rewrite</a>.</p>

<p><strong>You can use <code>Ingress-nginx</code> to have support for rewrites.</strong> There is an official documentation about deploying it: <a href="https://kubernetes.github.io/ingress-nginx/deploy/" rel="noreferrer">Kubernetes.github.io: Ingress-nginx: Deploy</a> </p>

<p>For more resources about rewrites you can use: </p>

<ul>
<li><a href="https://kubernetes.github.io/ingress-nginx/examples/rewrite/" rel="noreferrer">Kubernetes.github.io: Ingress nginx: Examples: Rewrite</a></li>
<li><a href="https://stackoverflow.com/questions/61541812/ingress-nginx-how-to-serve-assets-to-application/61751019#61751019">Stackoverflow.com: Ingress nginx how to serve assests to application</a> - this is an answer which shows an example on how to configure a playground for experimenting with rewrites </li>
</ul>

<hr>

<blockquote>
  <p>What is default load balancer on GKE.</p>
</blockquote>

<p>If you create an <code>Ingress</code> resource with a default <code>Ingress-GCE</code> option you will create a <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/ingress" rel="noreferrer">L7 HTTP&amp;HTTPS LoadBalancer</a>. </p>

<p>If you create a service of type <code>LoadBalancer</code> in <code>GKE</code> you will create an <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/exposing-apps#creating_a_service_of_type_loadbalancer" rel="noreferrer">L4 Network Load Balancer</a></p>

<p>If you deploy an <code>Ingress-nginx</code> controller in <code>GKE</code> cluster you will create a L4 Network Loadbalancer pointing to the <code>Ingress-nginx</code> controller which after that will route the traffic accordingly to your <code>Ingress</code> definition. If you are willing to use <code>Ingress-nginx</code> you will need to specify:</p>

<ul>
<li><code>kubernetes.io/ingress.class: "nginx"</code></li>
</ul>

<p>in your <code>Ingress</code> definition. </p>

<p>Please take a look on this article: <a href="https://medium.com/google-cloud/kubernetes-nodeport-vs-loadbalancer-vs-ingress-when-should-i-use-what-922f010849e0" rel="noreferrer">Medium.com: Google Cloud: Kubernetes Nodeport vs Loadbalancer vs Ingress</a></p>

<hr>

<blockquote>
  <p>Where can I find a list of all annotations to it. I have thought that the full list is on <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/" rel="noreferrer">https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/</a> but there is a completly different list and there is no kubernetes.io/ingress.global-static-ip-name annotation that is widely used in google examples.</p>
</blockquote>

<p><strong>The link that you provided with annotations is specifically for <code>Ingress-nginx</code>. This annotations will not work with <code>Ingress-GCE</code></strong>. </p>

<p>The annotations used in <code>GCP</code> examples are specific to <code>Ingress-GCE</code>. </p>

<p>You can create a Feature Request for a list of available annotations for <code>Ingress-GCE</code> on <a href="https://issuetracker.google.com" rel="noreferrer">Issuetracker.google.com</a>. </p>
