Skip to content

Commit

Permalink
Detect docker daemon configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
justinrlee committed May 21, 2018
1 parent afa4e45 commit 8064f69
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion calico-secure/v03/1a-env.export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ export CALICO_NODE_CERTS_DIR=/etc/calico/certs/node
export CALICO_CALICOCTL_CERTS_DIR=/etc/calico/certs/calicoctl
export CALICO_CNI_CERTS_DIR=/etc/calico/certs/cni
EOF
EOF
2 changes: 1 addition & 1 deletion calico-secure/v03/1b-prereqs-certs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ sudo ./bootstrap-certs.py calico ${CALICO_CNI_CERTS_DIR}
sudo curl -kL https://master.mesos/ca/dcos-ca.crt -o ${CALICO_CNI_CERTS_DIR}/dcos-ca.crt

## Other misc. directories
sudo mkdir -p ${ETCD_DATA_DIR}
sudo mkdir -p ${ETCD_DATA_DIR}
6 changes: 4 additions & 2 deletions calico-secure/v03/3-enable-masters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ sudo ETCDCTL_API=2 /opt/etcd/etcdctl \
####### Docker cluster store
# Get docker to pick up the new config
# !!! If this fails, you may have to remove the 'overlay' line from /etc/docker/daemon.json - it doesn't like redundant configurations
# sudo sed -i "/storage-driver/d" /etc/docker/daemon.json
if [[ $(systemctl cat docker | grep 'storage-driver=overlay' | wc -l) -eq 1 ]]; then
sudo sed -i "/storage-driver/d" /etc/docker/daemon.json
fi
sudo systemctl restart docker

# Validate
Expand All @@ -41,4 +43,4 @@ sudo systemctl restart dcos-calico-node.timer

# Check status
sleep 5
sudo calicoctl node status
sudo calicoctl node status
5 changes: 4 additions & 1 deletion calico-secure/v03/4-set-up-pool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ sudo calicoctl get ipps -o json | sudo tee /etc/calico/ippool-backup.json
sudo calicoctl delete ipps 192.168.0.0/16
sudo calicoctl apply -f /etc/calico/ippool.json

sudo calicoctl get ipps -o json
sudo calicoctl get ipps -o json

### Set up Docker network
docker network create --driver calico --ipam-driver calico-ipam calico
8 changes: 5 additions & 3 deletions calico-secure/v03/5-enable-agents.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ sudo ETCDCTL_API=2 /opt/etcd/etcdctl \
####### Docker cluster store
# Get docker to pick up the new config
# !!! If this fails, you may have to remove the 'overlay' line from /etc/docker/daemon.json - it doesn't like redundant configurations
# sudo sed -i "/storage-driver/d" /etc/docker/daemon.json
if [[ $(systemctl cat docker | grep 'storage-driver=overlay' | wc -l) -eq 1 ]]; then
sudo sed -i "/storage-driver/d" /etc/docker/daemon.json
fi
sudo systemctl restart docker

# Validate
sudo docker info | grep -i cluster


####### Calico node (not strictly necessary on masters, but a good idea, I think)
####### Calico node
sudo cp /etc/calico/dcos-calico-node.service /etc/systemd/system/dcos-calico-node.service
sudo cp /etc/calico/dcos-calico-node.timer /etc/systemd/system/dcos-calico-node.timer

Expand All @@ -40,7 +42,7 @@ sudo systemctl enable dcos-calico-node.timer
sudo systemctl restart dcos-calico-node.timer

# Check status
sleep 15
sleep 5
sudo calicoctl node status


Expand Down

0 comments on commit 8064f69

Please sign in to comment.