Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
Add experimental Cilium CNI provider
Browse files Browse the repository at this point in the history
* Accept experimental CNI `networking` mode "cilium"
* Run Cilium v1.8.0-rc4 with overlay vxlan tunnels and a
minimal set of features. We're interested in:
  * IPAM: Divide pod_cidr into /24 subnets per node
  * CNI networking pod-to-pod, pod-to-external
  * BPF masquerade
  * NetworkPolicy as defined by Kubernetes (no L7 Policy)
* Continue using kube-proxy with Cilium probe mode
* Firewall changes:
  * Require UDP 8472 for vxlan (Linux kernel default) between nodes
  * Optional ICMP echo(8) between nodes for host reachability
    (health)
  * Optional TCP 4240 between nodes for endpoint reachability (health)

Known Issues:

* Containers with `hostPort` don't listen on all host addresses,
these workloads must use `hostNetwork` for now
cilium/cilium#12116
* Erroneous warning on Fedora CoreOS
cilium/cilium#10256

Note: This is experimental. It is not listed in docs and may be
changed or removed without a deprecation notice

Related:

* poseidon/terraform-render-bootstrap#192
* cilium/cilium#12217
  • Loading branch information
dghubble committed Jun 22, 2020
1 parent 70483e1 commit 097f389
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bootstrap.tf
@@ -1,6 +1,6 @@
# Kubernetes assets (kubeconfig, manifests)
module "bootstrap" {
source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=e75697ce35d7773705f0b9b28ce1ffbe99f9493c"
source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=af36c539360696f5ca6cf5b06bb729477a003602"

cluster_name = var.cluster_name
api_servers = [format("%s.%s", var.cluster_name, var.dns_zone)]
Expand Down
26 changes: 26 additions & 0 deletions network.tf
Expand Up @@ -112,6 +112,32 @@ resource "google_compute_firewall" "internal-vxlan" {
target_tags = ["${var.cluster_name}-controller", "${var.cluster_name}-worker"]
}

# Cilium VXLAN
resource "google_compute_firewall" "internal-linux-vxlan" {
count = var.networking == "cilium" ? 1 : 0

name = "${var.cluster_name}-linux-vxlan"
network = google_compute_network.network.name

allow {
protocol = "udp"
ports = [8472]
}

# Cilium health
allow {
protocol = "icmp"
}

allow {
protocol = "tcp"
ports = [4240]
}

source_tags = ["${var.cluster_name}-controller", "${var.cluster_name}-worker"]
target_tags = ["${var.cluster_name}-controller", "${var.cluster_name}-worker"]
}

# Allow Prometheus to scrape node-exporter daemonset
resource "google_compute_firewall" "internal-node-exporter" {
name = "${var.cluster_name}-internal-node-exporter"
Expand Down

0 comments on commit 097f389

Please sign in to comment.