Giter VIP home page Giter VIP logo

kubernetes-demo's Introduction

Introduction

Prerequisites

Before you start executing commands from below chapters, please make sure you have installed

Creating Kubernetes cluster and Container Registry

Below command will use kind to create local Kubernetes clusters and Container Registry

# brew install kind
./kind-create-cluster-and-registry.sh

Deploying Istio with Ingress and addons

Once we have up an running kubernetes cluster and container registry we can install Istio:

kubectl create namespace istio-system
helm install istio-base istio/base -n istio-system
helm install istiod istio/istiod -n istio-system --wait

We will also install istio ingress:

kubectl create namespace istio-ingress
kubectl label namespace istio-ingress istio-injection=enabled
helm install istio-ingress istio/gateway -n istio-ingress --wait

Once istio and ingress are installed on our cluster we can deploy also addons:

kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.13/samples/addons/prometheus.yaml
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.13/samples/addons/grafana.yaml
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.13/samples/addons/kiali.yaml
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.13/samples/addons/jaeger.yaml

Deploying Flagger

Next we can install Flagger

helm repo add flagger https://flagger.app
kubectl apply -f https://raw.githubusercontent.com/fluxcd/flagger/main/artifacts/flagger/crd.yaml
helm upgrade -i flagger flagger/flagger --namespace=istio-system --set crd.create=false --set meshProvider=istio --set metricsServer=http://prometheus:9090

Building Rest application

Now we can build our rest application as a Docker image and push it to local registry

docker build -t localhost:5001/helloapi:v0.0.1 .
docker push localhost:5001/helloapi:v0.0.1

Application by default is running on 8080 port and returns 200 response on /

Deploying rest application to cluster

kubectl create namespace demo
kubectl label namespace demo istio-incection=enabled
kubectl apply -f helloapi-deployment.yaml
kubectl apply -f helloapi-canary.yaml
kubectl apply -f helloapi-gateway.yaml

Executing tests

In order to verify that our application is available through istio-ingress I deployed Metallb on kind cluster by following https://kind.sigs.k8s.io/docs/user/loadbalancer/ instructions

Below screenshot shows that everything is working as expected

hellorest-demo.png

kubernetes-demo's People

Watchers

Mateusz Lubański avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.