mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-23 05:56:02 -03:30
Calico is not a network overlay
This commit is contained in:
23
roles/network_plugin/templates/calico/calico-node.service.j2
Normal file
23
roles/network_plugin/templates/calico/calico-node.service.j2
Normal file
@@ -0,0 +1,23 @@
|
||||
[Unit]
|
||||
Description=calicoctl node
|
||||
After=etcd2.service
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/etc/network-environment
|
||||
User=root
|
||||
PermissionsStartOnly=true
|
||||
ExecStartPre={{ bin_dir }}/calicoctl checksystem --fix
|
||||
{% if inventory_hostname in groups['kube-node'] %}
|
||||
{% if peer_with_router %}
|
||||
ExecStart={{ bin_dir }}/calicoctl node --ip=${DEFAULT_IPV4} --as={{ local_as }} --kubernetes
|
||||
{% else %}
|
||||
ExecStart={{ bin_dir }}/calicoctl node --ip=${DEFAULT_IPV4} --kubernetes
|
||||
{% endif %}
|
||||
{% else %}
|
||||
ExecStart={{ bin_dir }}/calicoctl node --ip=${DEFAULT_IPV4}
|
||||
{% endif %}
|
||||
RemainAfterExit=yes
|
||||
Type=oneshot
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
19
roles/network_plugin/templates/calico/network-environment.j2
Executable file
19
roles/network_plugin/templates/calico/network-environment.j2
Executable file
@@ -0,0 +1,19 @@
|
||||
#! /usr/bin/bash
|
||||
# This node's IPv4 address
|
||||
CALICO_IPAM=true
|
||||
DEFAULT_IPV4={{ ansible_default_ipv4.address }}
|
||||
|
||||
{% if inventory_hostname in groups['kube-node'] %}
|
||||
# The kubernetes master IP
|
||||
KUBERNETES_MASTER={{ groups['kube-master'][0] }}
|
||||
|
||||
# Location of etcd cluster used by Calico. By default, this uses the etcd
|
||||
# instance running on the Kubernetes Master
|
||||
ETCD_AUTHORITY={{ groups['kube-master'][0] }}:4001
|
||||
|
||||
# The kubernetes-apiserver location - used by the calico plugin
|
||||
KUBE_API_ROOT=http://{{ groups['kube-master'][0] }}:8080/api/v1/
|
||||
|
||||
# Location of the calicoctl binary - used by the calico plugin
|
||||
CALICOCTL_PATH="{{ bin_dir }}/calicoctl"
|
||||
{% endif %}
|
||||
@@ -0,0 +1 @@
|
||||
{ "Network": "{{ kube_service_addresses }}", "SubnetLen": {{ kube_network_node_prefix }}, "Backend": { "Type": "vxlan" } }
|
||||
@@ -0,0 +1 @@
|
||||
FLANNEL_ETCD_PREFIX="--etcd-prefix=/{{ cluster_name }}/network"
|
||||
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=Docker Application Container Engine
|
||||
Documentation=http://docs.docker.com
|
||||
After=network.target docker.socket flannel.service
|
||||
Requires=docker.socket
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/run/flannel/subnet.env
|
||||
EnvironmentFile=-/etc/default/docker
|
||||
ExecStart=/usr/bin/docker -d -H fd:// --bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU} $DOCKER_OPTS
|
||||
MountFlags=slave
|
||||
LimitNOFILE=1048576
|
||||
LimitNPROC=1048576
|
||||
LimitCORE=infinity
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Flannel Network Overlay
|
||||
Documentation=https://coreos.com/flannel/docs/latest
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/etc/network-environment
|
||||
ExecStart={{ bin_dir }}/flanneld \
|
||||
$FLANNEL_ETCD_PREFIX
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user