Page History
...
- JS7 can be set up for use with a Kubernetes Cluster. Using the Linux based JS7 images for Docker® containers which ship with a current Alpine base image and OpenJDK.
- Docker® images for JS7 are publicly available from https://hub.docker.com/r/sosberlin/js7.
- Instructions on how to run containers for JS7 components products can be found from the JS7 - Installation for Containers article series.
- Users deploy JS7 components products by creating a Kubernetes deployment object from a deployment YAML file.
- To this purpose users have to first install and set up the Kubernetes Cluster see JS7 - How to install a Kubernetes Cluster.
- With the Kubernetes Cluster being up and running users can use YAML deployment files to deploy JS7 componentsproducts.
Deployment Files
The YAML sample files for deployment to Kubernetes are attached to the article.
...
The archive includes the following files.
Deployment of JS7
...
Products: js7-deployment.yaml
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
apiVersion: v1 kind: Pod metadata: creationTimestamp: null labels: run: js7joc name: js7joc spec: volumes: - name: hibernate-config configMap: name: hibernate-config containers: - image: sosberlin/js7:joc-2-5-1 name: js7joc ports: - containerPort: 4446 volumeMounts: - name: hibernate-config mountPath: /var/sos-berlin.com/js7/joc/resources/joc/ env: - name: RUN_JS_JAVA_OPTIONS value: "-Xmx256m" - name: RUN_JS_USER_ID value: "0:0" - image: sosberlin/js7:controller-2-5-1 name: js7con ports: - containerPort: 4444 env: - name: RUN_JS_JAVA_OPTIONS value: "-Xmx256m" - name: RUN_JS_USER_ID value: "0:0" - name: RUN_JS_ID value: "jobscheduler" - image: sosberlin/js7:agent-2-5-1 name: js7agent ports: - containerPort: 4445 env: - name: RUN_JS_JAVA_OPTIONS value: "-Xmx256m" - name: RUN_JS_USER_ID value: "0:0" |
...
- Each container runs a different image from the
sosberlin/js7
repository and is assigned a unique port. Each container defines environment variables which control a number of runtime parameters for the application such as:
RUN_JS_JAVA_OPTIONS
: see JS7 - FAQ - Which Java Options are recommendedRUN_JS_USER_ID
: specifies the numeric User ID and Group ID - separated by a colon - of the run-time account used for the related JS7 componentproduct. A value0:0
indicates the root account and root group, a value1000:1000
specifies a user account with the given User ID and Group ID. For details see JS7 - Running Containers for User Accounts.RUN_JS_ID
: specifies the Controller ID which is a unique identifier for a Standalone Controller or Controller Cluster.
For the
js7joc
container the volumeMounts element specifies thehibernate-config
ConfigMap which is mounted to the/var/sos-berlin.com/js7/joc/resources/joc
directory.
...
- Download the archive file: js7-kubernetes.zip. Open a console window from the directory where you downloaded the .zip archive and extract the archive.
Execute the below command to create a ConfigMap and to pass the
hibernate.cfg.xml
file to the mount directory of the container.Code Block kubectl create configmap hibernate-config --from-file=hibernate.cfg.xml
Run the
js7-deployment.yaml
file to create the deployment for the JS7 configuration.Code Block kubectl create -f js7-deployment.yaml
Run the
js7-service.yaml
file to create the service for the JS7 configuration.Code Block kubectl create -f js7-service.yaml
Once both YAML files are executed successfully, users can check the Pods' status. The following command displays Pods running in the Kubernetes Cluster.
Code Block kubectl get pods
Once both YAML files are executed successfully, users can check the steps from the YAML file executed to create the Pod. The following command displays resources used in Kubernetes. It shows data from a single resource and from a collection of resources.
Code Block kubectl describe pods
The following command can be executed to check the IP address and port of JS7 componentsproducts.
Code Block kubectl get service
...