This repository is use for development porpuses. The official guide to run cilium on GKE can be found here
This is a guide on how to set up Cilium on Google GKE.
-
Install the Google Cloud SDK (
gcloud
)curl https://sdk.cloud.google.com | bash
For more information, see Installing Google Cloud SDK
-
Make sure you are authenticated to use the Google Cloud API:
export [email protected] gcloud auth login
The
$ADMIN_USER
will be used to create a cluster role binding -
Create a project
export GKE_PROJECT=gke-clusters gcloud projects create $GKE_PROJECT
-
Enable the GKE API for the project
gcloud services enable --project $GKE_PROJECT container.googleapis.com
-
Specify optional cluster & zone parameters (optional):
export GKE_REGION=europe-north1 export GKE_ZONE=-a export GKE_VERSION=1.11 export IMAGE_TYPE=UBUNTU #(COS is default) export NUM_NODES=5 #(default: 3)
-
Create a GKE cluster and deploy Cilium
CLUSTER_NAME=cluster1 ./create-gke-cluster.sh
kubectl -n cilium get pods
NAME READY STATUS RESTARTS AGE
cilium-5jm4g 1/1 Running 1 15m
cilium-etcd-4rnwn47btn 1/1 Running 0 13m
cilium-etcd-bd4qh529rj 1/1 Running 0 14m
cilium-etcd-h79whhjzq8 1/1 Running 0 14m
cilium-etcd-operator-5f647dbbf8-8vfn9 1/1 Running 0 15m
cilium-jlgs9 1/1 Running 1 15m
cilium-vf528 1/1 Running 1 15m
etcd-operator-759954d8db-w5ddm 1/1 Running 0 15m
CLUSTER_NAME=cluster1 ./delete-gke-cluster.sh
When adding additional nodes, the following commands have to be executed to prepare the nodes and enable CNI in the kubelet configuration of the node:
FLAGS="--zone $GKE_REGION$GKE_ZONE --project $GKE_PROJECT"
gcloud compute ssh $INSTANCE $FLAGS -- sudo sed -i "s:--network-plugin=kubenet:--network-plugin=cni\ --cni-bin-dir=/home/kubernetes/bin:g" /etc/default/kubelet
gcloud compute ssh $INSTANCE $FLAGS -- sudo systemctl restart kubelet
gcloud compute ssh $INSTANCE $FLAGS -- sudo mkdir -p /etc/cni/net.d/
gcloud compute scp 04-cilium-cni.conf root@${INSTANCE}:/etc/cni/net.d/04-cilium-cni.conf $FLAGS
- Cilium runs in the
cilium
namespace instead of thekube-system
namespace. - cilium-etcd-operator maintains an etcd cluster for use by Cilium that allows to scale down to 0 and scale back up.