Skip to content

Commit

Permalink
* add enabled for initContainer
Browse files Browse the repository at this point in the history
* add roleBindingName for apigw, es, kibana
* added version to readme
* increased chart version apigw
* increased chart version commons
  • Loading branch information
AronKa-SAG committed Jun 24, 2024
1 parent 82efdab commit 6bbe107
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion apigateway/helm/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dependencies:
- name: common
repository: https://open-source.softwareag.com/webmethods-helm-charts/charts
version: 1.0.2
version: 1.0.3
- name: prometheus-elasticsearch-exporter
repository: https://prometheus-community.github.io/helm-charts
version: 5.0.0
Expand Down
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.6
version: 1.2.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
3 changes: 2 additions & 1 deletion apigateway/helm/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,6 @@ Sub-folder `examples` contains some *values* examples for more use-cases. To use
| `1.2.3` | Job template added to create house keeping (cron) jobs. |
| `1.2.4` | Added Kibana extra container configuration, set by Values.kibana.extraContainers. <br> Added ServiceMonitor matchLabel for a specific service. The service is set by .Values.serviceMonitor.serviceName defaulting to API Gateways runtime service. |
| `1.2.5` | Added possibility to read metering truststore password by secretKeyRef. <br> Added custom logging configuration for Kibana. |

| `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 Elasitcsearch. This allows for multiple deployments into the same namespace. |
{{ template "chart.valuesSection" . }}
2 changes: 2 additions & 0 deletions apigateway/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ spec:
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if or ( .Values.apigw.initContainer.enabled ) ( .Values.extraInitContainers ) }}
initContainers:
{{- if .Values.elasticsearch.deploy }}
- name: waitforelasticsearch
Expand Down Expand Up @@ -108,6 +109,7 @@ spec:
{{- if .Values.extraInitContainers }}
{{- toYaml .Values.extraInitContainers | nindent 8 }}
{{- end }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
securityContext:
Expand Down
6 changes: 3 additions & 3 deletions apigateway/helm/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ metadata:
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: cluster-discovery-rolebinding
name: {{ include "common.names.roleBindingName" . }}
roleRef:
kind: Role
name: {{ include "common.names.roleName" . }}
Expand Down Expand Up @@ -59,7 +59,7 @@ metadata:
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: elasticsearch-rolebinding
name: {{ .Values.elasticsearch.serviceAccount.roleBindingName }}
roleRef:
kind: Role
name: {{ .Values.elasticsearch.serviceAccount.roleName }}
Expand Down Expand Up @@ -93,7 +93,7 @@ metadata:
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: kibana-rolebinding
name: {{ .Values.kibana.serviceAccount.roleBindingName }}
roleRef:
kind: Role
name: {{ .Values.kibana.serviceAccount.roleName }}
Expand Down
12 changes: 11 additions & 1 deletion apigateway/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ serviceAccount:
name: ""
# If not set and create is true, a name is generated using the fullname template
roleName: ""
# If not set and create is true, a name is generated using the fullname template
roleBindingName: "cluster-discovery-rolebinding"

# -- The name of the secret or configmap that contains the license key.
# Defaults to the release name + chart name + "-license".
Expand Down Expand Up @@ -328,6 +330,8 @@ apigw:
# - ALL
initContainer:
securityContext: {}
# -- If apigw initContainer for ES should be enabled
enabled: true

# -- Specifies the location and name of the configuration variables template
# or the directory containing templates for use with Microservices Runtime or
Expand Down Expand Up @@ -561,7 +565,7 @@ elasticsearch:
# Overwriting with custom PodDisruptionBudget Policy requires enabled=true.
# Examples can be seen here: https://kubernetes.io/docs/tasks/run-application/configure-pdb/
data: {}

# -- Enable and configure service account creation.
serviceAccount:
# -- Whether to create a ServiceAccount for Elasticsearch
Expand All @@ -571,6 +575,9 @@ elasticsearch:
# -- Name of the ServiceAccount Role used by the Elasticsearch ServiceAccount.
# Requires create=true to work.
roleName: ""
# -- Name of the ServiceAccount Rolebinding used by the Elasticsearch ServiceAccount.
# Requires create=true to work.
roleBindingName: "elasticsearch-rolebinding"

# -- Whether the communication from APIGW and Kibana should be HTTPS
# Note: you will need to create certificate and a separate truststore for the communication.
Expand Down Expand Up @@ -704,6 +711,9 @@ kibana:
# -- Name of the ServiceAccount Role used by the Kibana ServiceAccount.
# Requires create=true to work.
roleName: ""
# -- Name of the ServiceAccount Rolebinding used by the Kibana ServiceAccount.
# Requires create=true to work.
roleBindingName: "kibana-rolebinding"

# -- Configure Kibana's readinessProbe.
readinessProbe:
Expand Down
2 changes: 1 addition & 1 deletion common/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ name: common
sources:
- https://github.com/softwareag/webmethods-helm-charts
type: library
version: 1.0.2
version: 1.0.3
11 changes: 11 additions & 0 deletions common/helm/templates/_names.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,15 @@ Create the name of the role to use
{{- else }}
{{- default "default" .Values.serviceAccount.roleName }}
{{- end }}
{{- end }}
{{/*
Create the name of the rolebinding to use
*/}}
{{- define "common.names.roleBindingName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "common.names.fullname" .) .Values.serviceAccount.roleBindingName }}
{{- else }}
{{- default "default" .Values.serviceAccount.roleBindingName }}
{{- end }}
{{- end }}

0 comments on commit 6bbe107

Please sign in to comment.