[bitnami/tensorflow-resnet] fix: 🔒 Move service-account token auto-mount to pod declaration (#22500)

* [bitnami/tensorflow-resnet] fix: 🔒 Move service-account token auto-mount to pod declaration

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* fix: 🐛 Add missing SA

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

---------

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>
This commit is contained in:
Javier J. Salmerón-García
2024-01-22 11:36:16 +01:00
committed by GitHub
parent 7cf2163869
commit 02b736f28a
6 changed files with 60 additions and 1 deletions
+1 -1
View File
@@ -33,4 +33,4 @@ maintainers:
name: tensorflow-resnet
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/tensorflow-resnet
version: 3.11.1
version: 3.12.0
+5
View File
@@ -94,6 +94,7 @@ The command removes all the Kubernetes components associated with the chart and
| `client.image.digest` | TensorFlow ResNet image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag | `""` |
| `client.image.pullPolicy` | TensorFlow ResNet image pull policy | `IfNotPresent` |
| `client.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` |
| `automountServiceAccountToken` | Mount Service Account token in pod | `false` |
| `hostAliases` | Deployment pod host aliases | `[]` |
| `containerPorts.server` | Tensorflow server port | `8500` |
| `containerPorts.restApi` | TensorFlow Serving Rest API Port | `8501` |
@@ -159,6 +160,10 @@ The command removes all the Kubernetes components associated with the chart and
| `customStartupProbe` | Custom liveness probe | `{}` |
| `customLivenessProbe` | Custom liveness probe | `{}` |
| `customReadinessProbe` | Custom readiness probe | `{}` |
| `serviceAccount.create` | Enable creation of ServiceAccount for pod | `true` |
| `serviceAccount.name` | The name of the ServiceAccount to use. | `""` |
| `serviceAccount.automountServiceAccountToken` | Allows auto mount of ServiceAccountToken on the serviceAccount created | `false` |
| `serviceAccount.annotations` | Additional custom annotations for the ServiceAccount | `{}` |
| `service.type` | Kubernetes Service type | `LoadBalancer` |
| `service.ports.server` | TensorFlow Serving server port | `8500` |
| `service.ports.restApi` | TensorFlow Serving Rest API port | `8501` |
@@ -19,6 +19,17 @@ Return the proper tensorflow-resnet client image name
{{ include "common.images.image" (dict "imageRoot" .Values.client.image "global" .Values.global) }}
{{- end -}}
{{/*
Create the name of the service account to use
*/}}
{{- define "tensorflow-resnet.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "common.names.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Return the proper Docker Image Registry Secret Names
*/}}
@@ -34,6 +34,8 @@ spec:
{{- end }}
spec:
{{- include "tensorflow-resnet.imagePullSecrets" . | nindent 6 }}
serviceAccountName: {{ include "tensorflow-resnet.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
{{- if .Values.hostAliases }}
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }}
{{- end }}
@@ -0,0 +1,18 @@
{{- /*
Copyright VMware, Inc.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "tensorflow-resnet.serviceAccountName" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if or .Values.serviceAccount.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.serviceAccount.annotations .Values.commonAnnotations ) "context" . ) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
{{- end -}}
+23
View File
@@ -110,6 +110,9 @@ client:
## - myRegistryKeySecretName
##
pullSecrets: []
## @param automountServiceAccountToken Mount Service Account token in pod
##
automountServiceAccountToken: false
## @param hostAliases Deployment pod host aliases
## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
##
@@ -359,6 +362,26 @@ customLivenessProbe: {}
## @param customReadinessProbe Custom readiness probe
##
customReadinessProbe: {}
## Service Account
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
##
serviceAccount:
## @param serviceAccount.create Enable creation of ServiceAccount for pod
##
create: true
## @param serviceAccount.name The name of the ServiceAccount to use.
## If not set and create is true, a name is generated using the common.names.fullname template
##
name: ""
## @param serviceAccount.automountServiceAccountToken Allows auto mount of ServiceAccountToken on the serviceAccount created
## Can be set to false if pods using this serviceAccount do not need to use K8s API
##
automountServiceAccountToken: false
## @param serviceAccount.annotations Additional custom annotations for the ServiceAccount
##
annotations: {}
## Service for the scheduler node
##
service: