Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing Cilium 1.15.1 and Full kube-proxy Replacement #1222

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ The default is Flannel, but you can also choose Calico or Cilium, by setting the

As Cilium has a lot of interesting and powerful config possibilities, we give you the ability to configure Cilium with the helm `cilium_values` variable (see the cilium specific [helm values](https://github.com/cilium/cilium/blob/master/install/kubernetes/cilium/values.yaml)) before you deploy your cluster.

Cilium supports full kube-proxy replacement. Cilium runs by default in hybrid kube-proxy replacement mode. To achieve a completely kube-proxy-free cluster, set `disable_kube_proxy = true`.

## Scaling Nodes

Two things can be scaled: the number of nodepools or the number of nodes in these nodepools.
Expand Down
1 change: 1 addition & 0 deletions control_planes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ locals {
module.control_planes[keys(module.control_planes)[0]].private_ipv4_address}:6443"
token = local.k3s_token
disable-cloud-controller = true
disable-kube-proxy = var.disable_kube_proxy
disable = local.disable_extras
kubelet-arg = concat(local.kubelet_arg, var.k3s_global_kubelet_args, var.k3s_control_plane_kubelet_args, v.kubelet_args)
kube-controller-manager-arg = local.kube_controller_manager_arg
Expand Down
1 change: 1 addition & 0 deletions init.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ resource "null_resource" "first_control_plane" {
token = local.k3s_token
cluster-init = true
disable-cloud-controller = true
disable-kube-proxy = var.disable_kube_proxy
disable = local.disable_extras
kubelet-arg = local.kubelet_arg
kube-controller-manager-arg = local.kube_controller_manager_arg
Expand Down
4 changes: 4 additions & 0 deletions kube.tf.example
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,10 @@ module "kube-hetzner" {
# Please note that if you are getting 403s from Github, it's also useful to set the version manually. However there is rarely a need for that!
# calico_version = "v3.25.0"

# If you want to disable the k3s kube-proxy, use this flag. The default is "false".
# Ensure that your CNI is capable of handling all the functionalities typically covered by kube-proxy.
# disable_kube_proxy = true

# If you want to disable the k3s default network policy controller, use this flag!
# Both Calico and Ciliun cni_plugin values override this value to true automatically, the default is "false".
# disable_network_policy = true
Expand Down
12 changes: 12 additions & 0 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,23 @@ k8s:

# Replace kube-proxy with Cilium
kubeProxyReplacement: true
%{if var.disable_kube_proxy}
# Enable health check server (healthz) for the kube-proxy replacement
kubeProxyReplacementHealthzBindAddr: "0.0.0.0:10256"
%{endif~}

# Access to Kube API Server (mandatory if kube-proxy is disabled)
k8sServiceHost: "127.0.0.1"
k8sServicePort: "6444"

# Set Tunnel Mode or Native Routing Mode (supported by Hetzner CCM Route Controller)
routingMode: "${var.cilium_routing_mode}"
%{if var.cilium_routing_mode == "native"~}
# Set the native routable CIDR
ipv4NativeRoutingCIDR: "${local.cilium_ipv4_native_routing_cidr}"

# Bypass iptables Connection Tracking for Pod traffic (only works in Native Routing Mode)
installNoConntrackIptablesRules: true
%{endif~}

endpointRoutes:
Expand Down
8 changes: 7 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,12 @@ variable "placement_group_disable" {
description = "Whether to disable placement groups."
}

variable "disable_kube_proxy" {
type = bool
default = false
description = "Disable kube-proxy in K3s (default false)."
}

variable "disable_network_policy" {
type = bool
default = false
Expand Down Expand Up @@ -575,7 +581,7 @@ variable "cilium_values" {

variable "cilium_version" {
type = string
default = "1.14.4"
default = "1.15.1"
description = "Version of Cilium."
}

Expand Down