diff --git a/mywebmethodsserver/helm/Chart.yaml b/mywebmethodsserver/helm/Chart.yaml index ba7b633..c8bf8c3 100644 --- a/mywebmethodsserver/helm/Chart.yaml +++ b/mywebmethodsserver/helm/Chart.yaml @@ -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 diff --git a/mywebmethodsserver/helm/README.md b/mywebmethodsserver/helm/README.md index db741a9..ae22afb 100644 --- a/mywebmethodsserver/helm/README.md +++ b/mywebmethodsserver/helm/README.md @@ -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 | @@ -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 | diff --git a/mywebmethodsserver/helm/README.md.gotmpl b/mywebmethodsserver/helm/README.md.gotmpl index 2a859fc..dd69d36 100644 --- a/mywebmethodsserver/helm/README.md.gotmpl +++ b/mywebmethodsserver/helm/README.md.gotmpl @@ -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" . }} diff --git a/mywebmethodsserver/helm/templates/servicemonitor.yaml b/mywebmethodsserver/helm/templates/servicemonitor.yaml new file mode 100644 index 0000000..04ac32f --- /dev/null +++ b/mywebmethodsserver/helm/templates/servicemonitor.yaml @@ -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 }} \ No newline at end of file diff --git a/mywebmethodsserver/helm/templates/statefulset.yaml b/mywebmethodsserver/helm/templates/statefulset.yaml index 6668d57..04af927 100644 --- a/mywebmethodsserver/helm/templates/statefulset.yaml +++ b/mywebmethodsserver/helm/templates/statefulset.yaml @@ -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 }} diff --git a/mywebmethodsserver/helm/values.yaml b/mywebmethodsserver/helm/values.yaml index a0d7ec2..d5115d5 100644 --- a/mywebmethodsserver/helm/values.yaml +++ b/mywebmethodsserver/helm/values.yaml @@ -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: \ No newline at end of file + 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 diff --git a/universalmessaging/helm/Chart.yaml b/universalmessaging/helm/Chart.yaml index 973d90c..66ef329 100644 --- a/universalmessaging/helm/Chart.yaml +++ b/universalmessaging/helm/Chart.yaml @@ -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 diff --git a/universalmessaging/helm/README.md b/universalmessaging/helm/README.md index 18ea77d..03ecde4 100644 --- a/universalmessaging/helm/README.md +++ b/universalmessaging/helm/README.md @@ -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 @@ -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. | @@ -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 | diff --git a/universalmessaging/helm/README.md.gotmpl b/universalmessaging/helm/README.md.gotmpl index 1d38929..b2f33fb 100644 --- a/universalmessaging/helm/README.md.gotmpl +++ b/universalmessaging/helm/README.md.gotmpl @@ -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" . }} diff --git a/universalmessaging/helm/templates/servicemonitor.yaml b/universalmessaging/helm/templates/servicemonitor.yaml new file mode 100644 index 0000000..04ac32f --- /dev/null +++ b/universalmessaging/helm/templates/servicemonitor.yaml @@ -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 }} \ No newline at end of file diff --git a/universalmessaging/helm/templates/statefulset.yaml b/universalmessaging/helm/templates/statefulset.yaml index 82abc0d..53df81a 100644 --- a/universalmessaging/helm/templates/statefulset.yaml +++ b/universalmessaging/helm/templates/statefulset.yaml @@ -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 -}} diff --git a/universalmessaging/helm/values.yaml b/universalmessaging/helm/values.yaml index 444f943..088127c 100644 --- a/universalmessaging/helm/values.yaml +++ b/universalmessaging/helm/values.yaml @@ -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: |