Skip to content

Commit

Permalink
Allow setting extra config in KubeletConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
AndiDog committed Sep 10, 2023
1 parent e1179b1 commit 50add0f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions service/kubernetes/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ variable "apiserver_extra_volumes" {
default = []
}

variable "kubelet_extra_config" {
# `map(any)` together with `yamlencode` might turn boolean values into strings, making the YAML
# invalid, so we instead support verbatim YAML input
type = string

description = "Extra config appended to KubeletConfiguration. Only applies at cluster creation."
default = ""
}

variable "node_count" {}

variable "connections" {
Expand Down Expand Up @@ -93,6 +102,7 @@ resource "null_resource" "kubernetes" {
apiserver_extra_volumes = yamlencode(var.apiserver_extra_volumes)
etcd_endpoints = "- ${join("\n - ", var.etcd_endpoints)}"
cert_sans = "- ${element(var.connections, 0)}"
kubelet_extra_config = var.kubelet_extra_config
})
destination = "/tmp/master-configuration.yml"
}
Expand Down
1 change: 1 addition & 0 deletions service/kubernetes/templates/master-configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
failSwapOn: false
cgroupDriver: systemd
${kubelet_extra_config}

0 comments on commit 50add0f

Please sign in to comment.