An open API service indexing awesome lists of open source software.

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

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 [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](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).