Skip to content

Commit

Permalink
Add calico networking
Browse files Browse the repository at this point in the history
Signed-off-by: Jason DeTiberus <[email protected]>
  • Loading branch information
detiber committed May 4, 2018
1 parent f0f53d2 commit 5dca63c
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 3 deletions.
24 changes: 24 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,13 @@ jobs:
environment:
- KUBE_RUNTIME: docker
- KUBE_NETWORK: bridge
image-docker-calico:
<<: *image_build
# Needs to be configured/enabled by CircleCI person
#resource_class: large
environment:
- KUBE_RUNTIME: docker
- KUBE_NETWORK: calico

image-cri-containerd-weave:
<<: *image_build
Expand All @@ -228,6 +235,11 @@ jobs:
environment:
- KUBE_RUNTIME: cri-containerd
- KUBE_NETWORK: bridge
image-cri-containerd-calico:
<<: *image_build
environment:
- KUBE_RUNTIME: cri-containerd
- KUBE_NETWORK: calico

push-pkgs-to-hub:
docker:
Expand Down Expand Up @@ -310,6 +322,12 @@ workflows:
- pkg-kubelet
- pkg-kubernetes-docker-image-cache-common
- pkg-kubernetes-docker-image-cache-control-plane
- image-docker-calilco:
requires:
- dependencies
- pkg-kubelet
- pkg-kubernetes-docker-image-cache-common
- pkg-kubernetes-docker-image-cache-control-plane
- image-cri-containerd-weave:
requires:
- dependencies
Expand All @@ -318,6 +336,10 @@ workflows:
requires:
- dependencies
- pkg-kubelet
- image-cri-containerd-calico:
requires:
- dependencies
- pkg-kubelet

- push-pkgs-to-hub:
# We want everything to have passed, which is a bit
Expand All @@ -331,5 +353,7 @@ workflows:
- pkg-kubernetes-docker-image-cache-control-plane
- image-docker-weave
- image-docker-bridge
- image-docker-calico
- image-cri-containerd-weave
- image-cri-containerd-bridge
- image-cri-containerd-calico
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ kube-*-cmdline
kube-*-initrd.img
kube-*-state
kube-weave.yaml
kube-calico.yaml
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ KUBE_RUNTIME ?= docker
KUBE_NETWORK ?= weave

KUBE_NETWORK_WEAVE ?= v2.2.1
KUBE_NETWORK_CALICO ?= v3.1

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

yml/calico.yml: kube-calico.yaml

kube-calico.yaml:
curl -L -o $@ https://docs.projectcalico.org/${KUBE_NETWORK_CALICO}/getting-started/kubernetes/installation/hosted/kubeadm/1.7/calico.yaml

.PHONY: update-hashes
update-hashes:
set -e ; for tag in $$(linuxkit pkg show-tag pkg/kubelet) \
Expand All @@ -40,7 +46,7 @@ update-hashes:
clean:
rm -f -r \
kube-*-kernel kube-*-cmdline kube-*-state kube-*-initrd.img *.iso \
kube-weave.yaml
kube-weave.yaml kube-calico.yaml

.PHONY: refresh-image-caches
refresh-image-caches:
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ To build the default OS images:
make all
```

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

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

If using calico for networking:
```
KUBE_MASTER_AUTOINIT="--pod-network-cidr=192.168.0.0/16" ./boot.sh
```

Get IP address of the master:
```
ip addr show dev eth0
Expand Down
9 changes: 9 additions & 0 deletions test/cases/000_smoke/005_cri-calico/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
# SUMMARY: build and boot using cri-containerd runtime and Calico networking
# LABELS:

runtime=cri-containerd
network=calico

# Doesn't return
. ../common.sh
9 changes: 9 additions & 0 deletions test/cases/000_smoke/006_docker-calico/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
# SUMMARY: build and boot using Docker runtime and Calico networking
# LABELS:

runtime=docker
network=calico

# Doesn't return
. ../common.sh
3 changes: 3 additions & 0 deletions yml/calico.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
files:
- path: /etc/kubeadm/kube-system.init/50-calico.yaml
source: kube-calico.yaml

0 comments on commit 5dca63c

Please sign in to comment.