Skip to content

Commit

Permalink
Replace ETCD_AUTHORITY with ETCD_ENDPOINTS
Browse files Browse the repository at this point in the history
  • Loading branch information
caseydavenport committed Nov 4, 2016
1 parent 0cfe509 commit 3436f09
Show file tree
Hide file tree
Showing 28 changed files with 55 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ write_files:
mkdir -p /opt/bin
rm /home/core/.bashrc
echo 'PATH=$PATH:/opt/bin' > /home/core/.bashrc
echo 'export ETCD_AUTHORITY="$private_ipv4:2379"' >> /home/core/.bashrc
echo 'Defaults env_keep +="ETCD_AUTHORITY"' >>/etc/sudoers.d/etcd
echo 'export ETCD_ENDPOINTS="http://$private_ipv4:2379"' >> /home/core/.bashrc
echo 'Defaults env_keep +="ETCD_ENDPOINTS"' >>/etc/sudoers.d/etcd
- path: /home/core/get_calicoctl.sh
permissions: 777
owner: root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ write_files:
mkdir -p /opt/bin
rm /home/core/.bashrc
echo 'PATH=$PATH:/opt/bin' > /home/core/.bashrc
echo 'export ETCD_AUTHORITY="172.17.8.101:2379"' >> /home/core/.bashrc
echo 'Defaults env_keep +="ETCD_AUTHORITY"' >>/etc/sudoers.d/etcd
echo 'export ETCD_ENDPOINTS="http://172.17.8.101:2379"' >> /home/core/.bashrc
echo 'Defaults env_keep +="ETCD_ENDPOINTS"' >>/etc/sudoers.d/etcd
- path: /home/core/get_calicoctl.sh
permissions: 777
owner: root
Expand Down
2 changes: 1 addition & 1 deletion master/getting-started/docker/installation/gce.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ example ETCD environment variables will exist.

```shell
$ sudo -u core -i
$ env | grep ETCD_AUTHORITY
$ env | grep ETCD_ENDPOINTS
```

Now that your environment is configured, you are ready to follow the [Calico with Docker networking walkthrough]({{site.baseurl}}/{{page.version}}/getting-started/docker/tutorials/basic) worked example.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ help. Remember to shut down the VMs with `vagrant halt` before you reboot.

You should also verify each host can access etcd. The following will return an error if etcd is not available.

curl -L http://$ETCD_AUTHORITY/version
curl -L http://172.18.18.101/version

And finally check that Docker is running on both hosts by running

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ Vagrant.configure(2) do |config|

host.vm.provision :shell, inline: "chmod +x /usr/local/bin/calicoctl"

# Ensure the vagrant and root users get the ETCD_AUTHORITY environment.
host.vm.provision :shell, inline: %Q|echo 'export ETCD_AUTHORITY="#{primary_ip}:2379"' >> /home/vagrant/.profile|
host.vm.provision :shell, inline: %Q|sudo sh -c 'echo "Defaults env_keep +=\"ETCD_AUTHORITY\"" >>/etc/sudoers'|
# Ensure the vagrant and root users get the ETCD_ENDPOINTS environment.
host.vm.provision :shell, inline: %Q|echo 'export ETCD_ENDPOINTS="http://#{primary_ip}:2379"' >> /home/vagrant/.profile|
host.vm.provision :shell, inline: %Q|sudo sh -c 'echo "Defaults env_keep +=\"ETCD_ENDPOINTS\"" >>/etc/sudoers'|
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ help. Remember to shut down the VMs with `vagrant halt` before you reboot.

You should also verify each host can access etcd. The following will return an error if etcd is not available.

curl -L http://$ETCD_AUTHORITY/version
curl -L http://172.18.18.101/version

And finally check that Docker is running on both hosts by running

Expand Down
2 changes: 1 addition & 1 deletion master/getting-started/docker/tutorials/docker-swarm.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Now that etcd is running, we can run Calico.

Now, start the Calico node service on each node in the cluster.

$ sudo ETCD_AUTHORITY=$MANAGER_IP:2379 calicoctl node --libnetwork --ip=$NODE_IP
$ sudo ETCD_ENDPOINTS=http://$MANAGER_IP:2379 calicoctl node --libnetwork --ip=$NODE_IP

## 4. Configure Swarm Cluster

Expand Down
2 changes: 1 addition & 1 deletion master/getting-started/mesos/demos/docker/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ is to only allow inbound traffic from nodes with the same profile
Let's view the rules for the `management-ui` network's profile by running the
`calicoctl profile <profile> rule show` command:

$ export ETCD_AUTHORITY=172.24.197.101:2379
$ export ETCD_ENDPOINTS=http://172.24.197.101:2379
$ calicoctl profile management-ui rule show

Inbound rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ can perform the Framework Installation steps manually (etcd, docker cluster-stor
"ipam": {
"type": "calico-ipam"
},
"etcd_authority": "m1.dcos:2379"
"etcd_endpoints": "http://m1.dcos:2379"
}
```
Expand Down
4 changes: 2 additions & 2 deletions master/getting-started/mesos/installation/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ For test environments that you would like to get up and running
quickly, you can launch the container with `calicoctl`:

```shell
sudo ETCD_AUTHORITY=<ETCD HOST:PORT> ./calicoctl node --libnetwork
sudo ETCD_ENDPOINTS=http://<ETCD HOST:PORT> ./calicoctl node --libnetwork
```

Again, be sure to set the ETCD_AUTHORITY to the correct `IP/Hostname:Port` for your etcd cluster.
Again, be sure to set the ETCD_ENDPOINTS to the correct value for your etcd cluster.

3. Ensure calico's services are running by checking for the Calico container in Docker:

Expand Down
5 changes: 2 additions & 3 deletions master/getting-started/mesos/installation/unified.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ we must provide the location of the running etcd instance
by setting the `ECTD_AUTHORITY` environment variable.

```shell
curl -L -O \
https://github.com/projectcalico/calico-containers/releases/download/v0.18.0/calicoctl
curl -L -O https://github.com/projectcalico/calico-containers/releases/download/v0.18.0/calicoctl
chmod +x ./calicoctl
sudo ETCD_AUTHORITY=<etcd-ip:port> ./calicoctl node
sudo ETCD_ENDPOINTS=http://<etcd-ip:port> ./calicoctl node
```

## Next Steps
Expand Down
2 changes: 1 addition & 1 deletion master/getting-started/mesos/tutorials/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Be sure to replace `<etcd-ip:port>` with the address and port at which etcd
is listening.

```shell
$ export ETCD_AUTHORITY=<etcd-ip:port>
$ export ETCD_ENDPOINTS=http://<etcd-ip:port>
$ calicoctl profile my-calico-net rule show
Inbound rules:
1 allow from tag my-calico-net
Expand Down
2 changes: 1 addition & 1 deletion master/getting-started/mesos/tutorials/unified.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cat <<EOF > $NETWORK_CNI_CONFIG_DIR/calico-net-1.conf
"ipam": {
"type": "calico-ipam"
},
"etcd_authority": "<etcd-ip:port>:2379"
"etcd_endpoints": "http://<etcd-ip:port>:2379"
}
EOF
```
Expand Down
3 changes: 1 addition & 2 deletions master/getting-started/mesos/vagrant/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ calico_node_ver = "latest"
# Script to write out the Calico environment file.
$write_calico_env=<<SCRIPT
cat <<EOF > /etc/sysconfig/calico
ETCD_AUTHORITY=${1}:2379
ETCD_SCHEME=http
ETCD_ENDPOINTS=http://${1}:2379
ETCD_CA_FILE=""
ETCD_CERT_FILE=""
ETCD_KEY_FILE=""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[Service]
EnvironmentFile=/etc/sysconfig/calico
ExecStart=
ExecStart=/usr/bin/dockerd --cluster-store=etcd://${ETCD_AUTHORITY}
ExecStart=/usr/bin/dockerd --cluster-store=etcd://172.18.18.101:2379
4 changes: 2 additions & 2 deletions master/getting-started/rkt/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ It is recommended to use systemd to run the `calico/node` container in productio
### 1. Configure environment variables
To use this unit file, first open `calico-node.service` and fill in the following environment variables to match your system:

- `ETCD_AUTHORITY`: The ip:port of your etcd cluster.
- `FELIX_ETCDADDR`: The ip:port of your etcd cluster.
- `ETCD_ENDPOINTS`: A comma separated list etcd cluster endpoints.
- `FELIX_ETCDENDPOINTS`: A comma separated list etcd cluster endpoints.
- `IP`: The IPv4 address of this node.
- `IP6`: The IPv6 address of this node if one exists. Otherwise, leave this blank.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ Slice=machine.slice
Delegate=true
CPUShares=512
MemoryLimit=1G
Environment="ETCD_AUTHORITY=127.0.0.1:2379"
Environment="FELIX_ETCDADDR=127.0.0.1:2379"
Environment="FELIX_ETCDSCHEME=http"
Environment="ETCD_ENDPOINTS=http://127.0.0.1:2379"
Environment="FELIX_ETCDENDPOINTS=http://127.0.0.1:2379"
Environment="IP=<LOCAL_IPV4>"
Environment="IP6=<LOCAL_IPV6>"
ExecStart=/usr/bin/rkt run --inherit-env --stage1-image=/usr/share/rkt/stage1-fly.aci --insecure-options=image --volume=birdctl,kind=host,source=/var/run/calico,readOnly=false --mount volume=birdctl,target=/var/run/calico docker://calico/node
Expand Down
25 changes: 9 additions & 16 deletions master/reference/advanced/etcd-secure.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,17 @@ Calico supports insecure and TLS/certificate-enabled etcd clusters.
To use TLS-enabled etcd, the following environment variables need to be set
before running any `calicoctl` command:

* **`ETCD_AUTHORITY`**: The `<hostname>:<port_number>` pair representing the
access point to the cluster. **Default**: 127.0.0.1:2379
* NOTE: When running Etcd with TLS enabled, the address of the ETCD_AUTHORITY
must be a hostname value, NOT an IP address, such as `etcd-host:2379`.
* **`ETCD_SCHEME`**: The http or https protocol used by the etcd datastore.
**Default**: http
* **`ETCD_CA_CERT_FILE`**: The full path to the CA certificate file for the
Certificate Authority that signed the etcd server key/certificate pair.
* **`ETCD_CERT_FILE`**: The full path to the client certificate file for
accessing the etcd cluster.
* **`ETCD_KEY_FILE`**: The full path to the client key file for accessing the
etcd cluster.
Variable | Description | Default
----------------------|-----------------------------------|------------------------------
ETCD_ENDPOINTS | A comma-separated list of etcd cluster endpoints | http://127.0.0.1:2379
ETCD_CA_CERT_FILE | The full path to the CA certificate file for the Certificate Authority that signed the etcd server key/certificate pair. | None
ETCD_CERT_FILE | The full path to the client certificate file for accessing the etcd cluster. | None
ETCD_KEY_FILE | The full path to the client key file for accessing the etcd cluster. | None

For example:

```shell
export ETCD_AUTHORITY=hostname:2379
export ETCD_SCHEME=https
export ETCD_ENDPOINTS=http://hostname:2379
export ETCD_CA_CERT_FILE=/path/to/ca.pem
export ETCD_CERT_FILE=/path/to/server.pem
export ETCD_KEY_FILE=/path/to/server-key.pem
Expand Down Expand Up @@ -61,9 +54,9 @@ be passed into the Calico command.
For example, to run `calicoctl node`, you would call something like this:

```shell
sudo ETCD_SCHEME=https ETCD_KEY_FILE=/path/to/client.key \
sudo ETCD_KEY_FILE=/path/to/client.key \
ETCD_CA_CERT_FILE=/path/to/ca.crt ETCD_CERT_FILE=/path/to/client.crt \
ETCD_AUTHORITY=hostname:2379 calicoctl node
ETCD_ENDPOINTS=http://hostname:2379 calicoctl node
```

Alternatively, if you have previously defined/exported your environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ write_files:
mkdir -p /opt/bin
rm /home/core/.bashrc
echo 'PATH=/opt/bin:$PATH' > /home/core/.bashrc
echo 'export ETCD_AUTHORITY="$private_ipv4:2379"' >> /home/core/.bashrc
echo 'Defaults env_keep +="ETCD_AUTHORITY"' >>/etc/sudoers.d/etcd
echo 'export ETCD_ENDPOINTS="http://$private_ipv4:2379"' >> /home/core/.bashrc
echo 'Defaults env_keep +="ETCD_ENDPOINTS"' >>/etc/sudoers.d/etcd
- path: /home/core/get_calicoctl.sh
permissions: 777
owner: root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ write_files:
mkdir -p /opt/bin
rm /home/core/.bashrc
echo 'PATH=/opt/bin:$PATH' > /home/core/.bashrc
echo 'export ETCD_AUTHORITY="172.17.8.101:2379"' >> /home/core/.bashrc
echo 'Defaults env_keep +="ETCD_AUTHORITY"' >>/etc/sudoers.d/etcd
echo 'export ETCD_ENDPOINTS="http://172.17.8.101:2379"' >> /home/core/.bashrc
echo 'Defaults env_keep +="ETCD_ENDPOINTS"' >>/etc/sudoers.d/etcd
- path: /home/core/get_calicoctl.sh
permissions: 777
owner: root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ example ETCD environment variables will exist.

```shell
$ sudo -u core -i
$ env | grep ETCD_AUTHORITY
$ env | grep ETCD_ENDPOINTS
```

Now that your environment is configured, you are ready to follow the [Calico without Docker networking walkthrough]({{site.baseurl}}/{{page.version}}/reference/without-docker-networking/installation) worked example.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ help. Remember to shut down the VMs with `vagrant halt` before you reboot.

You should also verify each host can access etcd. The following will return an error if etcd is not available.

curl -L http://$ETCD_AUTHORITY/version
curl -L http://172.18.18.101:2379/version

And finally check that Docker is running on both hosts by running

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ Vagrant.configure(2) do |config|
end
end

# Ensure the vagrant and root users get the ETCD_AUTHORITY environment.
host.vm.provision :shell, inline: %Q|echo 'export ETCD_AUTHORITY="#{primary_ip}:2379"' >> /home/vagrant/.profile|
host.vm.provision :shell, inline: %Q|sudo sh -c 'echo "Defaults env_keep +=\"ETCD_AUTHORITY\"" >>/etc/sudoers'|
# Ensure the vagrant and root users get the ETCD_ENDPOINTS environment.
host.vm.provision :shell, inline: %Q|echo 'export ETCD_ENDPOINTS="http://#{primary_ip}:2379"' >> /home/vagrant/.profile|
host.vm.provision :shell, inline: %Q|sudo sh -c 'echo "Defaults env_keep +=\"ETCD_ENDPOINTS\"" >>/etc/sudoers'|
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ help. Remember to shut down the VMs with `vagrant halt` before you reboot.

You should also verify each host can access etcd. The following will return an error if etcd is not available.

curl -L http://$ETCD_AUTHORITY/version
curl -L http://172.18.18.101:2379/version

And finally check that Docker is running on both hosts by running

Expand Down
18 changes: 8 additions & 10 deletions master/usage/configuration/as-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ environment file and starts the Calico node image as a service.
`calico.env` - the EnvironmentFile:

```shell
ETCD_AUTHORITY=localhost:2379
ETCD_SCHEME=http
ETCD_ENDPOINTS=http://localhost:2379
ETCD_CA_FILE=""
ETCD_CERT_FILE=""
ETCD_KEY_FILE=""
Expand All @@ -30,24 +29,24 @@ CALICO_LIBNETWORK_ENABLED=true
CALICO_NETWORKING_BACKEND=bird
```

Be sure to update this environment file as necessary, such as modifying the
ETCD_AUTHORITY value to point at the correct instance of Etcd.
Be sure to update this environment file as necessary, such as modifying
ETCD_ENDPOINTS to point at the correct etcd cluster endpoints.

> Note: The ETCD_SCHEME, ETCD_CA_FILE, ETCD_CERT_FILE, and ETCD_KEY_FILE
> Note: The ETCD_CA_FILE, ETCD_CERT_FILE, and ETCD_KEY_FILE
> environment variables are required when using Etcd with SSL/TLS. The values
> here are standard values for a non-SSL version of Etcd, but you can use this
> template to define your SSL values if desired. For more details about running
> Calico with Etcd using SSL/TLS, check out the
> [Etcd Secure Cluster guide]({{site.baseurl}}/{{page.version}}/reference/advanced/etcd-secure).
>
> If the CALICO_HOSTNAME is blank, the compute server hostname will be used
> If CALICO_HOSTNAME is blank, the compute server hostname will be used
> to identify the Calico node.
>
> If CALICO_IP and CALICO_IP6 are left blank, the next hop IP addresses for
> If CALICO_IP or CALICO_IP6 are left blank, the next hop IP addresses for
> this node will be automatically determined by querying the host interfaces.
> It may be necessary to explicitly set these values.
>
> If the CALICO_AS is left blank, the AS Number for the node BGP client will be
> If CALICO_AS is left blank, the AS Number for the node BGP client will be
> inherited from the global defaut value. Set this if you need to explicitly
> set the AS Number for this node.
>
Expand Down Expand Up @@ -81,8 +80,7 @@ ExecStart=/usr/bin/docker run --net=host --privileged \
-e AS=${CALICO_AS} \
-e NO_DEFAULT_POOLS=${CALICO_NO_DEFAULT_POOLS} \
-e CALICO_LIBNETWORK_ENABLED=${CALICO_LIBNETWORK_ENABLED} \
-e ETCD_AUTHORITY=${ETCD_AUTHORITY} \
-e ETCD_SCHEME=${ETCD_SCHEME} \
-e ETCD_ENDPOINTS=${ETCD_ENDPOINTS} \
-e ETCD_CA_CERT_FILE=${ETCD_CA_CERT_FILE} \
-e ETCD_CERT_FILE=${ETCD_CERT_FILE} \
-e ETCD_KEY_FILE=${ETCD_KEY_FILE} \
Expand Down
2 changes: 1 addition & 1 deletion master/usage/troubleshooting/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ the `-E` flag to include your environment variables:
or you can set environment variables for `sudo` commands like this:

```shell
sudo ETCD_AUTHORITY=172.25.0.1:2379 calicoctl node
sudo ETCD_ENDPOINTS=http://172.25.0.1:2379 calicoctl node
```

## Ubuntu (or GNOME) NetworkManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"ipam": {
"type": "calico-ipam"
},
"etcd_authority": "etcd:2379",
"etcd_endpoints": "http://etcd:2379",
"log_level": "DEBUG",
"log_level_stderr": "DEBUG"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ IP=`ip addr | grep 'global eth0' | awk '{print $2}' | cut -f1 -d'/'`
ETCD_IP=`getent hosts etcd | awk '{ print $2 }'`
while ! docker ps; do sleep 1; done
docker load -i /images/calico-node-*.tar
export ETCD_AUTHORITY=$ETCD_IP:2379
export ETCD_ENDPOINTS=http://$ETCD_IP:2379
exec 2>&1
exec calicoctl node --ip=$IP --detach=false

0 comments on commit 3436f09

Please sign in to comment.