Skip to content

Commit

Permalink
Merge pull request #74 from SoftwareAG/dev-msr-thr
Browse files Browse the repository at this point in the history
UM + MWS: CRD ServiceMonitor added
  • Loading branch information
thomas-2020 authored Apr 24, 2024
2 parents 1cd9d5a + c415c25 commit 2a48750
Show file tree
Hide file tree
Showing 12 changed files with 147 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mywebmethodsserver/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ apiVersion: v2
appVersion: "10.15"
description: My webMethods Server (MWS) Helm Chart for Kubernetes
name: mywebmethodsserver
version: 1.0.0
version: 1.0.1

dependencies:
- name: common
Expand Down
9 changes: 9 additions & 0 deletions mywebmethodsserver/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ helm install wm-mws microservicesruntime
--set "ingress.hosts[0].paths[0].port=5555"
```

## Version History

| Version | Changes and Description |
|-----|------|
| `1.0.0` | Initial release |
| `1.0.1` | CRD `ServiceMonitor` added |

## Values

| Key | Type | Default | Description |
Expand Down Expand Up @@ -80,11 +87,13 @@ helm install wm-mws microservicesruntime
| nodeSelector | object | `{}` | |
| podAnnotations | object | `{}` | |
| podSecurityContext | object | `{}` | |
| prometheus | object | `{"interval":"10s","path":"/metrics","port":"8585","scheme":"http","scrape":"true","scrapeTimeout":"10s"}` | Define values for Prometheus Operator to scrap metrics via annotation or ServiceMonitor. |
| replicaCount | int | `1` | |
| resources | object | `{}` | Define CPU and memory resources for container |
| securityContext | object | `{}` | The security context the pods should run in. capabilities: drop: - ALL readOnlyRootFilesystem: true runAsNonRoot: true runAsUser: 1000 |
| service | object | `{"port":8585,"type":"ClusterIP"}` | The service type of the MyWebMethodsServer service |
| serviceAccount.create | bool | `false` | |
| serviceMonitor | object | `{"enabled":false}` | Create and enable ServiceMonitor. The default is `false`. |
| storage.defaultAccessMode | list | `["ReadWriteOnce"]` | The default access mode |
| storage.defaultStorageClass | string | `nil` | The default storage class for all application directories |
| storage.defaultStorageRequest | string | `"1Gi"` | Storage claim request size |
Expand Down
7 changes: 7 additions & 0 deletions mywebmethodsserver/helm/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@ helm install wm-mws microservicesruntime
--set "ingress.hosts[0].paths[0].port=5555"
```

## Version History

| Version | Changes and Description |
|-----|------|
| `1.0.0` | Initial release |
| `1.0.1` | CRD `ServiceMonitor` added |

{{ template "chart.valuesSection" . }}
45 changes: 45 additions & 0 deletions mywebmethodsserver/helm/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# /*
# * Copyright (c) 2023 Software AG, Darmstadt, Germany and/or its licensors
# *
# * SPDX-License-Identifier: Apache-2.0
# *
# * Licensed under the Apache License, Version 2.0 (the "License");
# * you may not use this file except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.apache.org/licenses/LICENSE-2.0
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *
# */
---
{{- if .Values.serviceMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "common.names.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "common.labels.standard" . | nindent 4 }}
spec:
endpoints:
- honorLabels: true
interval: {{ .Values.prometheus.interval }}
path: {{ .Values.prometheus.path }}
targetPort: {{ .Values.prometheus.port }}
scheme: {{ .Values.prometheus.scheme }}
scrapeTimeout: {{ .Values.prometheus.scrapeTimeout }}
tlsConfig:
insecureSkipVerify: true
jobLabel: {{ .Release.Name }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
2 changes: 1 addition & 1 deletion mywebmethodsserver/helm/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
template:
metadata:
annotations:
{{- include "common.prometheus.annotations" (dict "port" .Values.service.metricPort) | nindent 8 }}
{{- include "common.prometheus.annotations" (dict "port" .Values.prometheus.port "scrape" .Values.prometheus.scrape "path" .Values.prometheus.path "scheme" .Values.prometheus.scheme) | nindent 8 }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
18 changes: 17 additions & 1 deletion mywebmethodsserver/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,20 @@ mws:
# If user and password are provided a secret will automatically generated initially.
# E.g. helm install webmethods/mywebmethodsserver mws --set mws.jdbc.user=mwsuser --set mws.jdbc.password=mydbpassword
# Do not save this information in a plain value file, use --set and reference it from an environment variable, or setup manually
password:
password:

# -- Define values for Prometheus Operator to scrap metrics via annotation or ServiceMonitor.
prometheus:
path: "/metrics"
port: "8585"
scheme: "http"
## -- Only used on annotation
scrape: "true"
## -- Only used on ServiceMonitor
interval: 10s
## -- Only used on ServiceMonitor
scrapeTimeout: 10s

# -- Create and enable ServiceMonitor. The default is `false`.
serviceMonitor:
enabled: false
2 changes: 1 addition & 1 deletion universalmessaging/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.3
version: 1.0.4

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
3 changes: 3 additions & 0 deletions universalmessaging/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ helm install um webmethods/universalmessaging
| `1.0.1` | Update JMX Exporter configuration file from latest [UM Git repository](https://github.com/SoftwareAG/universalmessaging-prometheus-jmx-exporter-config). Bugfix: Mount configuration files into container. Nginx added. |
| `1.0.2` | Change startup, liveness and readiness probes. All configuration settings are in `values.yaml`. Now, The probes are using `httpGet` instead of `runUMTool.sh` utility. |
| `1.0.3` | Make license file handling same as MSR |
| `1.0.4` | CRD `ServiceMonitor` added |

## Values

Expand Down Expand Up @@ -100,6 +101,7 @@ helm install um webmethods/universalmessaging
| nodeSelector | object | `{}` | |
| podAnnotations | object | `{}` | pod annotations |
| podSecurityContext.fsGroup | int | `1724` | |
| prometheus | object | `{"interval":"10s","path":"/metrics","port":"9200","scheme":"http","scrape":"true","scrapeTimeout":"10s"}` | Define values for Prometheus Operator to scrap metrics via annotation or ServiceMonitor. |
| readinessProbe | object | `{"failureThreshold":3,"httpGet":{"path":"/health/","port":9000},"initialDelaySeconds":0,"periodSeconds":15,"successThreshold":1,"timeoutSeconds":30}` | Configure readiness probe |
| replicaCount | int | `1` | Number of replicas |
| resources | object | `{}` | Define CPU und memory resources UM and Nginx containers. |
Expand All @@ -110,6 +112,7 @@ helm install um webmethods/universalmessaging
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
| serviceAccount.create | bool | `false` | Specifies whether a service account should be created |
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
| serviceMonitor | object | `{"enabled":false}` | Create and enable ServiceMonitor. The default is `false`. |
| startupProbe | object | `{"failureThreshold":30,"httpGet":{"path":"/health/","port":9000},"initialDelaySeconds":30,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5}` | Configure liveness probe |
| storage.configurationSize | string | `"2Mi"` | Storage size of configuration files |
| storage.dataSize | string | `"2Gi"` | Storage size of data |
Expand Down
1 change: 1 addition & 0 deletions universalmessaging/helm/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@ helm install um webmethods/universalmessaging
| `1.0.1` | Update JMX Exporter configuration file from latest [UM Git repository](https://github.com/SoftwareAG/universalmessaging-prometheus-jmx-exporter-config). Bugfix: Mount configuration files into container. Nginx added. |
| `1.0.2` | Change startup, liveness and readiness probes. All configuration settings are in `values.yaml`. Now, The probes are using `httpGet` instead of `runUMTool.sh` utility. |
| `1.0.3` | Make license file handling same as MSR |
| `1.0.4` | CRD `ServiceMonitor` added |

{{ template "chart.valuesSection" . }}
45 changes: 45 additions & 0 deletions universalmessaging/helm/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# /*
# * Copyright (c) 2023 Software AG, Darmstadt, Germany and/or its licensors
# *
# * SPDX-License-Identifier: Apache-2.0
# *
# * Licensed under the Apache License, Version 2.0 (the "License");
# * you may not use this file except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.apache.org/licenses/LICENSE-2.0
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *
# */
---
{{- if .Values.serviceMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "common.names.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "common.labels.standard" . | nindent 4 }}
spec:
endpoints:
- honorLabels: true
interval: {{ .Values.prometheus.interval }}
path: {{ .Values.prometheus.path }}
targetPort: {{ .Values.prometheus.port }}
scheme: {{ .Values.prometheus.scheme }}
scrapeTimeout: {{ .Values.prometheus.scrapeTimeout }}
tlsConfig:
insecureSkipVerify: true
jobLabel: {{ .Release.Name }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
2 changes: 1 addition & 1 deletion universalmessaging/helm/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "common.prometheus.annotations" (dict "port" .Values.service.metricPort) | nindent 8 }}
{{- include "common.prometheus.annotations" (dict "port" .Values.prometheus.port "scrape" .Values.prometheus.scrape "path" .Values.prometheus.path "scheme" .Values.prometheus.scheme) | nindent 8 }}
labels:
{{- include "common.labels.matchLabels" . | nindent 8 }}
{{- with .Values.extraLabels -}}
Expand Down
16 changes: 16 additions & 0 deletions universalmessaging/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,5 +219,21 @@ readinessProbe:
# Nginx is configured by example from [Universal Messaging documentation](https://documentation.softwareag.com/universal_messaging/num10-15/webhelp/num-webhelp/#page/num-webhelp%2Fre-configure_nginx_to_serve_http_requests.html%23)
externalLoadBalancer: false

# -- Define values for Prometheus Operator to scrap metrics via annotation or ServiceMonitor.
prometheus:
path: "/metrics"
port: "9200"
scheme: "http"
## -- Only used on annotation
scrape: "true"
## -- Only used on ServiceMonitor
interval: 10s
## -- Only used on ServiceMonitor
scrapeTimeout: 10s

# -- Create and enable ServiceMonitor. The default is `false`.
serviceMonitor:
enabled: false

# -- Import the content as license key and create a ConfigMap named by `licenseConfigMap` value. You can copy/past the content of your provided license key file here.
license: |

0 comments on commit 2a48750

Please sign in to comment.