Monday, August 31, 2015

Kubernetes, Docker

Kubernetes

 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 gcr.io/google_containers/etcd:2.0.9 /usr/local/bin/etcd --addr=127.0.0.1:4001 --bind-addr=0.0.0.0:4001 --data-dir=/var/etcd/data
 
docker run --net=host -d -v /var/run/docker.sock:/var/run/docker.sock  gcr.io/google_containers/hyperkube:v0.21.2 /hyperkube kubelet --api_servers=http://localhost:8080 --v=2 --address=0.0.0.0 --enable_server --hostname_override=127.0.0.1 --config=/etc/kubernetes/manifests
 
docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v0.21.2 /hyperkube proxy --master=http://127.0.0.1:8080 --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
 

Docker

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.

    ReplyDelete