GithubHelp home page GithubHelp logo

kevinchen1227 / configmaps-transformers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ryandawsonuk/configmaps-transformers

0.0 0.0 0.0 262 KB

Demo using shared ConfigMaps for Java Apps

Home Page: https://dzone.com/articles/configuring-java-apps-with-kubernetes-configmaps-a

Shell 51.22% Batchfile 29.66% Java 14.93% Smarty 4.19%

configmaps-transformers's Introduction

Kubernetes ConfigMaps Transformers Example

Aims

To demonstrate ConfigMaps by swithing Transfomer services between 'disguised' and 'robot' modes in minikube.

Pre-requisites

Docker (https://docs.docker.com/install/) and minikube (https://kubernetes.io/docs/tasks/tools/install-minikube/) installed.

How to Run - kubectl

First Deploy

Start minikube:

minikube start --memory 4000 --cpus 3

Build images for Transformers - from this directory run

eval $(minikube docker-env)
mvn clean install

Deploy the Autobots (their ConfigMap has them as in robot mode)

kubectl create -f autobots --save-config

To see the autobots:

minikube service optimus-prime-entrypoint
minikube service gears-entrypoint

Deploy the Decepticons (their ConfigMap has them disguised)

kubectl create -f decepticons --save-config

minikube service megatron-entrypoint
minikube service shockwave-entrypoint

Changing Config

To change config there are options.

Option 1 - Change with small downtime

Do minikube dashboard to open the dashboard in the browser, go to 'Config Maps' under 'Config and Storage' and e.g. change the Decepticons to 'robot'. Then do:

kubectl scale deployment/megatron --replicas=0;
kubectl scale deployment/megatron --replicas=2;

Option 2 - Change with no downtime

Edit the .yml files for each transformer in the autobots and decepticons directories to point to v2 of the config. Then do:

kubectl apply -f autobots --record
kubectl apply -f decepticons --record

Note it can take a while for the rolling update to be fully applied and also beware the browser cache (and dep on your minikube version you may hit kubernetes/kubernetes#55667).

Remove and Stop

To remove:

kubectl delete -f autobots
kubectl delete -f decepticons

Stop minikube with minikube stop

How to Run - Helm

See the helm directory for instructions

configmaps-transformers's People

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.