Skip to content

Commit 36c026f

Browse files
brainiac84Bitnami ContainersIbone González Mauraza
authored
[bitnami/phpmyadmin] allows to create ServiceAccount resource (bitnami#14193)
* [bitnami/phpmyadmin] allows to create ServiceAccount resource Signed-off-by: Vadim Grek <vadimprog@gmail.com> * Update README.md with readme-generator-for-helm Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> * Update bitnami/phpmyadmin/templates/serviceaccount.yaml Co-authored-by: Ibone González Mauraza <gibone@vmware.com> Signed-off-by: Vadim Grek <vadimprog@gmail.com> Signed-off-by: Vadim Grek <vadimprog@gmail.com> Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com> Co-authored-by: Ibone González Mauraza <gibone@vmware.com>
1 parent e5c2e8c commit 36c026f

File tree

6 files changed

+66
-2
lines changed

6 files changed

+66
-2
lines changed

bitnami/phpmyadmin/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ name: phpmyadmin
3030
sources:
3131
- https://github.com/bitnami/containers/tree/main/bitnami/phpmyadmin
3232
- https://www.phpmyadmin.net/
33-
version: 10.3.10
33+
version: 10.4.0

bitnami/phpmyadmin/README.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,16 @@ The command removes all the Kubernetes components associated with the chart and
204204
| `mariadb` | MariaDB chart configuration | `{}` |
205205

206206

207+
### Other Parameters
208+
209+
| Name | Description | Value |
210+
| --------------------------------------------- | ---------------------------------------------------------------------- | ------- |
211+
| `serviceAccount.create` | Enable creation of ServiceAccount for PhpMyAdmin pod | `false` |
212+
| `serviceAccount.name` | The name of the ServiceAccount to use. | `""` |
213+
| `serviceAccount.automountServiceAccountToken` | Allows auto mount of ServiceAccountToken on the serviceAccount created | `true` |
214+
| `serviceAccount.annotations` | Additional custom annotations for the ServiceAccount | `{}` |
215+
216+
207217
### Metrics parameters
208218

209219
| Name | Description | Value |
@@ -542,4 +552,4 @@ Unless required by applicable law or agreed to in writing, software
542552
distributed under the License is distributed on an "AS IS" BASIS,
543553
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
544554
See the License for the specific language governing permissions and
545-
limitations under the License.
555+
limitations under the License.

bitnami/phpmyadmin/templates/_helpers.tpl

+11
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ Return the proper Docker Image Registry Secret Names
2121
{{- include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.metrics.image) "global" .Values.global) -}}
2222
{{- end -}}
2323

24+
{{/*
25+
Create the name of the service account to use
26+
*/}}
27+
{{- define "phpmyadmin.serviceAccountName" -}}
28+
{{- if .Values.serviceAccount.create -}}
29+
{{ default (include "common.names.fullname" .) .Values.serviceAccount.name }}
30+
{{- else -}}
31+
{{ default "default" .Values.serviceAccount.name }}
32+
{{- end -}}
33+
{{- end -}}
34+
2435
{{/*
2536
Create a default fully qualified app name.
2637
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).

bitnami/phpmyadmin/templates/deployment.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ spec:
6060
{{- if .Values.podSecurityContext.enabled }}
6161
securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }}
6262
{{- end }}
63+
{{- if .Values.serviceAccount.create }}
64+
serviceAccountName: {{ template "phpmyadmin.serviceAccountName" . }}
65+
{{- end }}
6366
{{- if .Values.initContainers }}
6467
initContainers: {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }}
6568
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{- if .Values.serviceAccount.create }}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
5+
metadata:
6+
name: {{ template "phpmyadmin.serviceAccountName" . }}
7+
namespace: {{ .Release.Namespace | quote }}
8+
labels: {{- include "common.labels.standard" . | nindent 4 }}
9+
{{- if .Values.commonLabels }}
10+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
11+
{{- end }}
12+
annotations:
13+
{{- if .Values.commonAnnotations }}
14+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
15+
{{- end }}
16+
{{- if .Values.serviceAccount.annotations }}
17+
{{- include "common.tplvalues.render" ( dict "value" .Values.serviceAccount.annotations "context" $ ) | nindent 4 }}
18+
{{- end }}
19+
{{- end }}

bitnami/phpmyadmin/values.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,27 @@ db:
540540
##
541541
mariadb: {}
542542

543+
## @section Other Parameters
544+
545+
## Service account for PhpMyAdmin to use.
546+
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
547+
##
548+
serviceAccount:
549+
## @param serviceAccount.create Enable creation of ServiceAccount for PhpMyAdmin pod
550+
##
551+
create: false
552+
## @param serviceAccount.name The name of the ServiceAccount to use.
553+
## If not set and create is true, a name is generated using the common.names.fullname template
554+
##
555+
name: ""
556+
## @param serviceAccount.automountServiceAccountToken Allows auto mount of ServiceAccountToken on the serviceAccount created
557+
## Can be set to false if pods using this serviceAccount do not need to use K8s API
558+
##
559+
automountServiceAccountToken: true
560+
## @param serviceAccount.annotations Additional custom annotations for the ServiceAccount
561+
##
562+
annotations: {}
563+
543564
## @section Metrics parameters
544565

545566
## Prometheus Exporter / Metrics

0 commit comments

Comments
 (0)