Monday, August 31, 2015

Kubernetes, Docker


 This article is only to hold links and ready to use commands. You can find more in documentation.

Running Kubernetes locally via Docker 

docker run --net=host -d /usr/local/bin/etcd --addr= --bind-addr= --data-dir=/var/etcd/data
docker run --net=host -d -v /var/run/docker.sock:/var/run/docker.sock /hyperkube kubelet --api_servers=http://localhost:8080 --v=2 --address= --enable_server --hostname_override= --config=/etc/kubernetes/manifests
docker run -d --net=host --privileged /hyperkube proxy --master= --v=2

Running an application

kubectl -s http://localhost:8080 run-container nginx --image=nginx --port=80

Expose it as a service

kubectl expose rc nginx --port=80

Turn down cluster

docker ps -a | awk '{print $1}' | xargs docker kill


Show available images

docker images

Build image

docker build -t approdorix/appname .

Stop, remove containers/images

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker rmi $(docker images -q) 

Troubleshooting docker

You want to run screen but no tty in docker:
exec >/dev/tty 2>/dev/tty </dev/tty

1 comment:

  1. Bring your luck and settle in for a night of state-of-the-art slots and massive payouts. Lock down your favourite machine or try out some of the the} 로스트아크 newest additions to our collection. If eager on|you like} the strategy of poker but favor to play at a faster pace and in your individual area, a glance at|try} Horseshoe Baltimore’s choice of more than 150 video poker machines. Just deal your cards, resolve which to keep, draw replacements for the discards and watch the credit pile up. Virtual reel mapping and unbalanced reels usually are not misleading options, he says.