Giter Site home page Giter Site logo

arun-gupta / docker-kubernetes-hello-world Goto Github PK

View Code? Open in Web Editor NEW
29.0 4.0 171.0 28 KB

Docker & Kubernetes Hello World

License: Apache License 2.0

Java 54.36% Makefile 36.12% Smarty 7.64% Dockerfile 1.88%
docker kubernetes container hello-world spring-boot java

docker-kubernetes-hello-world's Introduction

Hello World with Docker and Kubernetes

This repo consists of a Spring Boot Hello World application. It shows:

  1. Run & test the application from CLI

  2. Create a Docker image, run the container and test it

  3. Create Kubernetes deployment and test it

Let’s get started!

CLI

Run App

mvn spring-boot:run

Test Application

curl http://localhost:8080

Docker

Build Application

mvn clean package

Build Docker Image

docker image build -t arungupta/helloworld-spring-boot:latest .

Push Docker Image

docker image push arungupta/helloworld-spring-boot:latest

Run Docker Container

docker container run -d --name hello-world -p 8080:8080 arungupta/helloworld-spring-boot:latest

Test Application

curl http://localhost:8080

Delete Docker Container

docker container rm -f hello-world

Kubernetes

Create Deployment

kubectl apply -f deployment.yaml

Test Application

curl http://`kubectl get svc hello-world-service -o jsonpath={.status.loadBalancer.ingress[0].hostname}`

Delete Deployment

kubectl delete -f deployment.yaml

docker-kubernetes-hello-world's People

Contributors

arun-gupta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.