See extra documentation here In particular to see how set up an Ingress controller
The parts from 7 to 12 can be skipped if you don't want update the container images The part 15 is only to apply some changes to the cluster if you redeploy and publish a new image of the application
- Update the source code
git pull
- Make
image-caption-generation
the working namespace
kubectl config set-context --current --namespace=image-caption-generation
- Remove any previous deployment
kubectl delete namespace image-caption-generation
- Recreate an empty namespace for the new deployment
kubectl create namespace image-caption-generation
- Install RabbitMQ. Notice that you need to install the bitnami repository before.
helm install -f rabbitmq.yaml -n image-caption-generation img-rabbitmq bitnami/rabbitmq --version 12.12.0
- Install Infinispan. Notice that you need to install openshift repository before.
helm install -f infinispan.yaml -n image-caption-generation infinispan openshift/infinispan --version 0.3.2
- Optionally Create some port forwarding
For instance if the Kubernetes does not have a LoadBalancer service.
kubectl port-forward services/img-rabbitmq 15672
kubectl port-forward services/infinispan 11222
- Optionally Compile the Java/Quarkus
gallery
service:
mvn -f ./gallery/pom.xml clean package
- Optionally Compile the Java/Quarkus
user
service:
mvn -f ./users/pom.xml clean package
- Optionally Compile the Angular web application:
[./webapp/] <-- run from this subdir
ng build --configuration production
- Optionally Build the Docker images locally:
docker-compose build
- Optionally Push the Docker images to the Docker remote repository:
docker-compose push
- Deploy the application, Kubernetes will pull the images from the remote repository:
kubectl apply -f kubernetes.yaml
- See all the pods starting...
kubectl get pods -w
- Optionally redeploy a service
kubectl rollout restart deployment caption
This demo is executable without the need of a webapp implemented.
- Crate users
http POST http://localhost/users/user <<<'{"name":"norman", "pass":"norman", "pro":true}'
http POST http://localhost/users/user <<<'{"name":"victor", "pass":"victor", "pro":false}'
- Verify login service
http POST http://localhost/users/user/validate <<<'{"username":"fabio", "password":"fabio"}'
http POST http://localhost/users/user/validate <<<'{"username":"norman", "password":"wrong"}'
http POST http://localhost/users/user/validate <<<'{"username":"norman", "password":"norman"}'
http POST http://localhost/users/user/validate <<<'{"username":"victor", "password":"victor"}'
- Publish images
Go to the page http://localhost/caption/new-image/norman and insert some images
In this case the images are generated for the user norman
.
Go to the page http://localhost/caption/new-image/victor and insert some images
In this case the images are generated for the user victor
.
- Verify that images are stored and are retrievable from the caption service.
Go to the page http://localhost/caption/image/victor/empire-state-building.png
- Find all images belonging to
norman
/victor
http http://localhost/gallery/image/user/norman
http http://localhost/gallery/image/user/victor
- Find all images having a capture containing the term
cat
/clock
http http://localhost/gallery/image/caption/cat
http http://localhost/gallery/image/caption/clock
- Test that the webapp is reachable
Navigate to http://localhost/