From eed33495017b9fa557cfb47b713b12e00ad1107f Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 11 Nov 2016 13:41:49 +0000 Subject: [PATCH 1/8] getting-started: replace 'yum' with 'dnf' in Fedora docs dnf has replaced yum as the standard package install tool in all versions of Fedora that are currently supported. Signed-off-by: Daniel P. Berrange --- .../fedora/fedora_ansible_config.md | 2 +- .../getting-started-guides/fedora/fedora_manual_config.md | 8 ++++---- .../fedora/flannel_multi_node_cluster.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/getting-started-guides/fedora/fedora_ansible_config.md b/docs/getting-started-guides/fedora/fedora_ansible_config.md index b5fe3802e0..3f4848f692 100644 --- a/docs/getting-started-guides/fedora/fedora_ansible_config.md +++ b/docs/getting-started-guides/fedora/fedora_ansible_config.md @@ -37,7 +37,7 @@ master,etcd = kube-master.example.com If not ```shell -yum install -y ansible git python-netaddr +dnf install -y ansible git python-netaddr ``` **Now clone down the Kubernetes repository** diff --git a/docs/getting-started-guides/fedora/fedora_manual_config.md b/docs/getting-started-guides/fedora/fedora_manual_config.md index d1948530a8..134ebabff1 100644 --- a/docs/getting-started-guides/fedora/fedora_manual_config.md +++ b/docs/getting-started-guides/fedora/fedora_manual_config.md @@ -33,18 +33,18 @@ fed-node = 192.168.121.65 **Prepare the hosts:** * Install Kubernetes on all hosts - fed-{master,node}. This will also pull in docker. Also install etcd on fed-master. This guide has been tested with kubernetes-0.18 and beyond. -* The [--enablerepo=updates-testing](https://fedoraproject.org/wiki/QA:Updates_Testing) directive in the yum command below will ensure that the most recent Kubernetes version that is scheduled for pre-release will be installed. This should be a more recent version than the Fedora "stable" release for Kubernetes that you would get without adding the directive. -* If you want the very latest Kubernetes release [you can download and yum install the RPM directly from Fedora Koji](http://koji.fedoraproject.org/koji/packageinfo?packageID=19202) instead of using the yum install command below. +* The [--enablerepo=updates-testing](https://fedoraproject.org/wiki/QA:Updates_Testing) directive in the dnf command below will ensure that the most recent Kubernetes version that is scheduled for pre-release will be installed. This should be a more recent version than the Fedora "stable" release for Kubernetes that you would get without adding the directive. +* If you want the very latest Kubernetes release [you can download and dnf install the RPM directly from Fedora Koji](http://koji.fedoraproject.org/koji/packageinfo?packageID=19202) instead of using the dnf install command below. * Running on AWS EC2 with RHEL 7.2, you need to enable "extras" repository for yum by editing `/etc/yum.repos.d/redhat-rhui.repo` and changing the changing the `enable=0` to `enable=1` for extras. ```shell -yum -y install --enablerepo=updates-testing kubernetes +dnf -y install --enablerepo=updates-testing kubernetes ``` * Install etcd and iptables ```shell -yum -y install etcd iptables +dnf -y install etcd iptables ``` * Add master and node to /etc/hosts on all machines (not needed if hostnames already in DNS). Make sure that communication works between fed-master and fed-node by using a utility such as ping. diff --git a/docs/getting-started-guides/fedora/flannel_multi_node_cluster.md b/docs/getting-started-guides/fedora/flannel_multi_node_cluster.md index bcd10f57b9..494f7cd343 100644 --- a/docs/getting-started-guides/fedora/flannel_multi_node_cluster.md +++ b/docs/getting-started-guides/fedora/flannel_multi_node_cluster.md @@ -148,7 +148,7 @@ bash-4.3# This will place you inside the container. Install iproute and iputils packages to install ip and ping utilities. Due to a [bug](https://bugzilla.redhat.com/show_bug.cgi?id=1142311), it is required to modify capabilities of ping binary to work around "Operation not permitted" error. ```shell -bash-4.3# yum -y install iproute iputils +bash-4.3# dnf -y install iproute iputils bash-4.3# setcap cap_net_raw-ep /usr/bin/ping ``` From 28b636c466e8ebe1b8693cc86a8d2dedf702f187 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 11 Nov 2016 13:43:01 +0000 Subject: [PATCH 2/8] getting-started: don't use updates-testing repo for Fedora There is no reason to tell people to enable updates-testing repo for Fedora by default. The latest stable packages are already in the main repos and updates-testing should only be used by people wishing to test & report quality of pre-released software, not general Kubnetes users. Also remove the link to Koji builds - any Koji build which is working well enough to user will be submitted as an update. Telling users to install packages straight from Koji will lead to them using potentially unstable / buggy builds. Signed-off-by: Daniel P. Berrange --- docs/getting-started-guides/fedora/fedora_manual_config.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/getting-started-guides/fedora/fedora_manual_config.md b/docs/getting-started-guides/fedora/fedora_manual_config.md index 134ebabff1..20deecf4cc 100644 --- a/docs/getting-started-guides/fedora/fedora_manual_config.md +++ b/docs/getting-started-guides/fedora/fedora_manual_config.md @@ -33,12 +33,10 @@ fed-node = 192.168.121.65 **Prepare the hosts:** * Install Kubernetes on all hosts - fed-{master,node}. This will also pull in docker. Also install etcd on fed-master. This guide has been tested with kubernetes-0.18 and beyond. -* The [--enablerepo=updates-testing](https://fedoraproject.org/wiki/QA:Updates_Testing) directive in the dnf command below will ensure that the most recent Kubernetes version that is scheduled for pre-release will be installed. This should be a more recent version than the Fedora "stable" release for Kubernetes that you would get without adding the directive. -* If you want the very latest Kubernetes release [you can download and dnf install the RPM directly from Fedora Koji](http://koji.fedoraproject.org/koji/packageinfo?packageID=19202) instead of using the dnf install command below. * Running on AWS EC2 with RHEL 7.2, you need to enable "extras" repository for yum by editing `/etc/yum.repos.d/redhat-rhui.repo` and changing the changing the `enable=0` to `enable=1` for extras. ```shell -dnf -y install --enablerepo=updates-testing kubernetes +dnf -y install kubernetes ``` * Install etcd and iptables From d35fdeb503fcba2d02aef7b86123ccf8555070d4 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 11 Nov 2016 14:17:27 +0000 Subject: [PATCH 3/8] getting-started: only list config vars that need changing The KUBE_LOGTOSTDERR, KUBE_LOG_LEVEL and KUBE_ALLOW_PRIV settings will already have correct values out of the box, so no need to tell people to set them. Signed-off-by: Daniel P. Berrange --- .../fedora/fedora_manual_config.md | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/docs/getting-started-guides/fedora/fedora_manual_config.md b/docs/getting-started-guides/fedora/fedora_manual_config.md index 20deecf4cc..0086af1d14 100644 --- a/docs/getting-started-guides/fedora/fedora_manual_config.md +++ b/docs/getting-started-guides/fedora/fedora_manual_config.md @@ -52,20 +52,12 @@ echo "192.168.121.9 fed-master 192.168.121.65 fed-node" >> /etc/hosts ``` -* Edit /etc/kubernetes/config which will be the same on all hosts (master and node) to contain: +* Edit /etc/kubernetes/config (which should be the same on all hosts) to set +the name of the master server: ```shell # Comma separated list of nodes in the etcd cluster KUBE_MASTER="--master=http://fed-master:8080" - -# logging to stderr means we get it in the systemd journal -KUBE_LOGTOSTDERR="--logtostderr=true" - -# journal message level, 0 is debug -KUBE_LOG_LEVEL="--v=0" - -# Should this cluster be allowed to run privileged docker containers -KUBE_ALLOW_PRIV="--allow-privileged=false" ``` * Disable the firewall on both the master and node, as docker does not play well with other firewall rule managers. Please note that iptables-services does not exist on default fedora server install. @@ -93,7 +85,7 @@ KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=10.254.0.0/16" KUBE_API_ARGS="" ``` -* Edit /etc/etcd/etcd.conf,let the etcd to listen all the ip instead of 127.0.0.1, if not, you will get the error like "connection refused". Note that Fedora 22 uses etcd 2.0, One of the changes in etcd 2.0 is that now uses port 2379 and 2380 (as opposed to etcd 0.46 which userd 4001 and 7001). +* Edit /etc/etcd/etcd.conf to let etcd listen on all available IPs instead of 127.0.0.1; If you have not done this, you might see an error such as "connection refused". Note that Fedora 22 uses etcd 2.0, One of the changes in etcd 2.0 is that now uses port 2379 and 2380 (as opposed to etcd 0.46 which userd 4001 and 7001). ```shell ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:4001" From 363052020c483f13a533775266891eb15ffdaf3d Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 11 Nov 2016 14:19:21 +0000 Subject: [PATCH 4/8] getting-started: update to assume port numbers for etcd >= 2.0 The docs still refer to etcd using port 4001, but in all currently released Fedora versions it will be using 2379 Signed-off-by: Daniel P. Berrange --- docs/getting-started-guides/fedora/fedora_manual_config.md | 6 +++--- .../fedora/flannel_multi_node_cluster.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/getting-started-guides/fedora/fedora_manual_config.md b/docs/getting-started-guides/fedora/fedora_manual_config.md index 0086af1d14..52627c9f47 100644 --- a/docs/getting-started-guides/fedora/fedora_manual_config.md +++ b/docs/getting-started-guides/fedora/fedora_manual_config.md @@ -76,7 +76,7 @@ systemctl stop iptables-services firewalld KUBE_API_ADDRESS="--address=0.0.0.0" # Comma separated list of nodes in the etcd cluster -KUBE_ETCD_SERVERS="--etcd-servers=http://127.0.0.1:4001" +KUBE_ETCD_SERVERS="--etcd-servers=http://127.0.0.1:2379" # Address range to use for services KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=10.254.0.0/16" @@ -85,10 +85,10 @@ KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=10.254.0.0/16" KUBE_API_ARGS="" ``` -* Edit /etc/etcd/etcd.conf to let etcd listen on all available IPs instead of 127.0.0.1; If you have not done this, you might see an error such as "connection refused". Note that Fedora 22 uses etcd 2.0, One of the changes in etcd 2.0 is that now uses port 2379 and 2380 (as opposed to etcd 0.46 which userd 4001 and 7001). +* Edit /etc/etcd/etcd.conf to let etcd listen on all available IPs instead of 127.0.0.1; If you have not done this, you might see an error such as "connection refused". ```shell -ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:4001" +ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379" ``` * Create /var/run/kubernetes on master: diff --git a/docs/getting-started-guides/fedora/flannel_multi_node_cluster.md b/docs/getting-started-guides/fedora/flannel_multi_node_cluster.md index 494f7cd343..a7f25b0d14 100644 --- a/docs/getting-started-guides/fedora/flannel_multi_node_cluster.md +++ b/docs/getting-started-guides/fedora/flannel_multi_node_cluster.md @@ -55,7 +55,7 @@ Edit the flannel configuration file /etc/sysconfig/flanneld as follows: # Flanneld configuration options # etcd url location. Point this to the server where etcd runs -FLANNEL_ETCD="http://fed-master:4001" +FLANNEL_ETCD="http://fed-master:2379" # etcd config key. This is the configuration key that flannel queries # For address range assignment @@ -104,7 +104,7 @@ Now check the interfaces on the nodes. Notice there is now a flannel.1 interface From any node in the cluster, check the cluster members by issuing a query to etcd server via curl (only partial output is shown using `grep -E "\{|\}|key|value"`). If you set up a 1 master and 3 nodes cluster, you should see one block for each node showing the subnets they have been assigned. You can associate those subnets to each node by the MAC address (VtepMAC) and IP address (Public IP) that is listed in the output. ```shell -curl -s http://fed-master:4001/v2/keys/coreos.com/network/subnets | python -mjson.tool +curl -s http://fed-master:2379/v2/keys/coreos.com/network/subnets | python -mjson.tool ``` ```json From 0275ca78d048b23d57b5e45a9446c2c759bffa75 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 11 Nov 2016 14:23:07 +0000 Subject: [PATCH 5/8] getting-started: remove note to create /var/run/kubernetes The /var/run/kubernetes directory is already created by installation of the kubernetes RPM with correct user and group ownership and permissions. Signed-off-by: Daniel P. Berrange --- .../getting-started-guides/fedora/fedora_manual_config.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/getting-started-guides/fedora/fedora_manual_config.md b/docs/getting-started-guides/fedora/fedora_manual_config.md index 52627c9f47..7b196a0711 100644 --- a/docs/getting-started-guides/fedora/fedora_manual_config.md +++ b/docs/getting-started-guides/fedora/fedora_manual_config.md @@ -91,14 +91,6 @@ KUBE_API_ARGS="" ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379" ``` -* Create /var/run/kubernetes on master: - -```shell -mkdir /var/run/kubernetes -chown kube:kube /var/run/kubernetes -chmod 750 /var/run/kubernetes -``` - * Start the appropriate services on master: ```shell From 33a83b1221b71835f3fcf4fc73c9503306acd6e7 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 11 Nov 2016 13:49:06 +0000 Subject: [PATCH 6/8] getting-started: remove note about installing iptables on Fedora The install of kubernetes pulls in docker, which has a direct dependancy on iptables. So there is no need to tell people to yum install iptables manually. Signed-off-by: Daniel P. Berrange --- docs/getting-started-guides/fedora/fedora_manual_config.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/getting-started-guides/fedora/fedora_manual_config.md b/docs/getting-started-guides/fedora/fedora_manual_config.md index 7b196a0711..d404aa315c 100644 --- a/docs/getting-started-guides/fedora/fedora_manual_config.md +++ b/docs/getting-started-guides/fedora/fedora_manual_config.md @@ -39,10 +39,10 @@ fed-node = 192.168.121.65 dnf -y install kubernetes ``` -* Install etcd and iptables +* Install etcd ```shell -dnf -y install etcd iptables +dnf -y install etcd ``` * Add master and node to /etc/hosts on all machines (not needed if hostnames already in DNS). Make sure that communication works between fed-master and fed-node by using a utility such as ping. From a6e375a4b1ff5262ff05069884a4a5f1de5ea196 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 11 Nov 2016 15:07:16 +0000 Subject: [PATCH 7/8] getting-started: add instruction to install flannel The Fedora multi-node doc need to tell users to install flannel, since previous setup won't have brought it in. Signed-off-by: Daniel P. Berrange --- .../fedora/flannel_multi_node_cluster.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/getting-started-guides/fedora/flannel_multi_node_cluster.md b/docs/getting-started-guides/fedora/flannel_multi_node_cluster.md index a7f25b0d14..a0a5c80cb4 100644 --- a/docs/getting-started-guides/fedora/flannel_multi_node_cluster.md +++ b/docs/getting-started-guides/fedora/flannel_multi_node_cluster.md @@ -49,6 +49,12 @@ etcdctl get /coreos.com/network/config **Perform following commands on all Kubernetes nodes** +Install the flannel package + +```shell +# dnf -y install flannel +``` + Edit the flannel configuration file /etc/sysconfig/flanneld as follows: ```shell From f891170c92a1ccf1d84ebe2cd83e9a80bc712e7a Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Mon, 21 Nov 2016 15:28:31 +0000 Subject: [PATCH 8/8] getting-started: note that Fedora can use VMs or bare metal Although the Fedora install docs are under the "Bare Metal" section in the docs, the instructions provided work fine for Fedora installs in virtual machines Signed-off-by: Daniel P. Berrange --- docs/getting-started-guides/fedora/fedora_manual_config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started-guides/fedora/fedora_manual_config.md b/docs/getting-started-guides/fedora/fedora_manual_config.md index d404aa315c..d111c7c771 100644 --- a/docs/getting-started-guides/fedora/fedora_manual_config.md +++ b/docs/getting-started-guides/fedora/fedora_manual_config.md @@ -11,7 +11,7 @@ assignees: ## Prerequisites -1. You need 2 or more machines with Fedora installed. +1. You need 2 or more machines with Fedora installed. These can be either bare metal machines or virtual machines. ## Instructions