Skip to content

Building Calico with Kubernetes

aborkar-ibm edited this page Jun 11, 2019 · 49 revisions

Integrating Calico with Kubernetes

Calico enables networking and network policy in Kubernetes clusters across the cloud. The instructions provided you the steps to integrate Calico with Kubernetes on Linux on IBM Z for following distribution:

  • RHEL (7.4, 7.5, 7.6)
  • Ubuntu (16.04, 18.04)
  • SLES (12 SP4, 15)

General Notes:

  • When following the steps below please use a standard permission user unless otherwise specified.

  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.

1. Build Calico basic components

Instructions for building the basic Calico components, which includes calicoctl and calico/node can be found here

2. Build Kubernetes Support

2.1. Install Calico CNI plugins

  • Create /opt/cni/bin on your machine

    sudo mkdir -p /opt/cni/bin
  • Download the source code for cni-plugin

    sudo mkdir -p /opt/cni/bin
    git clone https://github.com/projectcalico/cni-plugin.git $GOPATH/src/github.com/projectcalico/cni-plugin
    cd $GOPATH/src/github.com/projectcalico/cni-plugin
    git checkout v3.7.2
    ARCH=s390x make image
    sudo cp bin/s390x/* /opt/cni/bin
    docker tag calico/cni:latest-s390x calico/cni:latest
    docker tag calico/cni:latest quay.io/calico/cni-s390x:v3.7.2
    docker tag calico/cni:latest-s390x calico/cni:v3.7.2

2.2. Build the Calico network policy controller

  • Download the source code
    git clone https://github.com/projectcalico/k8s-policy.git $GOPATH/src/github.com/projectcalico/k8s-policy
    cd $GOPATH/src/github.com/projectcalico/k8s-policy
    git checkout v3.7.2
    ARCH=s390x make image
    docker tag calico/kube-controllers:latest-s390x calico/kube-controllers:v3.7.2 

3. Install Calico in Kubernetes environment

Once you have all necessary components built on z systems, you can

  • Run calico/node by

    sudo ETCD_ENDPOINTS=http://<ETCD_IP>:<ETCD_PORT> calicoctl node run --node-image=quay.io/calico/node-s390x:v3.7.2
    

    This assumes you already have calicoctl built from the basic calico building instruction and its location is in your PATH environment variable.

  • Configure and run your Kubernetes following here

  • Install the calico policy controller following here

4. Usage samples

The demos of the simple usage of calico with Kubernetes can be found at

Clone this wiki locally