Setting up Istio Service Mesh for a Helidon Microservice

Jobinesh
Jobinesh
Sep 9 · 3 min read
apiVersion: v1
kind: Service
metadata:
name: helidon-istio-movies-mp
labels:
app: helidon-istio-movies-mp
spec:
ports:
- port: 8080
name: http
selector:
app: helidon-istio-movies-mp
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: helidon-istio-movies-mp
spec:
replicas: 1
template:
metadata:
labels:
app: helidon-istio-movies-mp
version: v1
spec:
containers:
- name: helidon-istio-movies-mp
image: helidon-istio-movies-mp
imagePullPolicy: IfNotPresent #Always
ports:
- containerPort: 8080
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: movies-gateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: helidon-istio-movies-mp
spec:
hosts:
- "*"
gateways
:
- movies-gateway
http:
- match:
- uri:
exact: /movies
route:
- destination:
host: helidon-istio-movies-mp
port:
number: 8080
1.Start minikube
$ minikube start
2. To use the local docker env for minikube
$ eval $(minikube docker-env)
3. Create and deploy all resources for running this example
$ kubectl create -f app.yaml

4.Use the script below to set the GATEWAY environment variable which we will use later to derive the URL of our REST APIs.
$ export INGRESS_HOST=$(minikube ip)$ export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}')export $ export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT$ printenv GATEWAY_URL
$ export POD=`kubectl get pods -l app=helidon-istio-movies-mp | awk ‘/helidon-istio-movies-mp/ {print $1}’`$ kubectl logs $POD -c istio-proxy

Jobinesh

Written by

Jobinesh

https://www.linkedin.com/in/jobinesh

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade