2016-11-30 21:59:07 +00:00
|
|
|
---
|
2017-01-11 01:55:43 +00:00
|
|
|
title: Networking
|
2018-05-05 16:00:51 +00:00
|
|
|
content_template: templates/task
|
2016-11-30 21:59:07 +00:00
|
|
|
---
|
|
|
|
|
2018-05-05 16:00:51 +00:00
|
|
|
{{% capture overview %}}
|
2017-10-03 00:35:36 +00:00
|
|
|
Kubernetes supports the [Container Network Interface (CNI)](https://github.com/containernetworking/cni).
|
|
|
|
This is a network plugin architecture that allows you to use whatever
|
2018-02-27 18:56:46 +00:00
|
|
|
Kubernetes-friendly SDN you want. Currently this means support for Flannel and Canal.
|
2017-10-03 00:35:36 +00:00
|
|
|
|
2018-02-27 18:56:46 +00:00
|
|
|
This page shows how the various network portions of a cluster work and how to configure them.
|
2018-05-05 16:00:51 +00:00
|
|
|
{{% /capture %}}
|
|
|
|
{{% capture prerequisites %}}
|
2016-11-30 21:59:07 +00:00
|
|
|
This page assumes you have a working Juju deployed cluster.
|
2018-02-27 18:56:46 +00:00
|
|
|
|
2018-05-05 16:00:51 +00:00
|
|
|
{{< note >}}
|
2018-11-06 19:33:04 +00:00
|
|
|
Note that if you deploy a cluster via conjure-up or the CDK bundles, manually deploying CNI plugins is unnecessary.
|
2018-05-05 16:00:51 +00:00
|
|
|
{{< /note >}}
|
|
|
|
{{% /capture %}}
|
2016-11-30 21:59:07 +00:00
|
|
|
|
|
|
|
|
2018-05-05 16:00:51 +00:00
|
|
|
{{% capture steps %}}
|
2018-02-27 18:56:46 +00:00
|
|
|
The CNI charms are [subordinates](https://jujucharms.com/docs/stable/authors-subordinate-applications).
|
|
|
|
These charms will require a principal charm that implements the `kubernetes-cni` interface in order to properly deploy.
|
2016-11-30 21:59:07 +00:00
|
|
|
|
2018-02-27 18:56:46 +00:00
|
|
|
## Flannel
|
2016-11-30 21:59:07 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
juju deploy flannel
|
|
|
|
juju add-relation flannel kubernetes-master
|
2018-02-27 18:56:46 +00:00
|
|
|
juju add-relation flannel kubernetes-worker
|
2016-11-30 21:59:07 +00:00
|
|
|
juju add-relation flannel etcd
|
|
|
|
```
|
|
|
|
|
2018-02-27 18:56:46 +00:00
|
|
|
## Canal
|
|
|
|
|
|
|
|
```
|
|
|
|
juju deploy canal
|
|
|
|
juju add-relation canal kubernetes-master
|
|
|
|
juju add-relation canal kubernetes-worker
|
|
|
|
juju add-relation canal etcd
|
|
|
|
```
|
|
|
|
|
2017-10-03 00:35:36 +00:00
|
|
|
### Configuration
|
2016-11-30 21:59:07 +00:00
|
|
|
|
2018-02-27 18:56:46 +00:00
|
|
|
**iface** The interface to configure the flannel or canal SDN binding. If this value is
|
2016-11-30 21:59:07 +00:00
|
|
|
empty string or undefined the code will attempt to find the default network
|
|
|
|
adapter similar to the following command:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ route | grep default | head -n 1 | awk {'print $8'}
|
|
|
|
```
|
|
|
|
|
2018-02-27 18:56:46 +00:00
|
|
|
**cidr** The network range to configure the flannel or canal SDN to declare when
|
2016-11-30 21:59:07 +00:00
|
|
|
establishing networking setup with etcd. Ensure this network range is not active
|
|
|
|
on layers 2/3 you're deploying to, as it will cause collisions and odd behavior
|
|
|
|
if care is not taken when selecting a good CIDR range to assign to flannel. It's
|
2017-03-01 11:37:30 +00:00
|
|
|
also good practice to ensure you allot yourself a large enough IP range to support
|
2016-11-30 21:59:07 +00:00
|
|
|
how large your cluster will potentially scale. Class A IP ranges with /24 are
|
|
|
|
a good option.
|
2018-05-05 16:00:51 +00:00
|
|
|
{{% /capture %}}
|
|
|
|
|
2016-11-30 21:59:07 +00:00
|
|
|
|