Skip to content

Commit

Permalink
Merge pull request #840 from intershop/release/develop/icm
Browse files Browse the repository at this point in the history
Release icm-as:minor icm-web:patch
  • Loading branch information
khauser authored Nov 22, 2024
2 parents 4834238 + 5fd4b95 commit 6808538
Show file tree
Hide file tree
Showing 22 changed files with 471 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint-test_icm-as-integrationtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
sudo mkdir -p /data/icm/sites
sed -i 's/<local sites folder>/\/data\/icm\/sites/' charts/icm-as/values.yaml
sudo mkdir -p /data/icm/encryption
sed -i 's/<local encryption folder>/\/data\/icm\/encryption/' charts/icm-as/values.yaml
Expand Down
2 changes: 1 addition & 1 deletion charts/icm-as/.bumpversion.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.bumpversion]
current_version = "2.2.0"
current_version = "2.3.0"

[[tool.bumpversion.files]]
filename = "Chart.yaml"
Expand Down
19 changes: 19 additions & 0 deletions charts/icm-as/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@

<a name="icm-as-2.3.0"></a>
## [icm-as-2.3.0](https://github.com/intershop/helm-charts/compare/icm-as-2.2.0...icm-as-2.3.0)

> 2024-11-22
### Chore

* bump versions of icm-as:minor icm-web:patch

### Feat

* enhance icm infrastructure probing by file system probes ([#829](https://github.com/intershop/helm-charts/issues/829))

### Fix

* fix inframon jvm-options ([#838](https://github.com/intershop/helm-charts/issues/838))


<a name="icm-as-2.2.0"></a>
## [icm-as-2.2.0](https://github.com/intershop/helm-charts/compare/icm-as-2.1.1...icm-as-2.2.0)

> 2024-09-03
### Chore

* generated changelog+release notes for icm:minor icm-as:minor icm-replication:minor
* bump versions of icm:minor icm-as:minor icm-replication:minor

### Feat
Expand Down
2 changes: 1 addition & 1 deletion charts/icm-as/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
# name and version must be in this exact order, otherwise bump2version won't work
name: icm-as
version: 2.2.0
version: 2.3.0
description: Intershop Commerce Management - AppServer
type: application
appVersion: 11.10.3-LTS
14 changes: 9 additions & 5 deletions charts/icm-as/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@

<a name="icm-as-2.2.0"></a>
## [icm-as-2.2.0](https://github.com/intershop/helm-charts/compare/icm-as-2.1.1...icm-as-2.2.0)
<a name="icm-as-2.3.0"></a>
## [icm-as-2.3.0](https://github.com/intershop/helm-charts/compare/icm-as-2.2.0...icm-as-2.3.0)

> 2024-09-03
> 2024-11-22
### Chore

* bump versions of icm:minor icm-as:minor icm-replication:minor
* bump versions of icm-as:minor icm-web:patch

### Feat

* **icm:** New replication environment configuration ([#803](https://github.com/intershop/helm-charts/issues/803))
* enhance icm infrastructure probing by file system probes ([#829](https://github.com/intershop/helm-charts/issues/829))

### Fix

* fix inframon jvm-options ([#838](https://github.com/intershop/helm-charts/issues/838))

40 changes: 22 additions & 18 deletions charts/icm-as/templates/_environments.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,31 +59,15 @@ env:
value: {{ printf "jdbc:sqlserver://%s-mssql-service:1433;database=%s" (include "icm-as.fullname" .) .Values.mssql.databaseName }}
- name: INTERSHOP_JDBC_USER
value: "{{ .Values.mssql.user }}"
- name: INTERSHOP_JDBC_PASSWORD
{{- /* passwordSecretKeyRef has precedence over password */ -}}
{{- if .Values.mssql.passwordSecretKeyRef }}
valueFrom:
secretKeyRef:
{{- toYaml .Values.mssql.passwordSecretKeyRef | nindent 6 }}
{{- else }}
value: "{{ .Values.mssql.password }}"
{{- end }}
{{ include "icm-as.envDatabasePassword" (list "INTERSHOP_JDBC_PASSWORD" .Values.mssql.passwordSecretKeyRef .Values.mssql.password) -}}
{{- else }}
- name: INTERSHOP_DATABASETYPE
value: "{{ .Values.database.type }}"
- name: INTERSHOP_JDBC_URL
value: "{{ .Values.database.jdbcURL }}"
- name: INTERSHOP_JDBC_USER
value: "{{ .Values.database.jdbcUser }}"
- name: INTERSHOP_JDBC_PASSWORD
{{- /* jdbcPasswordSecretKeyRef has precedence over jdbcPassword */ -}}
{{- if .Values.database.jdbcPasswordSecretKeyRef }}
valueFrom:
secretKeyRef:
{{- toYaml .Values.database.jdbcPasswordSecretKeyRef | nindent 6 }}
{{- else }}
value: "{{ .Values.database.jdbcPassword }}"
{{- end }}
{{ include "icm-as.envDatabasePassword" (list "INTERSHOP_JDBC_PASSWORD" .Values.database.jdbcPasswordSecretKeyRef .Values.database.jdbcPassword) -}}
{{- end }}
{{ include "icm-as.envReplication" . }}
{{ include "icm-as.featuredJVMArguments" . }}
Expand Down Expand Up @@ -221,3 +205,23 @@ AppServer-specific-environment
{{- end }}
{{- include "icm-as.envSecrets" . }}
{{- end -}}

{{/*
JDBC password env-entry (name+value)
expecting to get called like:
{{ include "icm-as.envDatabasePassword" (list "INTERSHOP_JDBC_PASSWORD" .Values.database.jdbcPasswordSecretKeyRef .Values.database.jdbcPassword) -}}
*/}}
{{- define "icm-as.envDatabasePassword" -}}
{{- $envName := index . 0 }}
{{- $secretKeyRef := index . 1 }}
{{- $plainPassword := index . 2 }}
{{- /* secretKeyRef has precedence over plainPassword */ -}}
- name: {{ $envName }}
{{- if $secretKeyRef }}
valueFrom:
secretKeyRef:
{{- toYaml $secretKeyRef | nindent 6 }}
{{- else }}
value: "{{ $plainPassword }}"
{{- end }}
{{- end -}}
132 changes: 132 additions & 0 deletions charts/icm-as/templates/_infrastructureMonitoring.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Creates init-containers
*/}}
{{- define "icm-as.infrastructureMonitoringContainer" -}}
{{- if .Values.infrastructureMonitoring.enabled }}
- name: infrastructure-monitoring
image: {{ .Values.infrastructureMonitoring.image.repository }}
imagePullPolicy: {{ .Values.infrastructureMonitoring.imagePullPolicy | default "IfNotPresent" }}
env:
{{- if .Values.mssql.enabled }}
- name: QUARKUS_DATASOURCE_JDBC_URL
value: {{ printf "jdbc:sqlserver://%s-mssql-service:1433;database=%s;TrustServerCertificate=True;" (include "icm-as.fullname" .) .Values.mssql.databaseName }}
- name: QUARKUS_DATASOURCE_USERNAME
value: "{{ .Values.mssql.user }}"
{{ include "icm-as.envDatabasePassword" (list "QUARKUS_DATASOURCE_PASSWORD" .Values.mssql.passwordSecretKeyRef .Values.mssql.password) | indent 2 }}
{{- else }}
- name: QUARKUS_DATASOURCE_JDBC_URL
{{ if regexMatch ".+;$" .Values.database.jdbcURL -}}
value: "{{ .Values.database.jdbcURL }}TrustServerCertificate=True;"
{{- else -}}
value: "{{ .Values.database.jdbcURL }};TrustServerCertificate=True;"
{{- end }}
- name: QUARKUS_DATASOURCE_USERNAME
value: "{{ .Values.database.jdbcUser }}"
{{ include "icm-as.envDatabasePassword" (list "QUARKUS_DATASOURCE_PASSWORD" .Values.database.jdbcPasswordSecretKeyRef .Values.database.jdbcPassword) | indent 2 }}
{{- end }}
- name: JAVA_OPTS_APPEND
value: '{{ include "icm-as.infrastructureMonitoringContainer.commonProbeOpts" (list .Values.infrastructureMonitoring.databaseLatency (dict "name" "databaseLatency" "type" "JDBC_LATENCY")) }} {{ include "icm-as.infrastructureMonitoringContainer.fsProbeOpts" (list .Values.infrastructureMonitoring.sitesLatency (dict "name" "sitesLatency" "type" "FILE_SYSTEM_LATENCY")) }} {{ include "icm-as.infrastructureMonitoringContainer.fsTpProbeOpts" (list .Values.infrastructureMonitoring.sitesReadThroughput (dict "name" "sitesReadThroughput" "type" "FILE_SYSTEM_READ_THROUGHPUT")) }} {{ include "icm-as.infrastructureMonitoringContainer.fsTpProbeOpts" (list .Values.infrastructureMonitoring.sitesWriteThroughput (dict "name" "sitesWriteThroughput" "type" "FILE_SYSTEM_WRITE_THROUGHPUT")) }}'
ports:
- name: inframonitoring
containerPort: 8080
protocol: TCP
resources:
limits:
cpu: 100m
memory: 200Mi
requests:
cpu: 100m
memory: 200Mi
{{ include "icm-as.volumeMounts" . | indent 2 }}
{{ include "icm-as.infrastructureMonitoringContainer.k8sProbe" (list "started" 3 60 10) }}
{{ include "icm-as.infrastructureMonitoringContainer.k8sProbe" (list "live" 3 30 10) }}
{{ include "icm-as.infrastructureMonitoringContainer.k8sProbe" (list "ready" 3 30 10) }}
{{- end }}
{{- end -}}

{{/*
creates a K8s probe configuration (startup, liveness, readiness)
expecting to get called like:
{{ include "icm-as.infrastructureMonitoringContainer.k8sProbe" (list "<type>" <failureThreshold> <initialDelaySeconds> <periodSeconds>) }}
with
<type>: one of [started, live, ready]
<failureThreshold>: failure threshold (count)
<initialDelaySeconds>: initial delay (seconds)
<periodSeconds>: period (seconds)
*/}}
{{- define "icm-as.infrastructureMonitoringContainer.k8sProbe" -}}
{{- $type := index . 0 }}
{{- $failureThreshold := index . 1 }}
{{- $initialDelaySeconds := index . 2 }}
{{- $periodSeconds := index . 3 }}
{{- if eq $type "started" }}
startupProbe:
{{- else if eq $type "live" }}
livenessProbe:
{{- else }}
readinessProbe:
{{- end }}
httpGet:
path: /q/health/{{ $type }}
port: inframonitoring
failureThreshold: {{ $failureThreshold }}
initialDelaySeconds: {{ $initialDelaySeconds }}
periodSeconds: {{ $periodSeconds }}
{{- end -}}

{{/*
creates an infrastructure probe configuration (common options)
expecting to get called like:
- name: JAVA_OPTS_APPEND
value: '{{ include "icm-as.infrastructureMonitoringContainer.commonProbeOpts" (list .Values.infrastructureMonitoring.databaseLatency (dict "name" "databaseLatency" "type" "JDBC_LATENCY")) }}'
replace: '.Values.infrastructureMonitoring.databaseLatency' by the probe's values
"databaseLatency" by the probe's name
"JDBC_LATENCY" by the probe's type
*/}}
{{- define "icm-as.infrastructureMonitoringContainer.commonProbeOpts" -}}
{{- $probeValues := index . 0 }}
{{- $probeOpts := index . 1 }}
{{- $probeName := $probeOpts.name }}
{{- $isEnabled := default false $probeValues.enabled }}
{{- $probeType := $probeOpts.type }}
{{- if $isEnabled -}}
{{- printf "-Dprobes.%s.enabled=%t -Dprobes.%s.type=%s -Dprobes.%s.interval=%s" $probeName $isEnabled $probeName (quote $probeType) $probeName (quote (default "60S" $probeValues.interval)) -}}
{{- end -}}
{{- end -}}
{{/*
creates an infrastructure probe configuration (file system related options)
expecting to get called like:
- name: JAVA_OPTS_APPEND
value: '{{ include "icm-as.infrastructureMonitoringContainer.fsProbeOpts" (list .Values.infrastructureMonitoring.sitesLatency (dict "name" "sitesLatency" "type" "FILE_SYSTEM_LATENCY")) }}'
replace: '.Values.infrastructureMonitoring.sitesLatency' by the probe's values
"sitesLatency" by the probe's name
"FILE_SYSTEM_LATENCY" by the probe's type
*/}}
{{- define "icm-as.infrastructureMonitoringContainer.fsProbeOpts" -}}
{{- $probeValues := index . 0 }}
{{- $probeOpts := index . 1 }}
{{- $probeName := $probeOpts.name }}
{{- $isEnabled := default false $probeValues.enabled }}
{{- $path := $probeValues.path }}
{{- include "icm-as.infrastructureMonitoringContainer.commonProbeOpts" (list $probeValues $probeOpts) }}{{- if $isEnabled }} {{ printf "-Dprobes.%s.path=%s" $probeName (quote $path) -}}{{- end -}}
{{- end -}}

{{/*
creates an infrastructure probe configuration (file system throughput related options)
expecting to get called like:
- name: JAVA_OPTS_APPEND
value: '{{ include "icm-as.infrastructureMonitoringContainer.fsThroughputProbeOpts" (list .Values.infrastructureMonitoring.sitesReadThroughput (dict "name" "sitesReadThroughput" "type" "FILE_SYSTEM_READ_THROUGHPUT")) }}'
replace: '.Values.infrastructureMonitoring.sitesReadThroughput' by the probe's values
"sitesReadThroughput" by the probe's name
"FILE_SYSTEM_READ_THROUGHPUT" by the probe's type
*/}}
{{- define "icm-as.infrastructureMonitoringContainer.fsTpProbeOpts" -}}
{{- $probeValues := index . 0 }}
{{- $probeOpts := index . 1 }}
{{- $probeName := $probeOpts.name }}
{{- $isEnabled := default false $probeValues.enabled }}
{{- $fileSize := $probeValues.fileSize }}
{{- include "icm-as.infrastructureMonitoringContainer.fsProbeOpts" (list $probeValues $probeOpts) }}{{- if $isEnabled }} {{ printf "-Dprobes.%s.fileSize=%s" $probeName (quote (default "5 Mi" $fileSize)) -}}{{- end -}}
{{- end -}}
1 change: 1 addition & 0 deletions charts/icm-as/templates/as-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ spec:
{{- include "icm-as.volumeMounts" . | nindent 8 }}
{{- include "icm-as.probes" . | nindent 8 }}
{{- include "icm-as.lifecycle" . | nindent 8 }}
{{- include "icm-as.infrastructureMonitoringContainer" . | nindent 6 }}
{{- include "icm-as.initContainers" . | nindent 6 }}
dnsPolicy: ClusterFirst
restartPolicy: Always
Expand Down
24 changes: 24 additions & 0 deletions charts/icm-as/templates/infrastructure-monitoring-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- if .Values.infrastructureMonitoring.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "icm-as.fullname" . }}-inframonitoring
labels:
app: {{ include "icm-as.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
annotations:
prometheus.io/path: /q/metrics
prometheus.io/scheme: http
prometheus.io/scrape: 'true'
prometheus.io/port: '8080'
spec:
ports:
- name: inframonitoring
port: 8080
targetPort: inframonitoring
selector:
app: icm-as
release: {{ include "icm-as.fullname" . }}
status:
loadBalancer: {}
{{- end }}
55 changes: 54 additions & 1 deletion charts/icm-as/tests/default-values_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ tests:
appVersion: 11.0.1
values:
- ../values.yaml
set:
infrastructureMonitoring.enabled: true
template: templates/as-deployment.yaml
asserts:
- isKind:
Expand Down Expand Up @@ -60,7 +62,7 @@ tests:
- equal:
path: spec.template.metadata.labels.app
value: icm-as
#spec.template.spec.containers
#spec.template.spec.containers[0]
- equal:
path: spec.template.spec.containers[0].name
value: icm-as-server
Expand Down Expand Up @@ -148,6 +150,57 @@ tests:
- equal:
path: spec.template.spec.containers[0].lifecycle.preStop.httpGet.path
value: /status/action/shutdown
#spec.template.spec.containers[1]
- equal:
path: spec.template.spec.containers[1].name
value: infrastructure-monitoring
- equal:
path: spec.template.spec.containers[1].image
value: intershophub/infrastructure-probing:2.0.1
- equal:
path: spec.template.spec.containers[1].imagePullPolicy
value: IfNotPresent
#spec.template.spec.containers[1].env
- contains:
path: spec.template.spec.containers[1].env
content:
name: QUARKUS_DATASOURCE_JDBC_URL
value: "jdbc:sqlserver://<ipaddress or hostname>:1433;databaseName=intershop;TrustServerCertificate=True;"
- contains:
path: spec.template.spec.containers[1].env
content:
name: QUARKUS_DATASOURCE_USERNAME
value: "intershop"
- contains:
path: spec.template.spec.containers[1].env
content:
name: QUARKUS_DATASOURCE_PASSWORD
value: "intershop"
- contains:
path: spec.template.spec.containers[1].env
content:
name: JAVA_OPTS_APPEND
value: '-Dprobes.databaseLatency.enabled=true -Dprobes.databaseLatency.type="JDBC_LATENCY" -Dprobes.databaseLatency.interval="60S" -Dprobes.sitesLatency.enabled=true -Dprobes.sitesLatency.type="FILE_SYSTEM_LATENCY" -Dprobes.sitesLatency.interval="60S" -Dprobes.sitesLatency.path="/intershop/sites/root" '
#spec.template.spec.containers[1].ports
- contains:
path: spec.template.spec.containers[1].ports
content:
name: inframonitoring
containerPort: 8080
protocol: TCP
#spec.template.spec.containers[0].resources
- equal:
path: spec.template.spec.containers[1].resources.limits.cpu
value: 100m
- equal:
path: spec.template.spec.containers[1].resources.limits.memory
value: 200Mi
- equal:
path: spec.template.spec.containers[1].resources.requests.cpu
value: 100m
- equal:
path: spec.template.spec.containers[1].resources.requests.memory
value: 200Mi
#spec.template.spec.<misc>
- equal:
path: spec.template.spec.dnsPolicy
Expand Down
Loading

0 comments on commit 6808538

Please sign in to comment.