oc
# get token from web console
oc login <url> --token=<token>
oc get all
oc get <name>
oc start-build <buildConfig> # start async build
oc start-build <buildConfig> --follow # show logs
oc start-build <buildConfig> --wait # wait for finish, proper exit code
oc debug -f definiton.yaml # interactive shell
oc rsh <name>
oc logs <name>
oc exec <name> <cmd>
oc rsync <local_dir> <pod>:<pod_dir>
oc rsync <pod>:<pod_dir> <local_dir>
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
- 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 <src> <s2i-image>, images must follow some s2i rules, f.e.
centos/python-35-centos7, ibotty/s2i-nginx and
python.
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