Skip to content

Commit 6c2858c

Browse files
committed
add calico networking
Signed-off-by: Jason DeTiberus <[email protected]>
1 parent 743b4b5 commit 6c2858c

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ kube-*-cmdline
44
kube-*-initrd.img
55
kube-*-state
66
kube-weave.yaml
7+
kube-calico.yaml

Makefile

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ KUBE_RUNTIME ?= docker
22
KUBE_NETWORK ?= weave
33

44
KUBE_NETWORK_WEAVE ?= v2.2.1
5+
KUBE_NETWORK_CALICO ?= v3.1
56

67
ifeq ($(shell uname -s),Darwin)
78
KUBE_FORMATS ?= iso-efi
@@ -27,6 +28,11 @@ yml/weave.yml: kube-weave.yaml
2728
kube-weave.yaml:
2829
curl -L -o $@ https://cloud.weave.works/k8s/v1.8/net?v=$(KUBE_NETWORK_WEAVE)
2930

31+
yml/calico.yml: kube-calico.yaml
32+
33+
kube-calico.yaml:
34+
curl -L -o $@ https://docs.projectcalico.org/${KUBE_NETWORK_CALICO}/getting-started/kubernetes/installation/hosted/kubeadm/1.7/calico.yaml
35+
3036
.PHONY: update-hashes
3137
update-hashes:
3238
set -e ; for tag in $$(linuxkit pkg show-tag pkg/kubelet) \
@@ -41,7 +47,7 @@ update-hashes:
4147
clean:
4248
rm -f -r \
4349
kube-*-kernel kube-*-cmdline kube-*-state kube-*-initrd.img *.iso \
44-
kube-weave.yaml
50+
kube-weave.yaml kube-calico.yaml
4551

4652
.PHONY: refresh-image-caches
4753
refresh-image-caches:

README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ To build the default OS images:
2828
make all
2929
```
3030

31-
By default this will build images using Docker Engine for execution. To instead use cri-containerd use:
31+
By default this will build images using Docker Engine for execution and weave for networking. To instead use cri-containerd and calico use:
3232
```
33-
make all KUBE_RUNTIME=cri-containerd
33+
make all KUBE_RUNTIME=cri-containerd KUBE_NETWORK=calico
3434
```
3535

3636
## Booting and initialising OS images
@@ -44,6 +44,11 @@ or, to automatically initialise the cluster upon boot with no additional options
4444
KUBE_MASTER_AUTOINIT="" ./boot.sh
4545
```
4646

47+
If using calico for networking:
48+
```
49+
KUBE_MASTER_AUTOINIT="--pod-network-cidr=192.168.0.0/16" ./boot.sh
50+
```
51+
4752
Get IP address of the master:
4853
```
4954
ip addr show dev eth0

yml/calico.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
files:
2+
- path: /etc/kubeadm/kube-system.init/50-calico.yaml
3+
source: kube-calico.yaml

0 commit comments

Comments
 (0)