This post explains how to install and provision a JHipster container on Oracle Cloud Managed Container Engine for Kubernetes (sometimes referred to as OKE).
First, let's explore the components that you need to build and deploy a JHipster container on Container Engine for Kubernetes.
Connect to your Oracle Linux 8 Compute VM as opc and run perform the following steps:
Create a local folder call jhipster and go to it:
mkdir jhipster && cd jhipster
Run npm install and choose the default values to generate an application:
npm install -g generator-jhipster
The “INFO! Congratulations, JHipster execution is complete!” message appears.
Now, for the Kubernetes configuration files, create a folder called kubernetes and go to it:
mkdir kubernetes && cd kubernetes
Run the following command:
Verify that Docker is installed and running.
Switch back to the JHipster application folder to generate the missing Docker image, and run the embedded Maven wrapper to create it:
cd /home/opc/jhipster ./mvnw package -Pprod verify jib:dockerBuild
This process takes a couple of minutes. After it’s finished, the next steps are to connect to the Oracle Cloud Infrastructure Registry (referred to as OCIR) and then tag and push the new image.
Log in to the Registry using the Docker CLI. This example uses the Phoenix data center. Additional region names and codes are available in the documentation.
docker login -u oci_tenancy_name/username_admin phx.ocir.io
After the login command has successfully run, ensure that the jhipster/jhipster-deployment.yaml file contains the :latest build info in the jhipster image line:
… name: jhipster image: phx.ocir.io/tenancy_name/jhipster:latest …
Now, tag and push the new JHipster app container into the Registry:
docker image tag jhipster phx.ocir.io/tenancy_name/jhipster docker push phx.ocir.io/tenancy_name/jhipster
Check your tenancy’s Registry and verify you have a new repo called jhipster.
Finally, to provision the Docker image in the Oracle Kubernetes cluster, run the apply command created in the folder that you generated in your Kubernetes configuration previously.
That's it! After a few seconds, the new containers and services are ready. The JHipster container portal in Container Engine for Kubernetes should be available and accessible through the load balancer public IP address that was created during the container provisioning process (http://public_IP_address:8080). Ensure that port 8080 is open for public communication.