Giter VIP home page Giter VIP logo

ignite-minikube's Introduction

Kubernetes Demo

This repo accompanies GridGain's Kubernetes Workshop, and demonstrates some of the concepts discussed.

The code sets up a relatively minimal GridGain cluster and connects a SpringBoot REST client to it. It should run in pretty much any Kuberenetes environment, including MiniKube and Docker Desktop. See below for some magic incantations that are required for specific versions of Kubernetes.

Start the servers

Create the cluster in the "ignite" namespace with the following commands.

kubectl apply -f ignite-namespace.yaml
kubectl create -f ignite-service.yaml -n ignite
kubectl create -f ignite-serviceaccount.yaml -n ignite
kubectl create configmap ignite-config --from-file=ignite-config.xml -n ignite
kubectl create configmap ignite-licence --from-file=gridgain-license.xml -n ignite
kubectl apply -n ignite -f ignite-credentials.yaml
kubectl apply -f ignite-statefulset.yaml -n ignite

Since the cluster is persistent, you'll need to activate the cluster. The simplest option is to use Control Center. You can also exec into one of the pods and run control.sh.

Start the client

The client is a SpringBoot/SpringData application that connects to the GridGain servers as a thin-client. After you've built the image and uploaded it to a registry (if necessary), you can run it with the following command.

kubectl apply -f ignite-client.yaml -n ignite

Example calling the client program, using httpie:

$ http POST http://localhost/person/ id=10 name=Jeremy height=180
HTTP/1.1 200 
Connection: keep-alive
Content-Type: application/json
Date: Wed, 07 Jun 2023 16:59:01 GMT
Keep-Alive: timeout=60
Transfer-Encoding: chunked

{
    "height": 180,
    "id": 10,
    "name": "Jeremy"
}


$ http http://localhost/person/10
HTTP/1.1 200 
Connection: keep-alive
Content-Type: application/json
Date: Wed, 07 Jun 2023 16:59:11 GMT
Keep-Alive: timeout=60
Transfer-Encoding: chunked

{
    "height": 180,
    "id": 10,
    "name": "Jeremy"
}

Docker Desktop

MiniKube

To access the cluster from outside of the Kubernetes (cluster), you'll need to set up a tunnel.

minikube tunnel

The nice thing about MiniKube is that comes with the Kubernetes Dashboard. You can launch it with:

minikube dashboard

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.