# oc ``` # get token from web console oc login --token= oc get all oc get oc start-build # start async build oc start-build --follow # show logs oc start-build --wait # wait for finish, proper exit code ``` ``` oc debug -f definiton.yaml # interactive shell oc rsh oc logs oc exec oc rsync : oc rsync : ``` # arch lots of REST apis, developers typically are/use clients, like `oc` or web console. - `init` vs `application containers`, complete and exit vs running continuously - builder images, instead of building directly w/ docker cli (`docker push`) - pods stop when their containers exit - replication controller reschedules after node disruption - initContainers - service has one ip that proxies to backing pod, headless service is different - an okd project is a kubernetes namespace # builds - build strategies: docker build, s2i (source-to-image), custom build - pipeline builds for sophisticated workflows like ci, cd, defined in jenkinsfile # reference - [okd image tag policy](https://docs.okd.io/latest/architecture/core_concepts/containers_and_images.html) - version `vX.Y` or `X.Y.Z` or `X.Y.Z-n` # [s2i builder images](https://github.com/openshift/source-to-image) - base language, runtime and build tools - assemble script (src, deps and config) - run script (`CMD` in final image) - there is optional incremental build-foo - runtime includes build tools (can be avoided w/ "extended builds") `s2i build `, images must follow some s2i rules, f.e. `centos/python-35-centos7`, `ibotty/s2i-nginx` and [python](https://github.com/sclorg/s2i-python-container). play with: ``` s2i-demo1: docker run centos/python-34-centos7 s2i build https://github.com/openshift/s2i-python.git --context-dir=3.4/test/setup-test-app/ centos/python-34-centos7 python-sample-app docker run -p 8080:8080 python-sample-app s2i-demo2: docker run centos/python-34-centos7 s2i build https://github.com/openshift/django-ex centos/python-34-centos7 my/python docker run -p 8080:8080 my/python ``` # minishift needs a hypervisor, which is host system dependent. on mac make sure to use supported version (0.3.3 atm). `hyperkit` had problems restarting once minishift was stopped. ``` minishift --vm-driver=hyperkit start minishift config set vm-driver hyperkit ``` - `minishift oc-env` - `oc login -u system:admin` - `minishift delete --force --clear-cache` - `minishift --alsologtostderr --show-libmachine-logs -v5 start`