Skip to content

Commit

Permalink
Merge pull request #109 from SoftwareAG/dev-thr
Browse files Browse the repository at this point in the history
Add support of priorityClassName
  • Loading branch information
thomas-2020 authored Sep 13, 2024
2 parents ac30344 + e1d8fae commit 874a8d8
Show file tree
Hide file tree
Showing 31 changed files with 123 additions and 13 deletions.
2 changes: 1 addition & 1 deletion apigateway/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,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.2.8
version: 1.2.9

# 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
4 changes: 4 additions & 0 deletions apigateway/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ Sub-folder `examples` contains some *values* examples for more use-cases. To use
| `1.2.6` | Fixed commons dependency to enable metering change from 1.2.5. |
| `1.2.7` | Added possibility to rename roleBinding for API Gateway, Kibana and Elasticsearch. This allows for multiple deployments into the same namespace. Also, CRD ServiceMonitor selector corrected. Support of ES storage PVC annotations. |
| `1.2.8` | `tpl` function support in `affinity` value added. `affinity` support added for Kibana and Elasticsearch. `topologySpreadConstraints` support added for APIGW, Elasticsearch and Kibana. |
| `1.2.9` | `priorityClassName` support added for APIGW, Elasticsearch and Kibana. |

## Values

Expand Down Expand Up @@ -224,6 +225,7 @@ Sub-folder `examples` contains some *values* examples for more use-cases. To use
| elasticsearch.podDisruptionBudget | object | `{"data":{},"enabled":true}` | Customization of ElasticSearchs PodDisruptionBudget Policy. Elastic Cloud on Kubernetes operator (ECK) creates a default PodDisruptionBudget Policy. |
| elasticsearch.podDisruptionBudget.data | object | `{}` | Overwrite the default PodDisruptionBudget Policy. Overwriting with custom PodDisruptionBudget Policy requires enabled=true. Examples can be seen here: https://kubernetes.io/docs/tasks/run-application/configure-pdb/ |
| elasticsearch.podDisruptionBudget.enabled | bool | `true` | Whether a PodDisruptionBudget Policy should be created. Enabled=true results in ECK deploying the default (or custom, see data) PodDisruptionBudget Policy. Enabled=false results in no PodDisruptionBudget Policy deployment. |
| elasticsearch.priorityClassName | string | `""` | Set Pods' Priority Class Name |
| elasticsearch.resources | object | `{}` | Resource Settings for Elasticsearch Example: limits: cpu: 100m memory: 128Mi requests: cpu: 100m memory: 128Mi |
| elasticsearch.secretName | string | `""` | The secret name that holds the sag es user for API Gateway. |
| elasticsearch.secretPasswordKey | string | `""` | The key that holds the Elasticsearch password; defauls to "password" |
Expand Down Expand Up @@ -338,6 +340,7 @@ Sub-folder `examples` contains some *values* examples for more use-cases. To use
| kibana.livenessProbe | object | `{}` | Configure Kibana's livenessProbe. |
| kibana.podSecurityContext | object | `{}` | The pod securityContext for kibana pod. |
| kibana.port | int | `5601` | The default Kibana Port |
| kibana.priorityClassName | string | `""` | Set Pods' Priority Class Name |
| kibana.readinessProbe | object | `{"failureThreshold":3,"httpGet":{"path":"/status","port":5601,"scheme":"HTTP"},"periodSeconds":10,"successThreshold":1,"timeoutSeconds":1}` | Configure Kibana's readinessProbe. |
| kibana.resources | object | `{}` | Resource Settings for Kibana Example: limits: cpu: 100m memory: 128Mi requests: cpu: 100m memory: 128Mi |
| kibana.secretName | string | `""` | The secret name that holds the kibana user for API Gateway. |
Expand Down Expand Up @@ -380,6 +383,7 @@ Sub-folder `examples` contains some *values* examples for more use-cases. To use
| nodeSelector | object | `{}` | |
| podAnnotations | object | `{}` | |
| podSecurityContext | object | `{}` | |
| priorityClassName | string | `""` | Set APIGW and Nginx Pods' Priority Class Name ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ |
| 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. |
| prometheus-elasticsearch-exporter | object | `{"enabled":true,"es":{"uri":"http://$(ES_USER):$(ES_PASSWORD)@apigw-apigateway-es-http:9200"},"extraEnvSecrets":{"ES_PASSWORD":{"key":"password","secret":"apigw-apigateway-sag-user-es"},"ES_USER":{"key":"username","secret":"apigw-apigateway-sag-user-es"}},"podAnnotations":{"prometheus.io/path":"/metrics","prometheus.io/port":"9108","prometheus.io/scheme":"http","prometheus.io/scrape":"true"},"serviceMonitor":{"enabled":false}}` | Elasticsearch exporter settings. See https://github.com/prometheus-community/elasticsearch_exporter for details. |
| prometheus-elasticsearch-exporter.enabled | bool | `true` | Deploy the prometheus exporter for elasticsearch |
Expand Down
1 change: 1 addition & 0 deletions apigateway/helm/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,6 @@ Sub-folder `examples` contains some *values* examples for more use-cases. To use
| `1.2.6` | Fixed commons dependency to enable metering change from 1.2.5. |
| `1.2.7` | Added possibility to rename roleBinding for API Gateway, Kibana and Elasticsearch. This allows for multiple deployments into the same namespace. Also, CRD ServiceMonitor selector corrected. Support of ES storage PVC annotations. |
| `1.2.8` | `tpl` function support in `affinity` value added. `affinity` support added for Kibana and Elasticsearch. `topologySpreadConstraints` support added for APIGW, Elasticsearch and Kibana. |
| `1.2.9` | `priorityClassName` support added for APIGW, Elasticsearch and Kibana. |

{{ template "chart.valuesSection" . }}
3 changes: 3 additions & 0 deletions apigateway/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ spec:
topologySpreadConstraints:
{{- tpl (toYaml .) $context | nindent 8 }}
{{- end }}
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Expand Down
3 changes: 3 additions & 0 deletions apigateway/helm/templates/elasticsearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ spec:
topologySpreadConstraints:
{{- tpl (toYaml .) $context | nindent 12 }}
{{- end }}
{{- if .Values.elasticsearch.priorityClassName }}
priorityClassName: {{ .Values.elasticsearch.priorityClassName }}
{{- end }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 12 }}
containers:
Expand Down
3 changes: 3 additions & 0 deletions apigateway/helm/templates/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ spec:
topologySpreadConstraints:
{{- tpl (toYaml .) $context | nindent 8 }}
{{- end }}
{{- if .Values.kibana.priorityClassName }}
priorityClassName: {{ .Values.kibana.priorityClassName }}
{{- end }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 8 }}
{{- if .Values.kibana.serviceAccount.name }}
Expand Down
4 changes: 4 additions & 0 deletions apigateway/helm/templates/nginx-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,8 @@ spec:
items:
- key: nginx.conf
path: nginx.conf
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}

{{- end }}
10 changes: 10 additions & 0 deletions apigateway/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ affinity: {}
# -- Set Pod topology spread constraints for APIGW. You can use templates inside because `tpl` function is called for rendering.
topologySpreadConstraints: {}

# -- Set APIGW and Nginx Pods' Priority Class Name
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
priorityClassName: ""

# -- Value to add extra host aliases to APIGW container.
hostAliases: []

Expand Down Expand Up @@ -609,6 +613,9 @@ elasticsearch:
# -- Set Pod topology spread constraints for ElasticSearch. You can use templates inside because `tpl` function is called for rendering.
topologySpreadConstraints: {}

# -- Set Pods' Priority Class Name
priorityClassName: ""

# -- Node sets. See official ElasticSearch documentation at:
# https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-orchestration.html
# if you specify node sets here the defaultNodeSet will not be used.
Expand Down Expand Up @@ -651,6 +658,9 @@ kibana:
# -- Set Pod topology spread constraints for Kibana. You can use templates inside because `tpl` function is called for rendering.
topologySpreadConstraints: {}

# -- Set Pods' Priority Class Name
priorityClassName: ""

# -- The image that should be used.
# By default ECK will use the official Elasticsearch images.
# Overwrite this to use an image from an internal registry or any custom images.
Expand Down
2 changes: 1 addition & 1 deletion developerportal/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,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.2
version: 1.0.3

# 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
5 changes: 5 additions & 0 deletions developerportal/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ helm install webmethods/developerportal devportal
| `1.0.0` | Initial release |
| `1.0.1` | Supports wM version 11.0. Validate `devportal.port` value in `values.yaml` if you want to use wM image version 11.0. |
| `1.0.2` | `tpl` function support in `affinity` value added. `topologySpreadConstraints` support added. |
| `1.0.3` | `priorityClassName` support added. Error is corrected on using value `useDefaultAffinityRule == true`. Now, the release name is used in condition with `app.kubernetes.io/instance`. `affinity` and `topologySpreadConstraints` support added for Elasticsearch. |

## Values

Expand All @@ -64,6 +65,7 @@ helm install webmethods/developerportal devportal
| devportal.elasticSearchDeployment | bool | `true` | Deploy Elasticsearch. Depends on Elasic Search Helm Charts. See https://github.com/elastic/helm-charts/blob/main/elasticsearch |
| devportal.port | int | `8083` | HTTP listening port. Use on wM version 10.15 (default): `8083`, 11.0: `8080` |
| devportal.useDefaultAffinityRule | bool | `true` | Use the default anti pod affinity. Specifies a Pod Anti-Affinity rule for Kubernetes pods. The default Pod Anti-Affinity is a scheduling preference that indicates how Kubernetes should distribute pods across nodes to avoid having multiple pods of the same application or with specific labels running on the same node. If you want to use your on rules, refer to affinity value and provide your own configuration. |
| elasticsearch.affinity | object | `{}` | Set Pod (anti-) affinity for ElasticSearch. You can use templates inside because `tpl` function is called for rendering. |
| elasticsearch.certificateSecretName | string | `"{{ include \"common.names.fullname\" .}}-es-tls-secret"` | The name of the secret holding the tls secret By default the name will be fullname of release + "es-tls-secret" |
| elasticsearch.defaultNodeSet | object | `{"count":1,"extraConfig":{},"extraInitContainers":{},"installPlugins":["mapper-size"],"memoryMapping":false,"setMaxMapCount":true}` | Default Node Set |
| elasticsearch.defaultNodeSet.count | int | `1` | the number of replicas for Elastic Search |
Expand All @@ -77,9 +79,11 @@ helm install webmethods/developerportal devportal
| elasticsearch.keystoreSecretName | string | `""` | The secret name that holds the keystore password |
| elasticsearch.nodeSets | object | `{}` | Node sets. See official ElasticSearch documentation at: https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-orchestration.html if you specify node sets here the defaultNodeSet will not be used. |
| elasticsearch.port | int | `9200` | The default elasticsearch instance http communication port |
| elasticsearch.priorityClassName | string | `""` | Set Pods' Priority Class Name |
| elasticsearch.secretName | string | `""` | The secret name that holds the sag es user for Developer Portal. |
| elasticsearch.serviceName | string | `""` | The elasticsearch http service name that Developer Portal uses. The default is compiled of the fullname (releasename + chart name) + "-http" You MUST override this if you use an external elastic search service and do not deploy the embedded elastic CRD from this chart. |
| elasticsearch.tlsEnabled | bool | `false` | Whether the communication from Developer Portal should be HTTPS Note: you will need to create certificate and a separate truststore for the communication. |
| elasticsearch.topologySpreadConstraints | object | `{}` | Set Pod topology spread constraints for ElasticSearch. You can use templates inside because `tpl` function is called for rendering. |
| elasticsearch.version | string | `"8.2.3"` | The ECK version to be used |
| extraConfigMaps | list | `[]` | Extra config maps for additional configurations such as extra ports, etc. |
| extraContainers | list | `[]` | Extra containers which should run in addition to the main container as a sidecar |
Expand Down Expand Up @@ -108,6 +112,7 @@ helm install webmethods/developerportal devportal
| nodeSelector | object | `{}` | |
| podAnnotations | object | `{}` | |
| podSecurityContext | object | `{}` | |
| priorityClassName | string | `""` | Set Pods' Priority Class Name ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ |
| prometheus-elasticsearch-exporter.es.uri | string | `"{{ .Release.Name }}-developerportal-es-http:9200"` | |
| prometheus-elasticsearch-exporter.image.pullPolicy | string | `"IfNotPresent"` | |
| prometheus-elasticsearch-exporter.image.pullSecret | string | `""` | |
Expand Down
1 change: 1 addition & 0 deletions developerportal/helm/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@ helm install webmethods/developerportal devportal
| `1.0.0` | Initial release |
| `1.0.1` | Supports wM version 11.0. Validate `devportal.port` value in `values.yaml` if you want to use wM image version 11.0. |
| `1.0.2` | `tpl` function support in `affinity` value added. `topologySpreadConstraints` support added. |
| `1.0.3` | `priorityClassName` support added. Error is corrected on using value `useDefaultAffinityRule == true`. Now, the release name is used in condition with `app.kubernetes.io/instance`. `affinity` and `topologySpreadConstraints` support added for Elasticsearch. |

{{ template "chart.valuesSection" . }}
12 changes: 12 additions & 0 deletions developerportal/helm/templates/elasticsearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# *
# */
{{- if .Values.elasticsearch.deploy }}
{{- $context := . }}
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
Expand Down Expand Up @@ -55,6 +56,17 @@ spec:
authz_exception: false
podTemplate:
spec:
{{- with .Values.elasticsearch.affinity }}
affinity:
{{- tpl (toYaml .) $context | nindent 12 }}
{{- end }}
{{- with .Values.elasticsearch.topologySpreadConstraints }}
topologySpreadConstraints:
{{- tpl (toYaml .) $context | nindent 12 }}
{{- end }}
{{- if .Values.elasticsearch.priorityClassName }}
priorityClassName: {{ .Values.elasticsearch.priorityClassName }}
{{- end }}
initContainers:
{{- if and .Values.elasticsearch.defaultNodeSet.setMaxMapCount .Values.elasticsearch.defaultNodeSet.memoryMapping }}
- name: sysctl
Expand Down
5 changes: 4 additions & 1 deletion developerportal/helm/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ spec:
- key: "app.kubernetes.io/instance"
operator: In
values:
- {{ include "common.names.fullname" . }}
- '{{ .Release.Name }}'
topologyKey: kubernetes.io/hostname
{{- else if .Values.affinity }}
{{ tpl (toYaml .Values.affinity) $context | nindent 8 }}
Expand All @@ -66,6 +66,9 @@ spec:
topologySpreadConstraints:
{{- tpl (toYaml .) $context | nindent 8 }}
{{- end }}
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
containers:
- name: {{ include "common.names.fullname" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
Expand Down
15 changes: 14 additions & 1 deletion developerportal/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ affinity: {}
# -- Set Pod topology spread constraints. You can use templates inside because `tpl` function is called for rendering.
topologySpreadConstraints: {}

# -- Set Pods' Priority Class Name
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
priorityClassName: ""

# -- Extra Labels
extraLabels: {}

Expand Down Expand Up @@ -213,7 +217,16 @@ elasticsearch:
# -- The name of the secret holding the tls secret
# By default the name will be fullname of release + "es-tls-secret"
certificateSecretName: "{{ include \"common.names.fullname\" .}}-es-tls-secret"


# -- Set Pod (anti-) affinity for ElasticSearch. You can use templates inside because `tpl` function is called for rendering.
affinity: {}

# -- Set Pod topology spread constraints for ElasticSearch. You can use templates inside because `tpl` function is called for rendering.
topologySpreadConstraints: {}

# -- Set Pods' Priority Class Name
priorityClassName: ""

# -- Node sets. See official ElasticSearch documentation at:
# https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-orchestration.html
# if you specify node sets here the defaultNodeSet will not be used.
Expand Down
2 changes: 1 addition & 1 deletion microservicesruntime/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.6
version: 1.0.7

# 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
Loading

0 comments on commit 874a8d8

Please sign in to comment.