|
| 1 | +--- |
| 2 | +title: Install a CNI plugin |
| 3 | +description: Learn how to install a Container Networking Interface plugin on Docker Universal Control Plane. |
| 4 | +keywords: ucp, cli, administration, kubectl, Kubernetes, cni, Container Networking Interface, flannel, weave |
| 5 | +ui_tabs: |
| 6 | +- version: ucp-3.0 |
| 7 | + orhigher: false |
| 8 | +next_steps: |
| 9 | +- path: ../admin/install/ |
| 10 | + title: Install UCP for production |
| 11 | +- path: ../kubernetes/ |
| 12 | + title: Deploy a workload to a Kubernetes cluster |
| 13 | +--- |
| 14 | + |
| 15 | +{% if include.version=="ucp-3.0" %} |
| 16 | + |
| 17 | +With Docker Universal Control Plane, you can install a third-party Container |
| 18 | +Networking Interface (CNI) plugin when you install UCP, by using the |
| 19 | +`--cni-installer-url` option. By default, Docker EE installs the built-in |
| 20 | +[Calico](https://github.com/projectcalico/cni-plugin) plugin, but you can |
| 21 | +override the default and install a plugin of your choice, |
| 22 | +like [Flannel](https://github.com/coreos/flannel) or |
| 23 | +[Weave](https://www.weave.works/). |
| 24 | + |
| 25 | +# Install UCP with a custom CNI plugin |
| 26 | + |
| 27 | +Modify the [UCP install command-line](../admin/install/index.md#step-4-install-ucp) |
| 28 | +to add the `--cni-installer-url` [option](/reference/ucp/3.0/cli/install.md), |
| 29 | +providing a URL for the location of the CNI plugin's YAML file: |
| 30 | + |
| 31 | +```bash |
| 32 | +docker container run --rm -it --name ucp \ |
| 33 | + -v /var/run/docker.sock:/var/run/docker.sock \ |
| 34 | + {{ page.ucp_org }}/{{ page.ucp_repo }}:{{ page.ucp_version }} install \ |
| 35 | + --host-address <node-ip-address> \ |
| 36 | + --cni-installer-url <cni-yaml-url> \ |
| 37 | + --interactive |
| 38 | +``` |
| 39 | + |
| 40 | +You must provide a correct YAML installation file for the CNI plugin, but most |
| 41 | +of the default files work on Docker EE with no modification. |
| 42 | + |
| 43 | +## YAML files for CNI plugins |
| 44 | + |
| 45 | +Use the following commands to get the YAML files for popular CNI plugins. |
| 46 | + |
| 47 | +- [Flannel](https://github.com/coreos/flannel) |
| 48 | + ```bash |
| 49 | + # Get the URL for the Flannel CNI plugin. |
| 50 | + CNI_URL="https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml" |
| 51 | + ``` |
| 52 | +- [Weave](https://www.weave.works/) |
| 53 | + ```bash |
| 54 | + # Get the URL for the Weave CNI plugin. |
| 55 | + CNI_URL="https://cloud.weave.works/k8s/net?k8s-version=Q2xpZW50IFZlcnNpb246IHZlcnNpb24uSW5mb3tNYWpvcjoiMSIsIE1pbm9yOiI5IiwgR2l0VmVyc2lvbjoidjEuOS4zIiwgR2l0Q29tbWl0OiJkMjgzNTQxNjU0NGYyOThjOTE5ZTJlYWQzYmUzZDA4NjRiNTIzMjNiIiwgR2l0VHJlZVN0YXRlOiJjbGVhbiIsIEJ1aWxkRGF0ZToiMjAxOC0wMi0wN1QxMjoyMjoyMVoiLCBHb1ZlcnNpb246ImdvMS45LjIiLCBDb21waWxlcjoiZ2MiLCBQbGF0Zm9ybToibGludXgvYW1kNjQifQpTZXJ2ZXIgVmVyc2lvbjogdmVyc2lvbi5JbmZve01ham9yOiIxIiwgTWlub3I6IjgrIiwgR2l0VmVyc2lvbjoidjEuOC4yLWRvY2tlci4xNDMrYWYwODAwNzk1OWUyY2UiLCBHaXRDb21taXQ6ImFmMDgwMDc5NTllMmNlYWUxMTZiMDk4ZWNhYTYyNGI0YjI0MjBkODgiLCBHaXRUcmVlU3RhdGU6ImNsZWFuIiwgQnVpbGREYXRlOiIyMDE4LTAyLTAxVDIzOjI2OjE3WiIsIEdvVmVyc2lvbjoiZ28xLjguMyIsIENvbXBpbGVyOiJnYyIsIFBsYXRmb3JtOiJsaW51eC9hbWQ2NCJ9Cg==" |
| 56 | + ``` |
| 57 | + If you have kubectl available, for example by using |
| 58 | + [Docker for Mac](/docker-for-mac/kubernetes.md), you can use the following |
| 59 | + command to get the URL for the [Weave](https://www.weave.works/) CNI plugin: |
| 60 | + ```bash |
| 61 | + # Get the URL for the Weave CNI plugin. |
| 62 | + CNI_URL="https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')" |
| 63 | + ``` |
| 64 | +- [Romana](http://docs.romana.io/) |
| 65 | + ```bash |
| 66 | + # Get the URL for the Romana CNI plugin. |
| 67 | + CNI_URL="https://raw.githubusercontent.com/romana/romana/master/docs/kubernetes/romana-kubeadm.yml" |
| 68 | + ``` |
| 69 | + |
| 70 | +{% endif %} |
0 commit comments