blob: 4083466dab2cd2baa343413e387f44f5e94c3855 [file] [log] [blame]
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
apiVersion: v1
kind: PersistentVolume
metadata:
name: submarine-mlflow-pv
spec:
accessModes:
- ReadWriteMany
capacity:
storage: "{{ .Values.submarine.mlflow.storage }}"
{{- with .Values.submarine.storage }}
{{- if eq (.type | lower) "nfs" }}
nfs:
server: {{ .nfs.ip }}
path: {{ .nfs.path }}
{{- else }}
hostPath:
path: "{{ .host.path }}"
type: DirectoryOrCreate
{{- end }}
{{- end}}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: submarine-mlflow-pvc
spec:
accessModes:
- ReadWriteMany
storageClassName: ""
resources:
requests:
storage: "{{ .Values.submarine.mlflow.storage }}"
volumeName: submarine-mlflow-pv
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: submarine-mlflow
spec:
selector:
matchLabels:
app: submarine-mlflow-pod
template:
metadata:
labels:
app: submarine-mlflow-pod
spec:
initContainers:
- name: submarine-mlflow-initcontainer
image: "minio/mc"
command: ["/bin/bash", "-c",
"cnt=0;
while ! /bin/bash -c 'mc config host add minio http://submarine-minio-service:9000
submarine_minio submarine_minio' 2>&1;
do
sleep 15;
((cnt=cnt+1));
if [ $cnt -eq 80 ];then
echo 'ERROR: wait too long for minio pod';
exit 1;
fi;
done;
if /bin/bash -c 'mc ls minio/mlflow' >/dev/null 2>&1; then
echo 'Bucket minio/mlflow already exists, skipping creation.';
else
/bin/bash -c 'mc mb minio/mlflow';
fi;"]
containers:
- name: submarine-mlflow-container
image: apache/submarine:mlflow-0.6.0-SNAPSHOT
imagePullPolicy: IfNotPresent
ports:
- containerPort: 5000
volumeMounts:
- mountPath: "/logs"
name: "volume"
subPath: "submarine-mlflow"
readinessProbe:
tcpSocket:
port: 5000
initialDelaySeconds: 60
periodSeconds: 10
volumes:
- name: "volume"
persistentVolumeClaim:
claimName: "submarine-mlflow-pvc"
---
apiVersion: v1
kind: Service
metadata:
name: submarine-mlflow-service
spec:
type: ClusterIP
selector:
app: submarine-mlflow-pod
ports:
- protocol: TCP
port: 5000
targetPort: 5000
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: submarine-mlflow-ingressroute
spec:
entryPoints:
- web
routes:
- kind: Rule
match: "PathPrefix(`{{ .Values.submarine.mlflow.ingressPath }}`)"
services:
- kind: Service
name: submarine-mlflow-service
port: 5000