<p>I try to get some hands on experience with K8s &amp; istio. I am using minikube and I try to deploy a dummy flask web-app. However, for some reason I do not manage to get the istio routing working.</p>
<p>E.g.</p>
<pre><code>curl -v -H 'Host: hello.com' 'http://127.0.0.1/' --&gt; 503 Service Unavailable
</code></pre>
<p>Do you see any issue in my specs?</p>
<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: flask-gateway
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - &quot;hello.com&quot; 

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: flaskvirtualservice
spec:
  hosts:
  - &quot;hello.com&quot; 
  gateways:
  - flask-gateway
  http:
  - route:
    - destination:
        host: flask.default.svc.cluster.local
        port:
          number: 5000
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: flask
  labels:
    app: flask
spec:
  replicas: 1
  selector:
    matchLabels:
      app: flask
  template:
    metadata:
      labels:
        app: flask
    spec:
      containers:
      - name: flask
        image: digitalocean/flask-helloworld
        ports:
        - containerPort: 5000
---
apiVersion: v1
kind: Service
metadata:
  name: flask-service
spec:
  selector:
    app.kubernetes.io/name: flask
  ports:
  - name: name-of-service-port
    protocol: TCP
    port: 80
    targetPort: 5000
</code></pre>
<p>Thanks for your support here!</p>
<p>Cheers</p>
<p>EDIT:</p>
<p>here the updated service definition</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: flask
  labels:
    app: flask
    service: flask
spec:
  ports:
  - port: 5000
    name: http
  selector:
    app: flask
</code></pre>

Henrik
<p>I would suggest you look at this sample from the istio repo:</p>
<p><a href="https://github.com/istio/istio/tree/master/samples/helloworld" rel="nofollow noreferrer">https://github.com/istio/istio/tree/master/samples/helloworld</a></p>
<p>This <code>helloworld</code> app is a flask app and you can find the python source code in <code>src</code></p>
<hr />
<h3>Syntax</h3>
<p>In your yaml you do not have <code>---</code> between your <code>Gateway</code> and <code>VirtualService</code>.</p>
<h3>DNS</h3>
<p>You also don't make mention of <code>DNS</code> IE you need to make sure that the box you are running <code>curl</code> on has the ability to resolve your domain <code>hello.com</code> to the istio service ip. Since you are using minikube you could add an entry to your OS hosts file.</p>
<h3>Routability</h3>
<p>It has the ability to send requests to it, IE if you are outside the cluster you need an external ip or do something with <code>kubectl port-forward ...</code></p>
<p>I hope this helps you sort things out!</p>
