Creating an Istio gateway

Since we are using a bare minimum Kubernetes installation, it does not have a reverse proxy running in the server. A reverse proxy, such as Nginx, provides connectivity from the outside world to the services running within the Kubernetes cluster.

If you are using a managed Kubernetes cluster in a public cloud or have built one using Red Hat OpenShift, you may have to disable the reverse proxy that comes with your Kubernetes cluster for the following exercises to work.

We are going to use Istio, which has provided a gateway controller that receives HTTP/HTTPS/TCP incoming connections:

  1. First, create an Istio gateway and an Istio virtual service. This ensures that requests can be routed properly from the external world to the Kubernetes cluster. 
  1. Look at the 00-create-gateway.yaml file and make sure you understand the gateway definitions:
# Script : 00-create-gateway.yaml

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: mygateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
  1. Now, let's create Istio's first primitive, that is, Gateway:
$ kubectl -n istio-system apply -f 00-create-gateway.yaml
gateway.networking.istio.io/mybookinfo created

The preceding code creates a gateway in the istio-system namespace, and it will allow traffic from all http external host requests on port 80

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.12.172