From 7e14fa64f49aecc11454492c61318f4c3ae41974 Mon Sep 17 00:00:00 2001 From: heluocs Date: Fri, 23 Jul 2021 18:07:31 +0800 Subject: [PATCH] support annotations/nodeSelector/tolerations in tensorflow serving and nvidia triton --- charts/tfserving/CHANGELOG.md | 10 +++++++++ charts/tfserving/templates/deployment.yaml | 26 +++++++++++++++++++--- charts/triton/CHANGELOG.md | 10 +++++++++ charts/triton/templates/deployment.yaml | 24 ++++++++++++++++++++ 4 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 charts/tfserving/CHANGELOG.md create mode 100644 charts/triton/CHANGELOG.md diff --git a/charts/tfserving/CHANGELOG.md b/charts/tfserving/CHANGELOG.md new file mode 100644 index 000000000..ca63077fd --- /dev/null +++ b/charts/tfserving/CHANGELOG.md @@ -0,0 +1,10 @@ +### 0.1.0 + +* init tensorflow serving + + +### 0.2.0 + +* support nodeSelector +* support tolerance +* support annotations diff --git a/charts/tfserving/templates/deployment.yaml b/charts/tfserving/templates/deployment.yaml index 0ebfe5982..27932b25b 100755 --- a/charts/tfserving/templates/deployment.yaml +++ b/charts/tfserving/templates/deployment.yaml @@ -25,10 +25,13 @@ spec: app: {{ template "tensorflow-serving.name" . }} template: metadata: - {{- if eq .Values.enableIstio true }} annotations: - sidecar.istio.io/inject: "true" - {{- end }} + {{- if eq .Values.enableIstio true }} + sidecar.istio.io/inject: "true" + {{- end }} + {{- range $key, $value := .Values.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} labels: heritage: {{ .Release.Service | quote }} release: {{ .Release.Name | quote }} @@ -39,6 +42,23 @@ spec: servingType: "tf-serving" servingVersion: "{{ .Values.servingVersion }}" spec: + {{- if ne (len .Values.nodeSelectors) 0 }} + nodeSelector: + {{- range $nodeKey,$nodeVal := .Values.nodeSelectors }} + {{ $nodeKey }}: "{{ $nodeVal }}" + {{- end }} + {{- end }} + {{- if ne (len .Values.tolerations) 0 }} + tolerations: + {{- range $tolerationKey := .Values.tolerations }} + {{- if eq $tolerationKey "all" }} + - operator: "Exists" + {{- else }} + - key: "{{ $tolerationKey }}" + operator: "Exists" + {{- end }} + {{- end }} + {{- end }} initContainers: containers: diff --git a/charts/triton/CHANGELOG.md b/charts/triton/CHANGELOG.md new file mode 100644 index 000000000..e55a5b2ce --- /dev/null +++ b/charts/triton/CHANGELOG.md @@ -0,0 +1,10 @@ +### 0.1.0 + +* init nvidia triton server + + +### 0.2.0 + +* support nodeSelector +* support tolerance +* support annotations diff --git a/charts/triton/templates/deployment.yaml b/charts/triton/templates/deployment.yaml index 843941d88..714a14400 100755 --- a/charts/triton/templates/deployment.yaml +++ b/charts/triton/templates/deployment.yaml @@ -24,6 +24,13 @@ spec: app: {{ template "nvidia-triton-server.name" . }} template: metadata: + annotations: + {{- if eq .Values.enableIstio true }} + sidecar.istio.io/inject: "true" + {{- end }} + {{- range $key, $value := .Values.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} labels: heritage: {{ .Release.Service | quote }} release: {{ .Release.Name | quote }} @@ -34,6 +41,23 @@ spec: servingVersion: "{{ .Values.servingVersion }}" servingType: "triton-serving" spec: + {{- if ne (len .Values.nodeSelectors) 0 }} + nodeSelector: + {{- range $nodeKey,$nodeVal := .Values.nodeSelectors }} + {{ $nodeKey }}: "{{ $nodeVal }}" + {{- end }} + {{- end }} + {{- if ne (len .Values.tolerations) 0 }} + tolerations: + {{- range $tolerationKey := .Values.tolerations }} + {{- if eq $tolerationKey "all" }} + - operator: "Exists" + {{- else }} + - key: "{{ $tolerationKey }}" + operator: "Exists" + {{- end }} + {{- end }} + {{- end }} containers: - name: tritonserver {{- if .Values.image }}