Thursday, December 17, 2015

kubernetes up and running on Bare-metal ubuntu

Access a service in a public cloud using ssh local port forward 

$ $ kubectl describe service fabric8

Name:                   fabric8

Namespace:              default

Labels:                 expose=true,group=io.fabric8.apps,project=console,provider=fabric8,version=2.2.173

Selector:               expose=true,group=io.fabric8.apps,project=console,provider=fabric8

Type:                   LoadBalancer

IP:                     192.168.3.145

Port:                   <unset> 80/TCP

NodePort:               <unset> 30156/TCP

Endpoints:              172.16.48.3:9090

Session Affinity:       None

ssh -L <local_port>:<service_endpoint> remote_ssh_user@floating_ip

curl http://localhost:<local_port>


change a deployment online

kubectl edit deployment exposecontroller
kubectl delete deployment exposecontroller



Labels are a set of key / value pairs of strings to attach to pods. Use any keys or values you like. Then you can create a selector, which is a set of key / value pairs to query for the pods you need; i.e. to select all pods with labels matching those in the selector.


kubernetes/cluster/ubuntu/binaries$ ./kubectl describe pod jnlp-slave

   ---   ----                    -------------   --------    ------          -------

  2m            2m              1       {default-scheduler }                    Normal              Scheduled       Successfully assigned jnlp-slave-27ab4c18d2d7a to 10.25.237.100

  1m            1m              1       {kubelet 10.25.237.100}                 Warning             FailedSync      Error syncing pod, skipping: failed to "StartContainer" for "POD" with ErrImagePull: "image pull failed for gcr.io/google_containers/pause:2.0, this may be because there are no credentials on this request.  details: (API error (500): Get https://gcr.io/v1/_ping: dial tcp 64.233.189.82:443: i/o timeout\n)"


  30s   30s     1       {kubelet 10.25.237.100}         Warning FailedSync      Error syncing pod, skipping: failed to "StartContainer" for "POD" with ErrImagePull: "image pull failed for gcr.io/google_containers/pause:2.0, this may be because there are no credentials on this request.  details: (API error (500): Get https://gcr.io/v1/_ping: dial tcp 64.233.187.82:443: i/o timeout\n)"


docker pull docker.io/kubernetes/pause
docker tag docker.io/kubernetes/pause gcr.io/google_containers/pause:2.0
docker save gcr.io/google_containers/pause:2.0  > pause.tar
scp pause.tar s1:~/
ssh s1
docker load -i pause.tar



service log /var/log/upstart




Docker daemon can't start after installing Kubernetes in Ubuntu

We have used Kubernetes ubuntu provider scripts to deploy multiple nodes cluster
After installing with kube-up.sh, the script try to override the /etc/default/docker and docker daemon fail to start with this configuration
DOCKER_OPTS=" -H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock --bip=172.16.48.1/24 --mtu=8951 --insecure-registry 10.69.1.246 --insecure-registry tobe.com -H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock --bip=172.16.19.1/24 --mtu=8951"
A: ubuntu/reconfDocker.sh   to comment # source /etc/default/docker





Proxy


No comments:

Post a Comment