https://github.com/medmes/jibkubedemo
Demo project for how to build a Spring Boot 2 app into Kubernetes and Jib
https://github.com/medmes/jibkubedemo
Last synced: 2 months ago
JSON representation
Demo project for how to build a Spring Boot 2 app into Kubernetes and Jib
- Host: GitHub
- URL: https://github.com/medmes/jibkubedemo
- Owner: medmes
- Created: 2018-11-19T20:05:59.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-19T20:30:47.000Z (over 6 years ago)
- Last Synced: 2025-02-01T11:16:03.286Z (4 months ago)
- Language: Java
- Size: 48.8 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# Dockerize and deploy a Spring Boot application to Kubernetes
This is an example of how to easily build a Docker image for a Spring Boot application with Jib and deploy it to Kubernetes with `kubectl`.
## Try it yourself
*Make sure you have `kubectl` [configured with a cluster](https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-cluster).*
```shell
IMAGE=./mvnw compile jib:build -Dimage=$IMAGE
kubectl run jibkubedemo --image=$IMAGE --port=8080 --restart=Never
# Wait until pod is running
kubectl port-forward spring-boot-jib 8080 > /dev/null 2>&1 &
```
```shell
curl localhost:8080
> Greetings from Kubernetes!
```Give it a [](https://twitter.com/intent/tweet?text=Run+a+%40springboot+app+on+%23Kubernetes+in+seconds+%40kubernetesio+%23jib+%23java&url=https://github.com/medmes/jibkubedemo)
*For Gradle just run `./gradlew jib --image=$IMAGE` instead.*
## More information
Learn [more about Jib](https://github.com/GoogleContainerTools/jib).