Date: Fri, 29 Mar 2024 09:06:55 +0000 (UTC) Message-ID: <1328549582.12655.1711703215731@change.sos-berlin.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_12654_1975336399.1711703215731" ------=_Part_12654_1975336399.1711703215731 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The YAML sample files for deployment to Kubernetes using Helm are attach= ed to the article.
Download the archive file: buildachart_js7_working.zip
The archive includes the following files.
js7-deployment=
.yaml
apiVersio= n: 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 | def= ault .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.image= Controller.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 co= ntainers and a ConfigMap. The Pod includes three= containers:
js7joc
container r=
uns the joc-2-5-1
<=
em> image and exposes port&nb=
sp;4446
. It uses a ConfigMap=
with the name hibernate-config=
code> to specify a volume mounted to the /var/sos-berlin.com/js7/joc/resources/joc=
directory.
js7con
container r=
uns the controller-2-5-1
i=
mage and exposes port 4444
.js7agent
container=
runs the agent-2-5-1
imag=
e and exposes port 4445.
The following implication= s apply:
=
sosberlin/js7
repository and is assigned a unique port.=
span>For the js7joc
cont=
ainer the volumeMounts element=
specifies the hibernate-config
<=
/span>ConfigMap which is mounted to the&nb=
sp;/var/sos-berlin.com/js7/joc/resources=
/joc
directory.
js7-service.yaml
replicaCo= unt: 1 image: repository: sosberlin/js7 pullPolicy: IfNotPresent tag: "joc-2-5-1" imageController: repository: sosberlin/js7 pullPolicy: IfNotPresent tag: "controller-2-5-1" imageAgent: repository: sosberlin/js7 pullPolicy: IfNotPresent tag: "agent-2-5-1" imagePullSecrets: [] nameOverride: "" fullnameOverride: "" serviceAccount: create: true annotations: {} name: "" podAnnotations: {} podSecurityContext: {} securityContext: {} service: type: ClusterIP port: 4446 serviceController: type: ClusterIP port: 4444 serviceAgent: type: ClusterIP port: 4445 ingress: enabled: false className: "" annotations: {} hosts: - host: chart-example.local paths: - path: / pathType: ImplementationSpecific tls: [] resources: {} autoscaling: enabled: false minReplicas: 1 maxReplicas: 100 targetCPUUtilizationPercentage: 80 nodeSelector: {} tolerations: [] affinity: {}
To operate JOC Cockpit in a Kubernetes Cluster with the helm chart users=
adjust the values.yaml
fi=
le that specifies the container images and port forwarded.
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 de= bug to inspect the generated definitions. The service.internalPort value is used here to ensure that the Service and Dep= loyment objects work together correctly.
Run the below command to run the pods on= the internal port.