From efa287c38cb0108108551c07fecfd41e66206a2f Mon Sep 17 00:00:00 2001 From: Hector Huertas Date: Thu, 21 May 2020 14:47:19 +0200 Subject: [PATCH] Ensure journald uses disk instead of memory (#126) --- cfssl.tf | 4 ++++ common.tf | 6 ++++++ etcd.tf | 4 ++++ master.tf | 4 ++++ storage-node.tf | 4 ++++ worker.tf | 4 ++++ 6 files changed, 26 insertions(+) diff --git a/cfssl.tf b/cfssl.tf index 79bc784..ec27d9b 100644 --- a/cfssl.tf +++ b/cfssl.tf @@ -219,4 +219,8 @@ data "ignition_config" "cfssl" { module.cfssl-restarter.systemd_units, var.cfssl_additional_systemd_units ) + + directories = [ + data.ignition_directory.journald.id + ] } diff --git a/common.tf b/common.tf index 1110853..e4da0ee 100644 --- a/common.tf +++ b/common.tf @@ -68,3 +68,9 @@ data "ignition_file" "kubelet" { source = "https://storage.googleapis.com/kubernetes-release/release/${var.hyperkube_image_tag}/bin/linux/amd64/kubelet" } } + +# Dir used by systemd to store logs in disk instead of memory +data "ignition_directory" "journald" { + filesystem = "root" + path = "/var/log/journal" +} diff --git a/etcd.tf b/etcd.tf index fbf55ee..417559d 100644 --- a/etcd.tf +++ b/etcd.tf @@ -160,4 +160,8 @@ data "ignition_config" "etcd" { module.etcd-cert-fetcher.systemd_units, var.etcd_additional_systemd_units ) + + directories = [ + data.ignition_directory.journald.id + ] } diff --git a/master.tf b/master.tf index 34058c8..73a59d4 100644 --- a/master.tf +++ b/master.tf @@ -465,4 +465,8 @@ data "ignition_config" "master" { module.cert-refresh-master.systemd_units, var.master_additional_systemd_units, ) + + directories = [ + data.ignition_directory.journald.id + ] } diff --git a/storage-node.tf b/storage-node.tf index 0240fd0..bcf30d6 100644 --- a/storage-node.tf +++ b/storage-node.tf @@ -85,4 +85,8 @@ data "ignition_config" "storage-node" { module.cert-refresh-node.systemd_units, var.storage_node_additional_systemd_units ) + + directories = [ + data.ignition_directory.journald.id + ] } diff --git a/worker.tf b/worker.tf index 9845171..9e81cc4 100644 --- a/worker.tf +++ b/worker.tf @@ -67,4 +67,8 @@ data "ignition_config" "worker" { module.cert-refresh-node.systemd_units, var.worker_additional_systemd_units ) + + directories = [ + data.ignition_directory.journald.id + ] }