Creating Objects |
om create --config ./my-manifest.json |
kubectl create -f ./my-manifest.yaml |
cat <cf> | om create |
cat <cf> | kubectl create -f - |
om ns1/sec/mysec create --from /etc/group |
kubectl create -f secret.yml |
Viewing and Finding |
om '*' ls |
kubectl get services
kubectl get pods |
om container.type=docker ls |
kubectl get pods -o jsonpath=... |
om <path> print config --format json |
kubectl describe svc <svc> |
Updating |
om <path> set --kw ip#0.expose=80:8080/tcp |
kubectl expose rc nginx --port=80
--target-port=8000 |
om <svc> set --kw
env.icon_url=http://goo.gl/XXBTWq |
kubectl annotate pods my-pod
icon-url=http://goo.gl/XXBTWq |
om <svc> get container#0.run_image |
sed 's/(.*):.*$/1:v4/' |
xargs om <svc> set --kw container#0.run_image |
kubectl get pod mypod -o yaml
sed 's/(image: myimage):.*$/1:v4/'
kubectl replace -f - |
om <svc> edit |
kubectl edit svc/docker-registry |
Scaling |
om foo scale --to 3 |
kubectl scale --replicas=3 rs/foo |
om foo,bar scale --to 3 |
kubectl scale --replicas=3 rs/foo rs/bar |
Deleting |
om foo,baz purge |
kubectl delete pod,service baz foo --all |
om env.name=myLabel delete --unprovision |
kubectl delete pods,services -l name=myLabel |
Interacting with Resources |
om foo logs
om foo logs --local |
kubectl logs my-pod |
om foo -f logs |
kubectl logs -f my-pod |
om foo docker run -it busybox sh |
kubectl run -i --tty busybox --image=busybox --
sh |
om foo docker attach -i {container#1} |
kubectl attach my-pod -i |
om foo docker exec {container#1} ls / |
kubectl exec my-pod -c my-container -- ls / |
Interacting with Nodes and Cluster |
om node freeze --local
om node freeze --node my-node |
kubectl cordon my-node |
om '**' stop --node my-node |
kubectl drain my-node |
om '**' thaw --node my-node |
kubectl uncordon my-node |
om daemon status --format json |
kubectl cluster-info dump |
om node set --kw env.dedicated=special_user
# plus constraints or node selector in services |
kubectl taint nodes foo
dedicated=special-user:NoSchedule |