DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Setup of a Local Kubernetes and Istio Dev Environment

Setup of a Local Kubernetes and Istio Dev Environment

For developers who prefer to work locally, check out this tutorial on setting up Kubernetes and Istio on your machine.

Niklas Heidloff user avatar by
Niklas Heidloff
CORE ·
Mar. 22, 19 · Tutorial
Like (3)
Save
Tweet
Share
14.47K Views

Join the DZone community and get the full member experience.

Join For Free

as a developer, i like to do as much development as possible locally, because it's generally easier and faster to develop and debug code. in order to build cloud-native applications and microservices, it's very convenient to have a local kubernetes cluster and istio running locally. this article describes how to install these components and some additional tools like kiali .

minikube

in order to run kubernetes clusters locally, there are different alternatives. one is to use the kubernetes functionality integrated in docker desktop . the alternative that i've chosen is minikube , which runs a single-node kubernetes cluster inside a vm on your development machine.

follow the instructions to install kubectl and minikube . for a hypervisor, i'm using virtualbox, which is supported on mac, linux, and windows.

when running istio and your own applications, you need more memory and cpus than you get by default. here are my settings:

$ minikube config set cpus 4
$ minikube config set memory 8192
$ minikube config set disk-size 50g
$ minikube addons enable ingress 
$ minikube start


minikube start can take several minutes when starting for the first time. be patient.

sometimes minikube start doesn't work for me. in that case, i stop my vpn, invoke minikube delete# , delete the .minikube directory, restart my machine and start it again.

after this, you can get the minikube ip address and open the kubernetes dashboard via these commands:

$ minikube ip
$ minikube dashboard


minikube comes with it's own docker daemon, so you don't have to use docker desktop. you only need the docker cli and to point it to minikube:

$ eval $(minikube docker-env)


to stop the cluster run this command:

$ minikube stop


istio

to download istio, run this command:

$ curl -l https://git.io/getlatestistio | sh -


follow the instructions in the terminal to set the path.

to install istio, run these commands:

$ cd istio-1.0.6
$ kubectl apply -f install/kubernetes/helm/istio/templates/crds.yaml
$ kubectl apply -f install/kubernetes/istio-demo.yaml


make sure that all pods are running or completed before continuing. this can take several minutes when starting the pods for the first time. be patient.

$ kubectl get pod -n istio-system


this screenshot shows all istio pods running or completed (ignore the kiali one for now).

in the last step, enable automatic sidecar injection:

$ kubectl label namespace default istio-injection=enabled


after the setup of minikube and istio you can use the following tools:

kubernetes dashboard

$ minikube dashboard


jaeger dashboard

$ kubectl port-forward -n istio-system $(kubectl get pod -n istio-system -l app=jaeger -o jsonpath='{.items[0].metadata.name}') 16686:16686


url to open jaeger: http://localhost:16686

grafana dashboard

$ kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=grafana -o jsonpath='{.items[0].metadata.name}') 3000:3000 &


url to open grafana: http://localhost:3000/dashboard/db/istio-mesh-dashboard

prometheus dashboard

$ kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=prometheus -o jsonpath='{.items[0].metadata.name}') 9090:9090 &


url to open prometheus: http://localhost:9090

kiali

run the following command to install kiali:

$ bash <(curl -l http://git.io/getlatestkialikubernetes)


note: for some reason the script didn't work for me. i had to replace one line :

get_downloader
github_api_url="https://api.github.com/repos/kiali/kiali/releases/latest"
kiali_version_we_want="v0.15.0"


to launch kiali you need the ip address and nodeport:

$ minikube ip
$ kubectl get svc -n istio-system kiali --output 'jsonpath={.spec.ports[*].nodeport}'


url to open kiali: https://[minikube-ip]:[kiali-nodeport]/kiali

sample application

i'm working on a simple sample application that shows some of the istio and microprofile functionality to build cloud-native applications. i'll blog more about this soon.

for now you can install two sample microservices from this project. make sure minikube runs and you have installed all the necessary prerequisites :

$ git clone https://github.com/nheidloff/cloud-native-starter.git
$ scripts/check-prerequisites.sh
$ scripts/deploy-articles-java-jee.sh
$ scripts/deploy-web-api-java-jee.sh


the following screenshot shows a bff (backend for frontend) web-api microservice invoking another articles webservice:

most of the information in this article i got from harald uebele . thanks harald. i just added some details that i had to do differently.

Kubernetes Docker (software) dev application Dashboard (Mac OS) Command (computing) microservice IT pods Grafana Virtual Machine

Published at DZone with permission of Niklas Heidloff, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Specification by Example Is Not a Test Framework
  • Strategies for Kubernetes Cluster Administrators: Understanding Pod Scheduling
  • Master Spring Boot 3 With GraalVM Native Image
  • REST vs. Messaging for Microservices

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: