Skip to content

Commit 5dca63c

Browse files
committed
Add calico networking
Signed-off-by: Jason DeTiberus <[email protected]>
1 parent f0f53d2 commit 5dca63c

File tree

7 files changed

+60
-3
lines changed

7 files changed

+60
-3
lines changed

.circleci/config.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,13 @@ jobs:
217217
environment:
218218
- KUBE_RUNTIME: docker
219219
- KUBE_NETWORK: bridge
220+
image-docker-calico:
221+
<<: *image_build
222+
# Needs to be configured/enabled by CircleCI person
223+
#resource_class: large
224+
environment:
225+
- KUBE_RUNTIME: docker
226+
- KUBE_NETWORK: calico
220227

221228
image-cri-containerd-weave:
222229
<<: *image_build
@@ -228,6 +235,11 @@ jobs:
228235
environment:
229236
- KUBE_RUNTIME: cri-containerd
230237
- KUBE_NETWORK: bridge
238+
image-cri-containerd-calico:
239+
<<: *image_build
240+
environment:
241+
- KUBE_RUNTIME: cri-containerd
242+
- KUBE_NETWORK: calico
231243

232244
push-pkgs-to-hub:
233245
docker:
@@ -310,6 +322,12 @@ workflows:
310322
- pkg-kubelet
311323
- pkg-kubernetes-docker-image-cache-common
312324
- pkg-kubernetes-docker-image-cache-control-plane
325+
- image-docker-calilco:
326+
requires:
327+
- dependencies
328+
- pkg-kubelet
329+
- pkg-kubernetes-docker-image-cache-common
330+
- pkg-kubernetes-docker-image-cache-control-plane
313331
- image-cri-containerd-weave:
314332
requires:
315333
- dependencies
@@ -318,6 +336,10 @@ workflows:
318336
requires:
319337
- dependencies
320338
- pkg-kubelet
339+
- image-cri-containerd-calico:
340+
requires:
341+
- dependencies
342+
- pkg-kubelet
321343

322344
- push-pkgs-to-hub:
323345
# We want everything to have passed, which is a bit
@@ -331,5 +353,7 @@ workflows:
331353
- pkg-kubernetes-docker-image-cache-control-plane
332354
- image-docker-weave
333355
- image-docker-bridge
356+
- image-docker-calico
334357
- image-cri-containerd-weave
335358
- image-cri-containerd-bridge
359+
- image-cri-containerd-calico

.gitignore

Lines changed: 1 addition & 0 deletions
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

Lines changed: 7 additions & 1 deletion
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) \
@@ -40,7 +46,7 @@ update-hashes:
4046
clean:
4147
rm -f -r \
4248
kube-*-kernel kube-*-cmdline kube-*-state kube-*-initrd.img *.iso \
43-
kube-weave.yaml
49+
kube-weave.yaml kube-calico.yaml
4450

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

README.md

Lines changed: 7 additions & 2 deletions
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
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
# SUMMARY: build and boot using cri-containerd runtime and Calico networking
3+
# LABELS:
4+
5+
runtime=cri-containerd
6+
network=calico
7+
8+
# Doesn't return
9+
. ../common.sh
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
# SUMMARY: build and boot using Docker runtime and Calico networking
3+
# LABELS:
4+
5+
runtime=docker
6+
network=calico
7+
8+
# Doesn't return
9+
. ../common.sh

yml/calico.yml

Lines changed: 3 additions & 0 deletions
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)