[BETA] Deploying to Kubernetes
WARNING! This is a new sub-generator, of BETA quality. Use it at your own risk! Feedback is highly welcome!
This sub-generator allows deployment of your JHipster application to Kubernetes.
Limitations
- Elasticsearch is not supported yet
- Cassandra is not supported yet
Pre-requisites
You have to install:
You must have a Docker registry. If you don’t have one, you can use the official Docker Hub
Minikube
Minikube is a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a VM on your laptop for users looking to try out Kubernetes or develop with it day-to-day.
You can use it to test your application before pushing it to Kubernetes.
Running the sub-generator
To generate config files for Kubernetes, run this command in a new folder:
yo jhipster:kubernetes
Then answer all the questions to deploy your application.
Updating your deployed application
Preparing a new deployment
When your application is already deployed, you can re-deploy it by building a new Docker image:
./mvnw package -Pprod -DskipTests docker:build
Or when using gradle:
./gradlew -Pprod bootRepackage buildDocker -x test
Pushing to Docker Hub
Tag locally your image:
docker tag application username/application
Push your image to Docker Hub:
docker push username/application
Deploying the application
Deploy your application
kubectl apply -f application