mirror of
https://github.com/bitnami/charts.git
synced 2026-03-06 06:58:50 +08:00
96 lines
3.7 KiB
YAML
96 lines
3.7 KiB
YAML
apiVersion: extensions/v1beta1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ template "tensorflow-resnet.fullname" . }}
|
|
labels:
|
|
app: {{ template "tensorflow-resnet.name" . }}
|
|
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
|
release: "{{ .Release.Name }}"
|
|
heritage: "{{ .Release.Service }}"
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: {{ template "tensorflow-resnet.name" . }}
|
|
release: "{{ .Release.Name }}"
|
|
replicas: {{ .Values.replicaCount }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: {{ template "tensorflow-resnet.name" . }}
|
|
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
|
release: "{{ .Release.Name }}"
|
|
{{- if or .Values.podAnnotations .Values.metrics.enabled }}
|
|
annotations:
|
|
{{- if .Values.podAnnotations }}
|
|
{{ toYaml .Values.podAnnotations | indent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.metrics.podAnnotations }}
|
|
{{ toYaml .Values.metrics.podAnnotations | indent 8 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
spec:
|
|
{{- include "tensorflow-resnet.imagePullSecrets" . | indent 6 }}
|
|
initContainers:
|
|
- name: seed
|
|
image: "{{ template "tensorflow-resnet.client.image" . }}"
|
|
imagePullPolicy: {{ .Values.client.image.pullPolicy | quote }}
|
|
command:
|
|
- "/bin/sh"
|
|
- "-c"
|
|
- |
|
|
if [ -f /seed/.initialized ];then
|
|
echo "Already initialized. Skipping"
|
|
else
|
|
curl -o /seed/resnet_v2_fp32_savedmodel_NHWC_jpg.tar.gz http://download.tensorflow.org/models/official/20181001_resnet/savedmodels/resnet_v2_fp32_savedmodel_NHWC_jpg.tar.gz
|
|
cd /seed/ && tar -xzf resnet_v2_fp32_savedmodel_NHWC_jpg.tar.gz --strip-components=2
|
|
rm resnet_v2_fp32_savedmodel_NHWC_jpg.tar.gz
|
|
touch /seed/.initialized
|
|
fi
|
|
volumeMounts:
|
|
- name: seed
|
|
mountPath: /seed
|
|
containers:
|
|
- name: tensorflow-serving
|
|
image: "{{ template "tensorflow-resnet.server.image" . }}"
|
|
imagePullPolicy: {{ .Values.server.image.pullPolicy | quote }}
|
|
ports:
|
|
- name: tf-serving
|
|
containerPort: {{ .Values.server.port }}
|
|
{{- if .Values.livenessProbe.enabled }}
|
|
livenessProbe:
|
|
tcpSocket:
|
|
port: tf-serving
|
|
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
|
|
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
|
|
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
|
|
successThreshold: {{ .Values.livenessProbe.successThreshold }}
|
|
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
|
|
{{- end }}
|
|
{{- if .Values.readinessProbe.enabled }}
|
|
readinessProbe:
|
|
tcpSocket:
|
|
port: tf-serving
|
|
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
|
|
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
|
|
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
|
|
successThreshold: {{ .Values.readinessProbe.successThreshold }}
|
|
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
|
|
{{- end }}
|
|
env:
|
|
- name: TENSORFLOW_SERVING_MODEL_NAME
|
|
value: "resnet"
|
|
- name: TENSORFLOW_SERVING_PORT_NUMBER
|
|
value: {{ .Values.server.port }}
|
|
- name: TENSORFLOW_SERVING_REST_API_PORT_NUMBER
|
|
value: {{ .Values.server.restApiPort }}
|
|
{{- if .Values.metrics.enabled }}
|
|
- name: TENSORFLOW_SERVING_ENABLE_MONITORING
|
|
value: {{ ternary "yes" "no" .Values.metrics.enabled | quote }}
|
|
{{- end }}
|
|
volumeMounts:
|
|
- name: seed
|
|
mountPath: "/bitnami/model-data"
|
|
volumes:
|
|
- name: seed
|
|
emptyDir: {}
|