https://github.com/marcnuri-demo/jkube-helm
Example showcasing JKube's Helm features
https://github.com/marcnuri-demo/jkube-helm
helm jkube kubernetes kubernetes-maven-plugin maven openshift
Last synced: about 1 month ago
JSON representation
Example showcasing JKube's Helm features
- Host: GitHub
- URL: https://github.com/marcnuri-demo/jkube-helm
- Owner: marcnuri-demo
- License: apache-2.0
- Created: 2021-12-13T11:27:37.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-03T13:55:18.000Z (over 1 year ago)
- Last Synced: 2025-03-25T17:22:24.999Z (about 2 months ago)
- Topics: helm, jkube, kubernetes, kubernetes-maven-plugin, maven, openshift
- Language: Java
- Homepage:
- Size: 24.4 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
JKube + Helm
============## OpenShift
### Prepare environment
Initialize a ChartMuseum instance. This is required for the outer-loop.
```shell
jbang ./demo/PrepareOpenShiftEnvironment.java
```### Outer Loop
No Maven profile.
First part runs on CI server.
```shell
mvn clean package k8s:build k8s:push k8s:resource k8s:helm k8s:helm-push
```Image pushed to https://hub.docker.com/r/marcnuri/repo-for-tests
Helm chart pushed to
- http://chart-museum.dev-sandbox.marcnuri.com/
- http://chart-museum.dev-sandbox.marcnuri.com/api/chartsSecond part executed by operator?
```shell
helm repo add dev-sandbox http://chart-museum.dev-sandbox.marcnuri.com/ --username secret --password shouldnt-be-here-use-env
helm repo update dev-sandbox
helm install jkube-helm dev-sandbox/jkube-helm --devel
helm delete jkube-helm
helm install jkube-helm dev-sandbox/jkube-helm --devel \
--set ingress.host=production.dev-sandbox.marcnuri.com \
--set application.greeting="Prod Override"
helm delete jkube-helm
```### Inner Loop
Use the `dev` and `OpenShift` Maven profiles.
Provides default values for placeholders applicable in the `dev` environment for OpenShift.
```shell
mvn -Pdev,openshift clean package oc:build oc:resource oc:apply
mvn -Pdev,openshift oc:undeploy
```## Minikube (needs updating)
TODO: Update this section
### Inner Loop
`dev` Maven profile.
Provides default values for placeholders applicable in the dev environment.
We assume we are running on a Minikube cluster.
```shell
$ eval $(minikube docker-env)
$ mvn -Pdev clean package k8s:build k8s:resource k8s:apply -Dingress.host=local-dev.$(minikube ip).nip.io
$ mvn -Pdev k8s:undeploy
```### Outer Loop
No Maven profile.
Values for placeholders are provided from the `helm-variables-template.yml` file.
First part runs on CI server.
```shell
$ mvn clean package k8s:build k8s:push k8s:resource k8s:helm k8s:helm-push
```
Second part executed by operator?
```shell
$ helm install ...
```#### Demo
We assume we are running on a Minikube cluster for demo purposes.
```shell
$ eval $(minikube docker-env)
$ mvn clean package k8s:build k8s:resource k8s:helm
$ helm install jkube-helm ./target/jkube-helm-0.0.1-SNAPSHOT-helm.tar.gz \
--set ingress.host=production.$(minikube ip).nip.io \
--set deployment.container.imagepullpolicy=IfNotPresent
$ helm delete jkube-helm
```## Plugins
### Maven Resources Plugin
Used to interpolate Maven properties in `application.properties` file.
Since it's using the Spring Boot parent, filtered properties are delimited by `@...@`.