Skip to content

Instantly share code, notes, and snippets.

@vpereira
Created July 1, 2020 07:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vpereira/87168fd499f8be7e647cccef4d8fccf1 to your computer and use it in GitHub Desktop.
Save vpereira/87168fd499f8be7e647cccef4d8fccf1 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Pod
metadata:
name: busybox
namespace: kubeflow
spec:
restartPolicy: Never
containers:
- name: volume-check
image: busybox
command:
- sh
- "-c"
- "sleep 360"
volumeMounts:
- mountPath: "/scripts"
name: "training"
- name: install
image: alpine/git
command:
- "git"
- "clone"
- "--depth"
- "1"
- "https://github.com/vpereira/ml-demo.git"
- "/scripts/demo"
volumeMounts:
- mountPath: "/scripts"
name: "training"
volumes:
- name: "training"
persistentVolumeClaim:
claimName: "tfevent-volume"
apiVersion: "kubeflow.org/v1"
kind: "TFJob"
metadata:
name: "demo"
namespace: kubeflow
spec:
cleanPodPolicy: None
tfReplicaSpecs:
Worker:
replicas: 1
restartPolicy: Never
template:
spec:
containers:
- name: tensorflow
image: tensorflow/tensorflow
command:
- "bash"
- "/scripts/demo/run_demo.sh"
volumeMounts:
- mountPath: "/scripts"
name: "training"
volumes:
- name: "training"
persistentVolumeClaim:
claimName: "tfevent-volume"
apiVersion: v1
kind: PersistentVolume
metadata:
name: tfevent-volume
labels:
type: local
app: tfjob
spec:
capacity:
storage: 10Gi
storageClassName: standard
accessModes:
- ReadWriteMany
hostPath:
path: /tmp/data
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: tfevent-volume
namespace: kubeflow
labels:
type: local
app: tfjob
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment