Env:
Ubuntu: 22.04
Node: v16.17.0
Npm: 8.15.0
Java: openjdk 11.0.16
Git: 2.34.1
Docker: 20.10.12
Make sure to have node, npm, git, docker, jdk installed on the system. Node must be recent version. Avoid node from snap, it breaks things.
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt install nodejs git docker.io docker openjdk-11-jdk
Install jhipster
npm install -g generator-jhipster
Setup cluster
Cluster:
Desired: 3
Minimum: 3
Maximum: 5
Node: t3.medium
Install istio on the cluster, connect kubectl.
curl -sL https://istio.io/downloadIstioctl | sh -
export PATH=$HOME/.istioctl/bin:$PATH
Apply istio sample addons.
kubectl apply -f samples/addons/grafana.yaml
kubectl apply -f samples/addons/prometheus.yaml
kubectl apply -f samples/addons/kiali.yaml
kubectl apply -f samples/addons/extras/zipkin.yaml
Copy jdl file. Modify deployment section at the end of jdl file. Change dockerRepositoryName and ingressDomain.
Generate project using:
jhipster import-jdl *.jdl
There might be some errors regarding, but they might be ignored.
Error executing './npmw install', execute it yourself. (Command failed with exit code 1: ./npmw install)
Generate images Go to store, invoice, notifictaion, product and run
./gradlew bootJar -Pprod jibDockerBuild
in each of them.
Tag and publish docker images:
$dockerRepositoryName = ""
docker image tag store $dockerRepositoryName/store
docker push $dockerRepositoryName/store
docker image tag invoice $dockerRepositoryName/invoice
docker push $dockerRepositoryName/invoice
docker image tag notification $dockerRepositoryName/notification
docker push $dockerRepositoryName/notification
docker image tag product $dockerRepositoryName/product
docker push $dockerRepositoryName/product
Go to kubernetes and apply configuration
bash kubectl-apply.sh -f
kubectl get svc store -n jhipster