What we will do:
-
Build backend and frontend Java applications
-
Test them with Docker on developer machine
-
Run those images in a Kubernetes cluster with yaml files
-
Present Helm and run the same Docker images with Helm packages
- helm: helm artifacts
- java: java applications
- yamls: yamls files for Kubernetes
Build java applications with maven
cd java
for i in backend backend_2 frontend; do (cd $i; mvn clean package); done
cd java/backend
docker build -t backend:1.0.0 .
BACKEND=`docker run -d backend:1.0.0`
docker inspect $BACKEND | grep -i IPAddress
cd java/frontend
docker build -t frontend:1.0.0 .
FRONTEND=`docker run -d -e BACKEND="http://<backendip>:8080/" frontend:1.0.0`
docker inspect $FRONTEND | grep -i IPAddress
cd java/backend_2
docker build -t backend:1.0.1 .
docker tag backend:1.0.0 registry.lan/backend:1.0.0
docker push registry.lan/backend:1.0.0
docker tag frontend:1.0.0 registry.lan/frontend:1.0.0
docker push registry.lan/frontend:1.0.0
docker tag backend:1.0.1 registry.lan/backend:1.0.1
docker push registry.lan/backend:1.0.1
cd yamls/backend
kubectl apply -f backend_deployment.yaml
kubectl apply -f backend_service.yaml
cd yamls/fronted
kubectl apply -f frontend_configmap.yaml
kubectl apply -f frontend_deployment.yaml
kubectl apply -f frontend_service.yaml
cd yamls/backend_2
kubectl apply -f backend_deployment.yaml
cd helm
helm package backend
Depends on your environment
helm repo update
helm search
helm install chartmuseum/backend [--version 1.0.0]
cd helm
helm package frontend
Depends on your environment
helm install --set config.backend=http://<backendservice:80>/ chartmuseum/frontend
cd helm
helm package backend
Depends on your environment
helm upgrade <releasename> chartmuseum/backend [--version 1.0.1]
helm history <releasename>
helm rollback <releasename> 1