Merge remote-tracking branch 'kubernetes/master' into add-clc
This commit is contained in:
@@ -12,6 +12,8 @@ The list of binary releases is available for download from the [GitHub Kubernete
|
||||
|
||||
Download the latest release and unpack this tar file on Linux or OS X, cd to the created `kubernetes/` directory, and then follow the getting started guide for your cloud.
|
||||
|
||||
On OS X you can also use the [homebrew](http://brew.sh/) package manager: `brew install kubernetes-cli`
|
||||
|
||||
### Building from source
|
||||
|
||||
Get the Kubernetes source. If you are simply building a release from source there is no need to set up a full golang environment as all building happens in a Docker container.
|
||||
|
||||
@@ -21,22 +21,16 @@ $ export DNS_SERVER_IP=10.0.0.10 # specify in startup parameter `--cluster-dns`
|
||||
|
||||
### Replace the corresponding value in the template and create the pod
|
||||
|
||||
```shell
|
||||
```shell{% raw %}
|
||||
$ sed -e "s/{{ pillar\['dns_replicas'\] }}/${DNS_REPLICAS}/g;s/{{ pillar\['dns_domain'\] }}/${DNS_DOMAIN}/g;s/{{ pillar\['dns_server'\] }}/${DNS_SERVER_IP}/g" skydns.yaml.in > ./skydns.yaml
|
||||
|
||||
# If the kube-system namespace isn't already created, create it
|
||||
$ kubectl get ns
|
||||
$ kubectl create -f ./kube-system.yaml
|
||||
|
||||
$ kubectl create -f ./skydns.yaml
|
||||
$ kubectl create -f ./skydns.yaml{% endraw %}
|
||||
```
|
||||
|
||||
### Test if DNS works
|
||||
|
||||
Follow [this link](https://releases.k8s.io/{{page.githubbranch}}/cluster/addons/dns#how-do-i-test-if-it-is-working) to check it out.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ Here's a diagram of what the final result will look like:
|
||||
|
||||
1. You need to have docker installed on one machine.
|
||||
2. Decide what Kubernetes version to use. Set the `${K8S_VERSION}` variable to
|
||||
a released version of Kubernetes >= "1.2.0-alpha.7"
|
||||
a released version of Kubernetes >= "1.2.0"
|
||||
|
||||
### Run it
|
||||
|
||||
@@ -28,6 +28,7 @@ docker run \
|
||||
--net=host \
|
||||
--pid=host \
|
||||
--privileged=true \
|
||||
--name=kubelet \
|
||||
-d \
|
||||
gcr.io/google_containers/hyperkube-amd64:v${K8S_VERSION} \
|
||||
/hyperkube kubelet \
|
||||
@@ -53,39 +54,43 @@ At this point you should have a running Kubernetes cluster. You can test this
|
||||
by downloading the kubectl binary for `${K8S_VERSION}` (look at the URL in the
|
||||
following links) and make it available by editing your PATH environment
|
||||
variable.
|
||||
([OS X/amd64](http://storage.googleapis.com/kubernetes-release/release/{{page.version}}.0-alpha.7/bin/darwin/amd64/kubectl))
|
||||
([OS X/386](http://storage.googleapis.com/kubernetes-release/release/{{page.version}}.0-alpha.7/bin/darwin/386/kubectl))
|
||||
([linux/amd64](http://storage.googleapis.com/kubernetes-release/release/{{page.version}}.0-alpha.7/bin/linux/amd64/kubectl))
|
||||
([linux/386](http://storage.googleapis.com/kubernetes-release/release/{{page.version}}.0-alpha.7/bin/linux/386/kubectl))
|
||||
([linux/arm](http://storage.googleapis.com/kubernetes-release/release/{{page.version}}.0-alpha.7/bin/linux/arm/kubectl))
|
||||
([OS X/amd64](http://storage.googleapis.com/kubernetes-release/release/{{page.version}}.0/bin/darwin/amd64/kubectl))
|
||||
([OS X/386](http://storage.googleapis.com/kubernetes-release/release/{{page.version}}.0/bin/darwin/386/kubectl))
|
||||
([linux/amd64](http://storage.googleapis.com/kubernetes-release/release/{{page.version}}.0/bin/linux/amd64/kubectl))
|
||||
([linux/386](http://storage.googleapis.com/kubernetes-release/release/{{page.version}}.0/bin/linux/386/kubectl))
|
||||
([linux/arm](http://storage.googleapis.com/kubernetes-release/release/{{page.version}}.0/bin/linux/arm/kubectl))
|
||||
|
||||
For example, OS X:
|
||||
|
||||
```shell
|
||||
$ wget http://storage.googleapis.com/kubernetes-release/release/v${K8S_VERSION}/bin/darwin/amd64/kubectl
|
||||
$ chmod 755 kubectl
|
||||
$ PATH=$PATH:`pwd`
|
||||
wget http://storage.googleapis.com/kubernetes-release/release/v${K8S_VERSION}/bin/darwin/amd64/kubectl
|
||||
chmod 755 kubectl
|
||||
PATH=$PATH:`pwd`
|
||||
```
|
||||
|
||||
Linux:
|
||||
|
||||
```shell
|
||||
$ wget http://storage.googleapis.com/kubernetes-release/release/v${K8S_VERSION}/bin/linux/amd64/kubectl
|
||||
$ chmod 755 kubectl
|
||||
$ PATH=$PATH:`pwd`
|
||||
wget http://storage.googleapis.com/kubernetes-release/release/v${K8S_VERSION}/bin/linux/amd64/kubectl
|
||||
chmod 755 kubectl
|
||||
PATH=$PATH:`pwd`
|
||||
```
|
||||
|
||||
Create configuration:
|
||||
On OS X, to make the API server accessible locally, setup a ssh tunnel.
|
||||
|
||||
```shell
|
||||
$ kubectl config set-cluster test-doc --server=http://localhost:8080
|
||||
$ kubectl config set-context test-doc --cluster=test-doc
|
||||
$ kubectl config use-context test-doc
|
||||
docker-machine ssh `docker-machine active` -N -L 8080:localhost:8080
|
||||
```
|
||||
|
||||
For Max OS X users instead of `localhost` you will have to use IP address of your docker machine,
|
||||
which you can find by running `docker-machine env <machinename>` (see [documentation](https://docs.docker.com/machine/reference/env/)
|
||||
for details).
|
||||
Setting up a ssh tunnel is applicable to remote docker hosts as well.
|
||||
|
||||
(Optional) Create kubernetes cluster configuration:
|
||||
|
||||
```shell
|
||||
kubectl config set-cluster test-doc --server=http://localhost:8080
|
||||
kubectl config set-context test-doc --cluster=test-doc
|
||||
kubectl config use-context test-doc
|
||||
```
|
||||
|
||||
### Test it out
|
||||
|
||||
@@ -113,62 +118,72 @@ Now run `docker ps` you should see nginx running. You may need to wait a few mi
|
||||
### Expose it as a service
|
||||
|
||||
```shell
|
||||
kubectl expose rc nginx --port=80
|
||||
kubectl expose deployment nginx --port=80
|
||||
```
|
||||
|
||||
Run the following command to obtain the IP of this service we just created. There are two IPs, the first one is internal (CLUSTER_IP), and the second one is the external load-balanced IP (if a LoadBalancer is configured)
|
||||
Run the following command to obtain the cluster local IP of this service we just created:
|
||||
|
||||
```shell
|
||||
kubectl get svc nginx
|
||||
```
|
||||
```shell{% raw %}
|
||||
ip=$(kubectl get svc nginx --template={{.spec.clusterIP}})
|
||||
echo $ip
|
||||
{% endraw %}```
|
||||
|
||||
Alternatively, you can obtain only the first IP (CLUSTER_IP) by running:
|
||||
Hit the webserver with this IP:
|
||||
|
||||
```shell
|
||||
```shell{% raw %}
|
||||
kubectl get svc nginx --template={{.spec.clusterIP}}
|
||||
```
|
||||
|
||||
Hit the webserver with the first IP (CLUSTER_IP):
|
||||
{% endraw %}```
|
||||
|
||||
On OS X, since docker is running inside a VM, run the following command instead:
|
||||
```shell
|
||||
curl <insert-cluster-ip-here>
|
||||
docker-machine ssh `docker-machine active` curl $ip
|
||||
```
|
||||
|
||||
Note that you will need run this curl command on your boot2docker VM if you are running on OS X.
|
||||
|
||||
## Deploy a DNS
|
||||
|
||||
See [here](/docs/getting-started-guides/docker-multinode/deployDNS/) for instructions.
|
||||
|
||||
### A note on turning down your cluster
|
||||
### Turning down your cluster
|
||||
|
||||
Many of these containers run under the management of the `kubelet` binary, which attempts to keep containers running, even if they fail. So, in order to turn down
|
||||
the cluster, you need to first kill the kubelet container, and then any other containers.
|
||||
1. Delete all the containers including the kubelet:
|
||||
|
||||
Many of these containers run under the management of the `kubelet` binary, which attempts to keep containers running, even if they fail.
|
||||
So, in order to turn down the cluster, you need to first kill the kubelet container, and then any other containers.
|
||||
|
||||
You may use `docker kill $(docker ps -aq)`, note this removes _all_ containers running under Docker, so use with caution.
|
||||
|
||||
2. Cleanup the filesystem:
|
||||
|
||||
On OS X, first ssh into the docker VM:
|
||||
|
||||
```shell
|
||||
docker-machine ssh `docker-machine active`
|
||||
```
|
||||
|
||||
```shell
|
||||
sudo umount `cat /proc/mounts | grep /var/lib/kubelet | awk '{print $2}'`
|
||||
sudo rm -rf /var/lib/kubelet
|
||||
```
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
#### Node is in `NotReady` state
|
||||
|
||||
If you see your node as `NotReady` it's possible that your OS does not have memcg and swap enabled.
|
||||
If you see your node as `NotReady` it's possible that your OS does not have memcg enabled.
|
||||
|
||||
1. Your kernel should support memory and swap accounting. Ensure that the
|
||||
1. Your kernel should support memory accounting. Ensure that the
|
||||
following configs are turned on in your linux kernel:
|
||||
|
||||
```shell
|
||||
CONFIG_RESOURCE_COUNTERS=y
|
||||
CONFIG_MEMCG=y
|
||||
CONFIG_MEMCG_SWAP=y
|
||||
CONFIG_MEMCG_SWAP_ENABLED=y
|
||||
CONFIG_MEMCG_KMEM=y
|
||||
```
|
||||
|
||||
2. Enable the memory and swap accounting in the kernel, at boot, as command line
|
||||
2. Enable the memory accounting in the kernel, at boot, as command line
|
||||
parameters as follows:
|
||||
|
||||
```shell
|
||||
GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
|
||||
GRUB_CMDLINE_LINUX="cgroup_enable=memory=1"
|
||||
```
|
||||
|
||||
NOTE: The above is specifically for GRUB2.
|
||||
@@ -177,5 +192,5 @@ parameters as follows:
|
||||
|
||||
```shell
|
||||
$ cat /proc/cmdline
|
||||
BOOT_IMAGE=/boot/vmlinuz-3.18.4-aufs root=/dev/sda5 ro cgroup_enable=memory swapaccount=1
|
||||
BOOT_IMAGE=/boot/vmlinuz-3.18.4-aufs root=/dev/sda5 ro cgroup_enable=memory=1
|
||||
```
|
||||
|
||||
@@ -9,9 +9,11 @@ spec:
|
||||
dnsPolicy: Default
|
||||
containers:
|
||||
- name: fluentd-cloud-logging
|
||||
image: gcr.io/google_containers/fluentd-gcp:1.17
|
||||
image: gcr.io/google_containers/fluentd-gcp:1.18
|
||||
resources:
|
||||
limits:
|
||||
memory: 200Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 200Mi
|
||||
env:
|
||||
|
||||
@@ -119,7 +119,7 @@ which is unique from future cluster names. This will be used in several ways:
|
||||
second one sometime later, such as for testing new Kubernetes releases, running in a different
|
||||
region of the world, etc.
|
||||
- Kubernetes clusters can create cloud provider resources (e.g. AWS ELBs) and different clusters
|
||||
need to distinguish which resources each created. Call this `CLUSTERNAME`.
|
||||
need to distinguish which resources each created. Call this `CLUSTER_NAME`.
|
||||
|
||||
### Software Binaries
|
||||
|
||||
@@ -160,7 +160,7 @@ You have several choices for Kubernetes images:
|
||||
release tag, which can be found on the [latest releases page](https://github.com/kubernetes/kubernetes/releases/latest).
|
||||
- Ensure $TAG is the same tag as the release tag you are using for kubelet and kube-proxy.
|
||||
- The [hyperkube](https://releases.k8s.io/{{page.githubbranch}}/cmd/hyperkube) binary is an all in one binary
|
||||
- `hyperkube kubelet ...` runs the kublet, `hyperkube apiserver ...` runs an apiserver, etc.
|
||||
- `hyperkube kubelet ...` runs the kubelet, `hyperkube apiserver ...` runs an apiserver, etc.
|
||||
- Build your own images.
|
||||
- Useful if you are using a private registry.
|
||||
- The release contains files such as `./kubernetes/server/bin/kube-apiserver.tar` which
|
||||
@@ -795,18 +795,18 @@ Notes for setting up each cluster service are given below:
|
||||
|
||||
* Cluster DNS:
|
||||
* required for many kubernetes examples
|
||||
* [Setup instructions](http://releases.k8s.io/release-1.2/cluster/addons/dns/)
|
||||
* [Admin Guide](../admin/dns.md)
|
||||
* [Setup instructions](http://releases.k8s.io/{{page.githubbranch}}/cluster/addons/dns/)
|
||||
* [Admin Guide](/docs/admin/dns/)
|
||||
* Cluster-level Logging
|
||||
* Multiple implementations with different storage backends and UIs.
|
||||
* [Elasticsearch Backend Setup Instructions](http://releases.k8s.io/release-1.2/cluster/addons/fluentd-elasticsearch/)
|
||||
* [Google Cloud Logging Backend Setup Instructions](http://releases.k8s.io/release-1.2/cluster/addons/fluentd-gcp/).
|
||||
* [Elasticsearch Backend Setup Instructions](http://releases.k8s.io/{{page.githubbranch}}/cluster/addons/fluentd-elasticsearch/)
|
||||
* [Google Cloud Logging Backend Setup Instructions](http://releases.k8s.io/{{page.githubbranch}}/cluster/addons/fluentd-gcp/).
|
||||
* Both require running fluentd on each node.
|
||||
* [User Guide](../user-guide/logging.md)
|
||||
* [User Guide](/docs/user-guide/logging/)
|
||||
* Container Resource Monitoring
|
||||
* [Setup instructions](http://releases.k8s.io/release-1.2/cluster/addons/cluster-monitoring/)
|
||||
* [Setup instructions](http://releases.k8s.io/{{page.githubbranch}}/cluster/addons/cluster-monitoring/)
|
||||
* GUI
|
||||
* [Setup instructions](http://releases.k8s.io/release-1.2/cluster/addons/kube-ui/)
|
||||
* [Setup instructions](https://github.com/kubernetes/kube-ui)
|
||||
cluster.
|
||||
|
||||
## Troubleshooting
|
||||
@@ -836,4 +836,4 @@ pinging or SSH-ing from one node to another.
|
||||
### Getting Help
|
||||
|
||||
If you run into trouble, please see the section on [troubleshooting](/docs/getting-started-guides/gce#troubleshooting), post to the
|
||||
[google-containers group](https://groups.google.com/forum/#!forum/google-containers), or come ask questions on [Slack](/docs/troubleshooting#slack).
|
||||
[google-containers group](https://groups.google.com/forum/#!forum/google-containers), or come ask questions on [Slack](/docs/troubleshooting#slack).
|
||||
|
||||
@@ -24,7 +24,7 @@ use a CNI plugin instead.
|
||||
Internet to download the necessary files, while worker nodes do not.
|
||||
3. These guide is tested OK on Ubuntu 14.04 LTS 64bit server, but it can not work with
|
||||
Ubuntu 15 which uses systemd instead of upstart.
|
||||
4. Dependencies of this guide: etcd-2.2.1, flannel-0.5.5, k8s-1.1.4, may work with higher versions.
|
||||
4. Dependencies of this guide: etcd-2.2.1, flannel-0.5.5, k8s-1.1.8, may work with higher versions.
|
||||
5. All the remote servers can be ssh logged in without a password by using key authentication.
|
||||
|
||||
|
||||
@@ -41,12 +41,12 @@ $ git clone https://github.com/kubernetes/kubernetes.git
|
||||
#### Configure and start the Kubernetes cluster
|
||||
|
||||
The startup process will first download all the required binaries automatically.
|
||||
By default etcd version is 2.2.1, flannel version is 0.5.5 and k8s version is 1.1.4.
|
||||
By default etcd version is 2.2.1, flannel version is 0.5.5 and k8s version is 1.1.8.
|
||||
You can customize your etcd version, flannel version, k8s version by changing corresponding variables
|
||||
`ETCD_VERSION` , `FLANNEL_VERSION` and `KUBE_VERSION` like following.
|
||||
|
||||
```shell
|
||||
$ export KUBE_VERSION=1.0.5
|
||||
$ export KUBE_VERSION=1.1.8
|
||||
$ export FLANNEL_VERSION=0.5.0
|
||||
$ export ETCD_VERSION=2.2.0
|
||||
```
|
||||
|
||||
@@ -365,21 +365,25 @@ export KUBERNETES_NODE_MEMORY=2048
|
||||
|
||||
#### I want to set proxy settings for my Kubernetes cluster boot strapping!
|
||||
|
||||
If you are behind a proxy, you need to install vagrant proxy plugin and set the proxy settings by
|
||||
If you are behind a proxy, you need to install the Vagrant proxy plugin and set the proxy settings:
|
||||
|
||||
```sh
|
||||
```shell
|
||||
vagrant plugin install vagrant-proxyconf
|
||||
export KUBERNETES_HTTP_PROXY=http://username:password@proxyaddr:proxyport
|
||||
export KUBERNETES_HTTPS_PROXY=https://username:password@proxyaddr:proxyport
|
||||
```
|
||||
|
||||
Optionally you can specify addresses to not proxy, for example
|
||||
You can also specify addresses that bypass the proxy, for example:
|
||||
|
||||
```sh
|
||||
```shell
|
||||
export KUBERNETES_NO_PROXY=127.0.0.1
|
||||
```
|
||||
|
||||
If you are using sudo to make kubernetes build for example make quick-release, you need run `sudo -E make quick-release` to pass the environment variables.
|
||||
If you are using sudo to make Kubernetes build, use the `-E` flag to pass in the environment variables. For example, if running `make quick-release`, use:
|
||||
|
||||
```shell
|
||||
sudo -E make quick-release
|
||||
```
|
||||
|
||||
#### I ran vagrant suspend and nothing works!
|
||||
|
||||
|
||||
Reference in New Issue
Block a user