From 14d4ea8b613329249b87a7cf84422a65a7d089a4 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Steenis Date: Sun, 14 Jan 2018 18:52:01 +0100 Subject: [PATCH] Support for Calico on GCE --- README.md | 2 +- cluster.yml | 4 +++- templates/calico.go | 15 ++++++++------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e5ae66c8..3559d272 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ There are extra options that can be specified for each network plugin: - **calico_cni_image**: Calico CNI binary installer Docker image - **calico_controllers_image**: Calico Controller Docker image - **calicoctl_image**: Calicoctl tool Docker image -- **calico_cloud_provider**: Cloud provider where Calico will operate, current available value is: `aws` +- **calico_cloud_provider**: Cloud provider where Calico will operate, currently supported values are: `aws`, `gce` #### Cannal diff --git a/cluster.yml b/cluster.yml index 118c6a51..3f659845 100644 --- a/cluster.yml +++ b/cluster.yml @@ -10,8 +10,10 @@ auth: # canal # weave # -# If you are using calico on AWS, use the network plugin config option: +# If you are using calico on AWS or GCE, use the network plugin config option: # 'calico_cloud_provider: aws' +# or +# 'calico_cloud_provider: gce' network: plugin: flannel options: diff --git a/templates/calico.go b/templates/calico.go index a90265e0..840a3adc 100644 --- a/templates/calico.go +++ b/templates/calico.go @@ -469,13 +469,12 @@ metadata: namespace: kube-system -{{if eq .CloudProvider "aws"}} -## aws stuff here +{{if ne .CloudProvider ""}} --- kind: ConfigMap apiVersion: v1 metadata: - name: aws-ippool + name: {{.CloudProvider}}-ippool namespace: kube-system data: aws-ippool: |- @@ -484,6 +483,8 @@ data: metadata: cidr: {{.ClusterCIDR}} spec: + ipip: + enabled: true nat-outgoing: true --- apiVersion: v1 @@ -497,7 +498,7 @@ spec: containers: - name: calicoctl image: {{.Calicoctl}} - command: ["/bin/sh", "-c", "calicoctl apply -f aws-ippool.yaml"] + command: ["/bin/sh", "-c", "calicoctl apply -f {{.CloudProvider}}-ippool.yaml"] env: - name: ETCD_ENDPOINTS valueFrom: @@ -510,9 +511,9 @@ spec: volumes: - name: ippool-config configMap: - name: aws-ippool + name: {{.CloudProvider}}-ippool items: - - key: aws-ippool - path: aws-ippool.yaml + - key: {{.CloudProvider}}-ippool + path: {{.CloudProvider}}-ippool.yaml {{end}} `