Page History
...
Introduction
- JS7 can be set up for use with from a Helm Chart. Using the Linux-based JS7 container images for Docker® containers which ship with a current Alpine base image and OpenJDK.
- Docker® Container images for JS7 are publicly available from https://hub.docker.com/r/sosberlin/js7.
- Deploying containers using Kubernetes Cluster is publicly available explained from JS7 - How to deploy to a Kubernetes Cluster.
- Instructions on how to run containers for JS7 components products can be found in the JS7 - Installation for Docker Containers article series.
- Users deploy JS7 components products by creating a Kubernetes deployment object from a deployment YAML file.
- For this purpose, users have to first install and set up the Kubernetes Cluster see JS7 - How to install a Kubernetes Cluster.
- With the Helm Chart being up and running users can use values YAML files to deploy JS7 componentsproducts.
Deployment Files
The YAML sample files for deployment to Kubernetes using Helm are attached to the article.
Download the archive file: buildachart_js7_workingworking.zip
The archive includes the following files.
Deployment of JS7
...
Products: js7-deployment.yaml
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "buildachart.fullname" . }} labels: {{- include "buildachart.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} selector: matchLabels: {{- include "buildachart.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "buildachart.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "buildachart.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} volumes: - name: hibernate-config configMap: name: hibernate-config containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http containerPort: {{ .Values.service.port }} protocol: TCP volumeMounts: - name: hibernate-config mountPath: /var/sos-berlin.com/js7/joc/resources/joc/ - name: js7con image: "{{ .Values.imageController.repository }}:{{ .Values.imageController.tag | default .Chart.AppVersion }}" ports: - name: http containerPort: {{ .Values.serviceController.port }} protocol: TCP - name: js7ag image: "{{ .Values.imageAgent.repository }}:{{ .Values.imageAgent.tag | default .Chart.AppVersion }}" ports: - name: http containerPort: {{ .Values.serviceAgent.port }} protocol: TCP resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} |
The YAML file describes a single Pod for deployment to Kubernetes which is a group of one or more containers and a ConfigMap. The Pod includes three containers:
- The
js7joc
container runs thejoc-2-5-1
image and exposes port4446
. It uses a ConfigMap with the namehibernate-config
to specify a volume mounted to the/var/sos-berlin.com/js7/joc/resources/joc
directory. - The
js7con
container runs thecontroller-2-5-1
image and exposes port4444
. - The
js7agent
container runs theagent-2-5-1
image and exposes port4445.
The following implications apply:
- Each container runs a different image from the
sosberlin/js7
repository and is assigned a unique port. 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.
...
To operate JOC Cockpit in a Kubernetes Cluster with the helm chart users adjust the values.yaml
file that specifies the Docker container images and Port Forwardedport forwarded.
- Download the archive file: buildachart_js7_workingworking.zip. Open a console window from the directory where you downloaded the .zip archive and extract the archive.
Execute the below command to deploy working charts using the helm install command. We can do a dry-run of a helm install and enable debug to inspect the generated definitions.The service.internalPort value is used here to ensure that the Service and Deployment objects work together correctly.
helm install buildachart_js7_working --dry-run --debug ./buildachart_js7_working --set service.internalPort=4446
Run the below command to run the pods on the internal port.
helm install js7 ./buildachart_js7_working --set service.type=NodePort
...
- JS7 - How to install a Kubernetes Cluster
- JS7 - Running Containers for User Accounts
- JS7 - Build Container Images