From a478a2dc71d6ad54ff53dd3ca74fe79c199a8c71 Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Sat, 3 Jun 2017 07:13:25 +0530 Subject: [PATCH] Documentation for deploying Kube-router with KOPS Done as part of #13. Still PR need to merged in upstream KOPS --- Documentation/README.md | 1 + Documentation/kops.md | 52 +++++++++++++++++++++++++++++++++++++++++ README.md | 10 ++++---- 3 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 Documentation/kops.md diff --git a/Documentation/README.md b/Documentation/README.md index 2c69eabb59..75dd75fbe0 100644 --- a/Documentation/README.md +++ b/Documentation/README.md @@ -4,3 +4,4 @@ - [General Setup](/README.md#getting-started) - [Bootkube Deployment](bootkube.md) +- [Kops deployment](kops.md) diff --git a/Documentation/kops.md b/Documentation/kops.md new file mode 100644 index 0000000000..d4526ca19d --- /dev/null +++ b/Documentation/kops.md @@ -0,0 +1,52 @@ +# Kops Integration + +The following instructions and examples demonstrate how to create a new [Kops](https://github.com/kubernetes/kops/) provisioned Kubernetes cluster using kube-router. Kube-router will provide an IPVS based service proxy (replacing kube-proxy), a network policy enforcer and also provides pod-to-pod networking. + + +We are working to get the Kube-router support in Kops thorugh [#2606](https://github.com/kubernetes/kops/issues/2606). Till we get the support in upstream kops, you can use patched kops. Following instruction will walk through setting up cluster with patche kops + + +## Instructions + +- Please download the [Linux](https://s3.amazonaws.com/nodeupbkt/kops/1.6.0/linux/amd64/kops) or [Mac](https://s3.amazonaws.com/nodeupbkt/kops/1.6.0/darwin/amd64/kops) version of KOPS. + +- Please run `kops create cluster --help` to see the support for kube-router in `--networking` flag. You should see as below + +``` +--networking string Networking mode to use. kubenet (default), classic, external, kopeio-vxlan (or kopeio), weave, flannel, calico, canal, kube-router. (default "kubenet") +``` + +- Please export KOPS_BASE_URL as environment variable `export KOPS_BASE_URL=https://nodeupbkt.s3.amazonaws.com/kops/1.6.0/` this will make kops to use patche protokube and nodeup with support for Kube-router + +- Now you can deploy cluster with `--networking` flag set to `kube-router`. For e.g as shown below, all kops functionality remains same, so you configure rest of the param as you need. + +``` +kops create cluster \ + --node-count 2 \ + --zones us-west-2a \ + --master-zones us-west-2a \ + --dns-zone aws.cloudnativelabs.net \ + --node-size t2.medium \ + --master-size t2.medium \ + --networking kube-router \ + mycluster.aws.cloudnativelabs.net +``` + +- Now provision cluster + +``` +kops update cluster mycluster.aws.cloudnativelabs.net --yes +``` + +- It would take couple of minutes to provision cluster. Once cluster is provisioned please veriy kube-router running on each node `kubectl get pods --all-namespaces` + +- At this point your cluster control plane is setup. One last is step is needed for pod connectivity. Since kube-router used host based routing, AWS instances will send and recieve traffic from IP in the pod CIDR range. AWS by default drops packets destined to instance and from instances with IP not in subnet range. So we will need to perform disable source and desintation check on each instance by running below command + +``` +aws ec2 modify-instance-attribute --instance-id --no-source-dest-check +``` + +At this point your cluster is ready to deploy pods, services, network policies etc. Please report if you face any issue. + + + diff --git a/README.md b/README.md index 4fb41fb066..f0eb225db8 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,12 @@ Alternatively you can download the prebuilt binary from https://github.com/cloud --peer-router The ip address of the external router to which all nodes will peer and advertise the cluster ip and pod cidr's ``` +### Try Kube-router with cluster installers + +Please see the [steps](https://github.com/cloudnativelabs/kube-router/blob/master/Documentation/kops.md) to deploy Kubernetes cluster with Kube-router using [Kops](https://github.com/kubernetes/kops) + +Please see the [steps](https://github.com/cloudnativelabs/kube-router/tree/master/contrib/bootkube) to deploy Kubernetes cluster with Kube-router using [bootkube](https://github.com/kubernetes-incubator/bootkube) + ### deployment Depending on what functionality of kube-router you want to use, multiple deployment options are possible. You can use the flags `--run-firewall`, `--run-router`, `--run-service-proxy` to selectively enable only required functionality of kube-router. @@ -108,10 +114,6 @@ and if you want to move back to kube-proxy then clean up config done by kube-rou ``` and run kube-proxy with the configuration you have. -### Kube-router with cluster installers - -Please see the [steps](https://github.com/cloudnativelabs/kube-router/tree/master/contrib/bootkube) to deploy Kubernetes cluster with Kube-router using bootkube - ## Theory of Operation Kube-router can be run as a agent or a pod (through daemonset) on each node and leverages standard Linux technologies **iptables, ipvs/lvs, ipset, iproute2**