Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arun-gupta/docker-kubernetes-hello-world
Docker & Kubernetes Hello World
https://github.com/arun-gupta/docker-kubernetes-hello-world
container docker hello-world java kubernetes spring-boot
Last synced: 4 days ago
JSON representation
Docker & Kubernetes Hello World
- Host: GitHub
- URL: https://github.com/arun-gupta/docker-kubernetes-hello-world
- Owner: arun-gupta
- License: apache-2.0
- Created: 2018-03-23T03:06:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-06-10T02:46:19.000Z (over 3 years ago)
- Last Synced: 2023-04-04T04:47:31.225Z (over 1 year ago)
- Topics: container, docker, hello-world, java, kubernetes, spring-boot
- Language: Java
- Homepage:
- Size: 27.3 KB
- Stars: 28
- Watchers: 3
- Forks: 163
- Open Issues: 3
-
Metadata Files:
- Readme: readme.adoc
- License: LICENSE
Awesome Lists containing this project
README
= Hello World with Docker and Kubernetes
This repo consists of a Spring Boot Hello World application. It shows:
. Run & test the application from CLI
. Create a Docker image, run the container and test it
. Create Kubernetes deployment and test itLet'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
```