Sample application to load model from Minio
[demo.git] / vnfs / DAaaS / sample-apps / sample-minio-load-model / templates / deployment.yaml
1 {{/*
2 # Copyright 2019 Intel Corporation, Inc
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 */}}
16
17 apiVersion: extensions/v1beta1
18 kind: Deployment
19 metadata:
20   name: {{ include "model-loader.fullname" . }}
21   labels:
22     app: {{ include "model-loader.name" . }}
23     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
24     release: {{ .Release.Name }}
25     heritage: {{ .Release.Service | quote }}
26 spec:
27   replicas: 1
28   selector:
29     matchLabels:
30       app: {{ include "model-loader.name" . }}
31       release: {{ .Release.Name }}
32       modelName: {{ .Values.modelName }}
33   template:
34     metadata:
35       labels:
36         app: {{ include "model-loader.name" . }}
37         release: {{ .Release.Name }}
38         modelName: {{ .Values.modelName }}
39     spec:
40       serviceAccountName: {{ template "model-loader.serviceAccountName" . }}
41       containers:
42         - name: model-loader
43           image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
44           imagePullPolicy: {{ .Values.image.pullPolicy }}
45           env:
46             - name: AWS_ACCESS_KEY_ID
47               valueFrom:
48                 secretKeyRef:
49                   name: {{ if .Values.minio.existingSecret }}{{ .Values.minio.existingSecret }}{{ else }}{{ template "model-loader.fullname" . }}{{ end }}
50                   key: accesskey
51             - name: AWS_SECRET_ACCESS_KEY
52               valueFrom:
53                 secretKeyRef:
54                   name: {{ if .Values.minio.existingSecret }}{{ .Values.minio.existingSecret }}{{ else }}{{ template "model-loader.fullname" . }}{{ end }}
55                   key: secretkey
56             {{- range $key, $val := .Values.minio.environment }}
57             - name: {{ $key }}
58               value: {{ $val | quote }}
59             {{- end}}
60           resources:
61             {{ toYaml .Values.resources | indent 12 }}
62           volumeMounts:
63             - mountPath: /models
64               name: models
65       volumes:
66         - name: models
67           emptyDir: {}
68       {{- with .Values.nodeSelector }}
69       nodeSelector:
70         {{- toYaml . | nindent 8 }}
71       {{- end }}
72     {{- with .Values.affinity }}
73       affinity:
74         {{- toYaml . | nindent 8 }}
75     {{- end }}
76     {{- with .Values.tolerations }}
77       tolerations:
78         {{- toYaml . | nindent 8 }}
79     {{- end }}