diff --git a/microservicesruntime/helm/Chart.yaml b/microservicesruntime/helm/Chart.yaml index 9e0501c..1a1055e 100644 --- a/microservicesruntime/helm/Chart.yaml +++ b/microservicesruntime/helm/Chart.yaml @@ -25,7 +25,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/microservicesruntime/helm/README.md b/microservicesruntime/helm/README.md index d907159..95889ee 100644 --- a/microservicesruntime/helm/README.md +++ b/microservicesruntime/helm/README.md @@ -108,6 +108,7 @@ helm install wm-msr webmethods/microservicesruntime \ | `1.0.1` | Initial release | | `1.0.2` | Added new option `microservicesruntime.licenseKeyProvided` to allow using images with trial or baked-in license key | | `1.0.3` | Make Liveness and Readiness Probes as per current default. Both can now also be overwritten in a custom values file `values.yaml`. | +| `1.0.4` | Option in `values.yaml` to create a ServiceMonitor added. Some errors in Nginx external LB corrected | ## Values @@ -187,6 +188,7 @@ helm install wm-msr webmethods/microservicesruntime \ | persistence.storageClassName | string | `""` | | | podAnnotations | object | `{}` | pod annotations | | podSecurityContext.fsGroup | int | `1724` | | +| prometheus | object | `{"interval":"10s","path":"/metrics","port":"5555","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/readiness","port":"http"},"initialDelaySeconds":0,"periodSeconds":15,"successThreshold":1,"timeoutSeconds":30}` | Configure readiness probe | | replicaCount | int | `1` | Number of replicates in Deployment | | resources | object | `{}` | | @@ -198,6 +200,7 @@ helm install wm-msr webmethods/microservicesruntime \ | 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":60,"periodSeconds":30,"tcpSocket":{"port":"http"}}` | startup probe for container | | statefulSet | bool | `false` | StatefulSet or Deployment. You should only change this if you require Client Side queuing (CSQ) or functionality in IS which requires stable hostnames and filesystems. Default is false => Deployment. Keep in mind, you must disable CSQ on each webMethods messaging and JMS connection if you don't use stateful-sets. See examples in Process Engine deployment for disableing QSC. | | tolerations | list | `[]` | | diff --git a/microservicesruntime/helm/README.md.gotmpl b/microservicesruntime/helm/README.md.gotmpl index 212849b..f5725b5 100644 --- a/microservicesruntime/helm/README.md.gotmpl +++ b/microservicesruntime/helm/README.md.gotmpl @@ -108,5 +108,6 @@ helm install wm-msr webmethods/microservicesruntime \ | `1.0.1` | Initial release | | `1.0.2` | Added new option `microservicesruntime.licenseKeyProvided` to allow using images with trial or baked-in license key | | `1.0.3` | Make Liveness and Readiness Probes as per current default. Both can now also be overwritten in a custom values file `values.yaml`. | +| `1.0.4` | Option in `values.yaml` to create a ServiceMonitor added. Some errors in Nginx external LB corrected | {{ template "chart.valuesSection" . }} diff --git a/microservicesruntime/helm/templates/deployment.yaml b/microservicesruntime/helm/templates/deployment.yaml index a5c4bf5..fea98bb 100644 --- a/microservicesruntime/helm/templates/deployment.yaml +++ b/microservicesruntime/helm/templates/deployment.yaml @@ -43,7 +43,7 @@ spec: {{- with .Values.podAnnotations }} {{- tpl (toYaml .) $context | nindent 8 }} {{- end }} - {{- include "common.prometheus.annotations" (dict "port" .Values.service.port) | 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/microservicesruntime/helm/templates/nginx-configmap.yaml b/microservicesruntime/helm/templates/nginx-configmap.yaml index 9c75cc2..1ef577a 100644 --- a/microservicesruntime/helm/templates/nginx-configmap.yaml +++ b/microservicesruntime/helm/templates/nginx-configmap.yaml @@ -55,25 +55,14 @@ data: gzip on; upstream msr-rt { - server {{ include "common.names.fullname" . }}:{{ int .Values.microservicesruntime.runtimePort }}; + server {{ include "common.names.fullname" . }}:{{ int .Values.microservicesruntime.httpPort }}; } - - upstream msr-admin { - server {{ include "common.names.fullname" . }}:{{ int .Values.microservicesruntime.adminPort }}; - } - + server { - listen {{ int .Values.microservicesruntime.runtimePort }}; + listen {{ int .Values.microservicesruntime.httpPort }}; location / { proxy_pass http://msr-rt; } } - - server { - listen {{ int .Values.microservicesruntime.adminPort }}; - location / { - proxy_pass http://msr-admin; - } - } } {{- end }} \ No newline at end of file diff --git a/microservicesruntime/helm/templates/nginx-deployment.yaml b/microservicesruntime/helm/templates/nginx-deployment.yaml index 656a2ef..0e54029 100644 --- a/microservicesruntime/helm/templates/nginx-deployment.yaml +++ b/microservicesruntime/helm/templates/nginx-deployment.yaml @@ -55,12 +55,9 @@ spec: resources: {{- toYaml .Values.resources.nginxContainer | nindent 10 }} ports: - - containerPort: {{ int .Values.microservicesruntime.runtimePort }} + - containerPort: {{ int .Values.microservicesruntime.httpPort }} name: rt-port protocol: TCP - - containerPort: {{ int .Values.microservicesruntime.adminPort }} - name: admin-http - protocol: TCP volumeMounts: - name: nginx-config mountPath: /etc/nginx/nginx.conf diff --git a/microservicesruntime/helm/templates/nginx-svc.yaml b/microservicesruntime/helm/templates/nginx-svc.yaml index 0857f46..78b0feb 100644 --- a/microservicesruntime/helm/templates/nginx-svc.yaml +++ b/microservicesruntime/helm/templates/nginx-svc.yaml @@ -31,20 +31,13 @@ metadata: spec: type: {{ .Values.service.type }} ports: - - port: {{ int .Values.microservicesruntime.runtimePort }} + - port: {{ int .Values.microservicesruntime.httpPort }} protocol: TCP - targetPort: {{ int .Values.microservicesruntime.runtimePort }} + targetPort: {{ int .Values.microservicesruntime.httpPort }} name: rt-port {{- if (eq .Values.service.type "ClusterIP") }} nodePort: null {{- end }} - - port: {{ int .Values.microservicesruntime.adminPort }} - protocol: TCP - targetPort: {{ int .Values.microservicesruntime.adminPort }} - name: admin-port - {{- if (eq .Values.service.type "ClusterIP") }} - nodePort: null - {{- end }} selector: {{- include "common.labels.matchLabels" . | nindent 4 }} {{- end }} \ No newline at end of file diff --git a/microservicesruntime/helm/templates/servicemonitor.yaml b/microservicesruntime/helm/templates/servicemonitor.yaml new file mode 100644 index 0000000..04ac32f --- /dev/null +++ b/microservicesruntime/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/microservicesruntime/helm/values.yaml b/microservicesruntime/helm/values.yaml index b4b97f8..9b42ba9 100644 --- a/microservicesruntime/helm/values.yaml +++ b/microservicesruntime/helm/values.yaml @@ -332,5 +332,21 @@ metering: # Configure this property only if you use a truststore. trustStorePassword: +# -- Define values for Prometheus Operator to scrap metrics via annotation or ServiceMonitor. +prometheus: + path: "/metrics" + port: "5555" + 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: | diff --git a/mywebmethodsserver/examples/services-auditing-monitor/README.md b/mywebmethodsserver/examples/services-auditing-monitor/README.md new file mode 100644 index 0000000..0880466 --- /dev/null +++ b/mywebmethodsserver/examples/services-auditing-monitor/README.md @@ -0,0 +1,3 @@ +# MWS as Service Auditing Monitor + +To use MWS as Service Auditing Monitor (SAM), MWS must communicate with a deployed [MSR as SAM](../../../microservicesruntime/examples/service-auditing-monitor/README.md). You can read [Configuring Web Service Authentication for CAF Applications](https://documentation.softwareag.com/webmethods/mywebmethods_server/mws10-15/webhelp/mws-webhelp/index.html#page/my-webmethods-server-webhelp%2Fta-configure_basic_auth_msr.html%23) to setup this connection. \ No newline at end of file diff --git a/mywebmethodsserver/helm/README.md b/mywebmethodsserver/helm/README.md index 5beb851..db741a9 100644 --- a/mywebmethodsserver/helm/README.md +++ b/mywebmethodsserver/helm/README.md @@ -16,6 +16,7 @@ Sub-folder `examples` contains some *values* examples for more use-cases. To use | Use-case | Description | |-----|------| | [mws-postgresql](../examples/postgresql/README.md) | Using MWS with external PostgreSQL database | +| [service-auditing-monitor](../examples/service-auditing-monitor/README.md) | Using MWS as Service Auditing Monitor | ## Install MyWebMethods Server Release diff --git a/mywebmethodsserver/helm/README.md.gotmpl b/mywebmethodsserver/helm/README.md.gotmpl index 0382028..2a859fc 100644 --- a/mywebmethodsserver/helm/README.md.gotmpl +++ b/mywebmethodsserver/helm/README.md.gotmpl @@ -16,6 +16,7 @@ Sub-folder `examples` contains some *values* examples for more use-cases. To use | Use-case | Description | |-----|------| | [mws-postgresql](../examples/postgresql/README.md) | Using MWS with external PostgreSQL database | +| [service-auditing-monitor](../examples/service-auditing-monitor/README.md) | Using MWS as Service Auditing Monitor | ## Install MyWebMethods Server Release