Skip to content

Commit

Permalink
Initial version for webMethods Helm Charts
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Friedhoff committed Feb 26, 2024
1 parent 4212488 commit 1e0d10a
Show file tree
Hide file tree
Showing 10 changed files with 262 additions and 205 deletions.
7 changes: 7 additions & 0 deletions terracottabigmemorymax/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@ version: "1.1.0"
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: "4.4.0"

dependencies:
- name: common
repository: "https://open-source.softwareag.com/webmethods-helm-charts/charts"
tags:
- softwareag-common
version: 1.x.x
3 changes: 2 additions & 1 deletion terracottabigmemorymax/helm/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ kubectl create secret generic certificatesecret \
### Step #2: Install the helm chart and use the above created secret.

````
helm install "my-release" --set stripeCount=2 --set nodeCountPerStripe=1 --set-file license=/home/[email protected]/4.xlicense/license.key --set tag=4.3.10-SNAPSHOT --set security=true --set secretName=certificatesecret .
helm install "my-release" --set terracotta.stripeCount=2 --set terracotta.nodeCountPerStripe=1 --set-file license=/home/[email protected]/4.xlicense/license.key --set tag=4.3.10-SNAPSHOT --set security=true --set secretName=certificatesecret .
````

### Step #3: Verify from the browser to see if connections can be created securely to tmc.
Expand Down Expand Up @@ -164,5 +164,6 @@ helm delete <release-name>
|---------|-------------------------|
| `1.0.0' | Initial release |
| `1.1.0' | Available from GitHub |
| `1.2.0' | Adapted to webMethods Helm charts |

{{ template "chart.valuesSection" . }}
49 changes: 3 additions & 46 deletions terracottabigmemorymax/helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,53 +21,10 @@
Expand the name of the chart.
*/}}

{{- define "kube-terracotta.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 50 | trimSuffix "-" -}}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
The components in this chart create additional resources that expand the longest created name strings.
The longest name that gets created adds and extra 37 characters, so truncation should be 63-35=26.
Create the name of the license config map
*/}}
{{- define "kube-terracotta.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 26 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 26 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 26 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/* Create chart name and version as used by the chart label. */}}
{{- define "kube-terracotta.chartref" -}}
{{- replace "+" "_" .Chart.Version | printf "%s-%s" .Chart.Name -}}
{{- define "terracotta.licenseConfigMapName" -}}
{{- default ( printf "%s-%s" (include "common.names.fullname" .) "license") .Values.licenseConfigMap }}
{{- end }}

{{/* Generate basic labels */}}
{{- define "kube-terracotta.labels" -}}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: "{{ replace "+" "_" .Chart.Version }}"
app.kubernetes.io/part-of: {{ template "kube-terracotta.name" . }}
chart: {{ template "kube-terracotta.chartref" . }}
release: {{ $.Release.Name | quote }}
heritage: {{ $.Release.Service | quote }}
{{- end }}

{{/*
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
*/}}
{{- define "kube-terracotta.namespace" -}}
{{- if .Values.namespaceOverride -}}
{{- .Values.namespaceOverride -}}
{{- else -}}
{{- .Release.Namespace -}}
{{- end -}}
{{- end -}}
11 changes: 8 additions & 3 deletions terracottabigmemorymax/helm/templates/license-configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{ if .Values.license }}
---
# /*
# * Copyright (c) 2021 Software AG, Darmstadt, Germany and/or its licensors
# *
Expand All @@ -19,10 +21,13 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: license-configmap
namespace: {{ template "kube-terracotta.namespace" . }}
name: {{ include "terracotta.licenseConfigMapName" . }}
labels:
{{ include "kube-terracotta.labels" . | indent 4 }}
{{- include "common.labels.standard" . | nindent 4 }}
{{- with .Values.extraLabels -}}
{{ toYaml . | nindent 4 }}
{{- end }}
data:
license.key: |
{{- .Values.license | nindent 4 }}
{{- end }}
47 changes: 23 additions & 24 deletions terracottabigmemorymax/helm/templates/server-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: server-configmap
namespace: {{ template "kube-terracotta.namespace" . }}
name: {{ include "common.names.fullname" . }}-server-configmap
labels:
{{ include "kube-terracotta.labels" . | indent 4 }}
{{- include "common.labels.standard" . | nindent 4 }}
{{- with .Values.extraLabels -}}
{{ toYaml . | nindent 4 }}
{{- end }}
data:
license.key: |
{{- .Values.license | nindent 4 }}
tc-config.xml: |
<?xml version="1.0" encoding="UTF-8"?>
<!--
Expand All @@ -34,23 +34,23 @@ data:
-->
<tc:tc-config xmlns:tc="http://www.terracotta.org/config">
<servers secure="{{ $.Values.security }}">
{{- range $i := until (int $.Values.stripeCount) }}
<servers secure="{{ $.Values.terracotta.security }}">
{{- range $i := until (int $.Values.terracotta.stripeCount) }}
<mirror-group>
{{- range $j := until (int $.Values.nodeCountPerStripe) }}
<server host="terracotta-{{ add (mul $i $.Values.nodeCountPerStripe) $j }}.terracotta-service.{{ template "kube-terracotta.namespace" $ }}.svc.cluster.local" name="terracotta-{{ add (mul $i $.Values.nodeCountPerStripe) $j }}.terracotta-service.{{ template "kube-terracotta.namespace" $ }}.svc.cluster.local">
<tsa-port>9510</tsa-port>
<tsa-group-port>9530</tsa-group-port>
<management-port>9540</management-port>
{{- range $j := until (int $.Values.terracotta.nodeCountPerStripe) }}
<server host="{{ include "common.names.fullname" $ }}-{{ add (mul $i $.Values.terracotta.nodeCountPerStripe) $j }}.{{ include "common.names.fullname" $ }}-tsa-service.{{ $.Release.Namespace }}.svc.cluster.local" name="{{ include "common.names.fullname" $ }}-{{ add (mul $i $.Values.terracotta.nodeCountPerStripe) $j }}.{{ include "common.names.fullname" $ }}-tsa-service.{{ $.Release.Namespace }}.svc.cluster.local">
<tsa-port>{{ $.Values.terracotta.tsaport }} </tsa-port>
<tsa-group-port>{{ $.Values.terracotta.tsagroupport }}</tsa-group-port>
<management-port>{{ $.Values.terracotta.tsamanagementport }}</management-port>
<data>/opt/softwareag/run/data</data>
<logs>/opt/softwareag/run/logs</logs>
<dataStorage size={{ $.Values.datastoreSize | quote }}>
<offheap size={{ $.Values.offHeapSize | quote }}/>
<dataStorage size={{ $.Values.terracotta.datastoreSize | quote }}>
<offheap size={{ $.Values.terracotta.offHeapSize | quote }}/>
</dataStorage>
{{- if eq $.Values.security true }}
{{- if eq $.Values.terracotta.security true }}
<security>
<ssl>
<certificate>jks:terracotta-{{ add (mul $i $.Values.nodeCountPerStripe) $j }}-alias@/opt/softwareag/run/terracotta-{{ add (mul $i $.Values.nodeCountPerStripe) $j }}-keystore.jks</certificate>
<certificate>jks:terracotta-{{ add (mul $i $.Values.terracotta.nodeCountPerStripe) $j }}-alias@/opt/softwareag/run/terracotta-{{ add (mul $i $.Values.terracotta.nodeCountPerStripe) $j }}-keystore.jks</certificate>
</ssl>
<keychain>
<class>com.terracotta.management.keychain.FileStoreKeyChain</class>
Expand All @@ -61,18 +61,17 @@ data:
<url>file:/opt/softwareag/run/terracotta.ini</url>
<user>user</user>
</auth>
<management>
<ia> https://tmc-0.tmc-service.{{ $.Values.namespace }}.svc.cluster.local:9443/tmc/api/assertIdentity</ia>
<timeout>10000</timeout>
<hostname>terracotta-{{ add (mul $i $.Values.nodeCountPerStripe) $j }}.terracotta-service.{{ template "kube-terracotta.namespace" $ }}.svc.cluster.local</hostname >
</management>
<management>
<ia>https://{{ include "common.names.fullname" $ }}-tmc-service.{{ $.Release.namespace }}.svc.cluster.local:{{ $.Values.terracotta.tmcsecureport }}/tmc/api/assertIdentity</ia>

This comment has been minimized.

Copy link
@mobasherul

mobasherul Feb 28, 2024

Collaborator

https://tmc-0.{{ include "common.names.fullname" $ }}-tmc-service.{{ $.Release.Namespace }}.svc.cluster.local

This comment has been minimized.

Copy link
@mobasherul

mobasherul Feb 28, 2024

Collaborator

Namespace n should be capital

<timeout>10000</timeout>
<hostname>{{ include "common.names.fullname" $ }}-tsa-service.{{ $.Release.Namespace $ }}.svc.cluster.local</hostname >

This comment has been minimized.

Copy link
@mobasherul

mobasherul Feb 28, 2024

Collaborator

{{ include "common.names.fullname" $ }}-{{ add (mul $i $.Values.terracotta.nodeCountPerStripe) $j }}.{{ include "common.names.fullname" $ }}-tsa-service.{{ $.Release.Namespace }}.svc.cluster.local

</management>
</security>
{{- end }}
</server>
{{- end }}
</mirror-group>
{{- end }}
<restartable enabled={{ $.Values.restartable | quote }}/>
<restartable enabled={{ $.Values.terracotta.restartable | quote }}/>
</servers>
</tc:tc-config>
</tc:tc-config>
75 changes: 34 additions & 41 deletions terracottabigmemorymax/helm/templates/tc-server-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,20 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: terracotta
namespace: {{ template "kube-terracotta.namespace" . }}
name: {{ include "common.names.fullname" . }}
labels:
app: terracotta
{{ include "kube-terracotta.labels" . | indent 4 }}
{{- include "common.labels.standard" . | nindent 4 }}
{{- with .Values.extraLabels -}}
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
updateStrategy:
type: "OnDelete"
replicas: {{ mul $.Values.stripeCount $.Values.nodeCountPerStripe }}
replicas: {{ mul $.Values.terracotta.stripeCount $.Values.terracotta.nodeCountPerStripe }}
selector:
matchLabels:
app: terracotta
serviceName: terracotta-service
serviceName: {{ include "common.names.fullname" . }}-tsa-service
template:
metadata:
labels:
Expand All @@ -47,64 +48,56 @@ spec:
- name: server
image: "{{ $.Values.registry }}/{{ $.Values.serverImage }}:{{ $.Values.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ $.Values.pullPolicy | quote }}
readinessProbe:
tcpSocket:
port: 9530
initialDelaySeconds: 30
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 5
failureThreshold: {{ $.Values.probeFailureThreshold }}
livenessProbe:
tcpSocket:
port: 9530
initialDelaySeconds: 30
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 5
failureThreshold: {{ $.Values.probeFailureThreshold }}

startupProbe:
tcpSocket:
port: 9530
initialDelaySeconds: 10
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 5
failureThreshold: {{ $.Values.probeFailureThreshold }}
{{- toYaml .Values.tsaServer.startupProbe | nindent 12 }}
livenessProbe:
{{- toYaml .Values.tsaServer.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .Values.tsaServer.readinessProbe | nindent 12 }}
{{- if and .Values.resources .Values.resourves.tsaContainer }}

This comment has been minimized.

Copy link
@mobasherul

mobasherul Feb 28, 2024

Collaborator

it should be resources

resources:
{{- toYaml .Values.resources.tsaContainer | nindent 12 }}
{{- end }}
volumeMounts:
- name: commonconfig-volume
mountPath: /opt/softwareag/config
- name: core-store
mountPath: /opt/softwareag/run
env:
- name: JSON_LOGGING
value: {{ $.Values.jsonLogging | quote }}
value: {{ $.Values.terracotta.jsonLogging | quote }}
{{- if eq $.Values.security true }}

This comment has been minimized.

Copy link
@mobasherul

mobasherul Feb 28, 2024

Collaborator

{{- if eq $.Values.terracotta.security true }}

{{- if eq $.Values.selfSignedCerts true }}

This comment has been minimized.

Copy link
@mobasherul

mobasherul Feb 28, 2024

Collaborator

{{- if eq $.Values.terracotta.selfSignedCerts true }}

- name: JAVA_OPTS
value: {{ $.Values.serverOpts }} -Djavax.net.ssl.trustStore=/opt/softwareag/run/truststore.jks
value: {{ $.Values.terracotta.serverOpts }} -Djavax.net.ssl.trustStore=/opt/softwareag/run/truststore.jks
{{- else }}
{{- if ne $.Values.serverOpts "" }}
{{- if ne $.Values.terracotta.serverOpts "" }}
- name: JAVA_OPTS
value: {{ $.Values.serverOpts }}
value: {{ $.Values.terracotta.serverOpts }}
{{- end }}
{{- end }}
{{- else }}
{{- if ne $.Values.serverOpts "" }}
{{- if ne $.Values.terracotta.serverOpts "" }}
- name: JAVA_OPTS
value: {{ $.Values.serverOpts }}
value: {{ $.Values.terracotta.serverOpts }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.extraEnvs }}
{{- toYaml .Values.extraEnvs | nindent 12 }}
{{- end }}
volumes:
- name: commonconfig-volume
projected:
sources:
- configMap:
name: server-configmap
{{- if eq $.Values.security true }}
- configMap:
name: {{ include "common.names.fullname" . }}-server-configmap
- configMap:
name: {{ include "terracotta.licenseConfigMapName" . }}
{{- if eq $.Values.terracotta.security true }}
- secret:
name: {{ required "A valid server certs is required!" $.Values.secretName }}
{{- end}}
name: {{ required "A valid server certs is required!" $.Values.terracotta.secretName }}
{{- end }}
volumeClaimTemplates:
- metadata:
name: core-store
Expand Down
20 changes: 11 additions & 9 deletions terracottabigmemorymax/helm/templates/tc-servers-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,23 @@
apiVersion: v1
kind: Service
metadata:
name: terracotta-service
namespace: {{ template "kube-terracotta.namespace" . }}
name: {{ include "common.names.fullname" . }}-tsa-service
labels:
app: terracotta
{{ include "kube-terracotta.labels" . | indent 4 }}
{{- include "common.labels.standard" . | nindent 4 }}
{{- with .Values.extraLabels -}}
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
type: ClusterIP
clusterIP: None
ports:
- name: tsa-port
port: 9510
- name: group-port
port: 9530
- name: management-port
port: 9540
- name: tsaport
port: {{ .Values.terracotta.tsaport }}
- name: groupport
port: {{ .Values.terracotta.tsagroupport }}
- name: managementport
port: {{ .Values.terracotta.tsamanagementport }}
selector:
app: terracotta
publishNotReadyAddresses: true
21 changes: 11 additions & 10 deletions terracottabigmemorymax/helm/templates/tmc-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,24 @@
apiVersion: v1
kind: Service
metadata:
name: tmc-service
name: {{ include "common.names.fullname" . }}-tmc-service
annotations:
prometheus.io/scrape: 'true'
prometheus.io/path: '/tmc/api/prometheus'
namespace: {{ template "kube-terracotta.namespace" . }}
{{- include "common.prometheus.annotations" (dict "port" .Values.terracotta.tmcManagmentPort "path" "/tmc/api/prometheus" ) | nindent 8 }}
labels:
app: tmc
{{ include "kube-terracotta.labels" . | indent 4 }}
{{- include "common.labels.standard" . | nindent 4 }}
{{- with .Values.extraLabels -}}
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
type: ClusterIP
clusterIP: None
ports:
- name: management-port
port: 9889
{{- if eq $.Values.security true }}
- name: secure-port
port: 9443
- name: managementport
port: {{ .Values.terracotta.tmcmanagementport }}
{{- if eq $.Values.terracotta.security true }}
- name: secureport
port: {{ .Values.terracotta.tmcsecureport }}
{{- end }}
selector:
app: tmc
Expand Down
Loading

0 comments on commit 1e0d10a

Please sign in to comment.