diff --git a/common/logging.go b/common/logging.go index ffa01db6..fc46904c 100644 --- a/common/logging.go +++ b/common/logging.go @@ -54,6 +54,12 @@ func SetLogLevel(levelname string) { Log.Level = level } +func CheckError(e error) { + if e != nil { + Log.Error(e) + } +} + func CheckFatal(e error) { if e != nil { Log.Fatal(e) diff --git a/prog/weave-npc/main.go b/prog/weave-npc/main.go index d5231b7e..9ac6f778 100644 --- a/prog/weave-npc/main.go +++ b/prog/weave-npc/main.go @@ -34,7 +34,9 @@ var ( bridgePortName string ) -func handleError(err error) { common.CheckFatal(err) } +func handleError(err error) { common.CheckError(err) } + +func handleFatal(err error) { common.CheckFatal(err) } func makeController(getter cache.Getter, resource string, objType runtime.Object, handlers cache.ResourceEventHandlerFuncs) cache.Controller { @@ -240,19 +242,19 @@ func root(cmd *cobra.Command, args []string) { } config, err := rest.InClusterConfig() - handleError(err) + handleFatal(err) client, err := kubernetes.NewForConfig(config) - handleError(err) + handleFatal(err) ipt, err := iptables.New() - handleError(err) + handleFatal(err) ips := ipset.New(common.LogLogger(), maxList) - handleError(resetIPTables(ipt)) - handleError(resetIPSets(ips)) - handleError(createBaseRules(ipt, ips)) + handleFatal(resetIPTables(ipt)) + handleFatal(resetIPSets(ips)) + handleFatal(createBaseRules(ipt, ips)) npc := npc.New(nodeName, ipt, ips, client) @@ -339,5 +341,5 @@ func main() { rootCmd.PersistentFlags().IntVar(&maxList, "max-list-size", 1024, "maximum size of ipset list (for namespaces)") rootCmd.PersistentFlags().StringVar(&bridgePortName, "bridge-port-name", "vethwe-bridge", "name of the brige port on which packets are received and sent") - handleError(rootCmd.Execute()) + handleFatal(rootCmd.Execute()) } diff --git a/site/kubernetes/kube-addon.md b/site/kubernetes/kube-addon.md index 5c6a5dd5..dd19c9e5 100644 --- a/site/kubernetes/kube-addon.md +++ b/site/kubernetes/kube-addon.md @@ -7,6 +7,8 @@ search_type: Documentation The following topics are discussed: * [Installation](#install) + * [Installing on GKE](#gke) + * [Installing on EKS](#eks) * [Upgrading the Daemon Sets](#daemon-sets) * [CPU and Memory Requirements](#resources) * [Pod Eviction](#eviction) @@ -71,10 +73,26 @@ Shut down Kubernetes, and _on all nodes_ perform the following: Then relaunch Kubernetes and install the addon as described above. -**Note:** Installing on GKE +### Installing on GKE Please note that you must grant the user the ability to create roles in Kubernetes before launching Weave Net. This is a prerequisite to use use role-based access control on GKE. Please see the GKE [instructions](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control). +### Installing on EKS + +EKS by default installs `amazon-vpc-cni-k8s` CNI. Please follow below steps to use Weave-net as CNI + +- create EKS cluster in any of [prescribed](https://docs.aws.amazon.com/eks/latest/userguide/create-cluster.html) way +- delete `amazon-vpc-cni-k8s` deamonset by running `kubectl delete ds aws-node -n kube-system` command +- delete `/etc/cni/net.d/10-aws.conflist` on each of the node +- edit instance security group to allow TCP 6783 and UDP 6783/6784 ports +- flush iptables nat, mangle, filter tables to clear any iptables configurations done by `amazon-vpc-cni-k8s` +- restart kube-proxy pods to reconfigure iptables +- apply weave-net daemoset by following above installation steps +- delete existing pods so they get recreated in Weave pod CIDR's address-space. + +Please note that while pods can connect to the Kubernetes API server for your cluser, API server will not be able to connect to the pods as API server nodes are not connected to Weave Net (they run on network managed by EKS). + + ### Upgrading the Daemon Sets The DaemonSet definition specifies [Rolling