Skip to content

Instantly share code, notes, and snippets.

@sub-mod
Last active May 16, 2018 16:41
Show Gist options
  • Save sub-mod/d25e3732e1c149fb67eb3fba7c1bd219 to your computer and use it in GitHub Desktop.
Save sub-mod/d25e3732e1c149fb67eb3fba7c1bd219 to your computer and use it in GitHub Desktop.
Kubeflow TFJob operator on Openshift Notes

1) Login as developer and make a Project

oc login -u developer -p developer
oc new-project test

2) Make the SA(tf-job-operator-sa) cluster-admin in the test Namespace

Since CRD & its instance has to be created by cluster-admin we have to make SA a cluster-admin

oc login -u system:admin
oc create clusterrolebinding default-admin --clusterrole=cluster-admin --serviceaccount=test:tf-job-operator-sa

3) create tf-job-operator template in test Namespace

oc login -u developer -p developer
oc project test
oc create -f https://gist.githubusercontent.com/sub-mod/7439489578de2d1357f44bd437024e4b/raw/2e8e5b5d56ec80f28edfc8a4c6005bafb7d13a17/tf-job-operator.json

4) create new-app for tf-job-operator in test Namespace

oc login -u developer -p developer
oc project test
oc new-app --template=kubeflow-operator

5.1) create a sample TfJob-cpu in test Namespace

CRD instance has to be created by cluster-admin

oc login -u system:admin
oc create -f https://gist.githubusercontent.com/sub-mod/831983409ffab7650ff07227815ff4ad/raw/9ca6feaa2f93452795717dd40d688fe645a588a6/sample-tfjob-cpu.json

5.2) create a sample distributed TfJob in test Namespace

CRD instance has to be created by cluster-admin

oc login -u system:admin
oc create -f https://gist.githubusercontent.com/sub-mod/555591ae9bcb9f017b9b4fc918a8c5ba/raw/27cdc40c579fe7adc83450f0578fb61c7e65c5c9/sample-distributed-tfjob.json

Cleanup

Cleanup to try Again

oc login -u system:admin
oc delete project test
oc delete clusterrolebinding default-admin 
oc delete sa tf-job-operator-sa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment