diff --git a/packaging/flavorgen/flavors/generators.go b/packaging/flavorgen/flavors/generators.go index c8dfbdf730..7880cfd453 100644 --- a/packaging/flavorgen/flavors/generators.go +++ b/packaging/flavorgen/flavors/generators.go @@ -96,7 +96,10 @@ systemd: After=containerd.service [Service] # Make metadata environment variables available for pre-kubeadm commands. - EnvironmentFile=/run/metadata/*` + EnvironmentFile=/run/metadata/* + # Log to file + StandardOutput=append:/var/log/kubeadm-service.log + StandardError=inherit` ) func newClusterTopologyCluster(supervisorMode bool) (clusterv1.Cluster, error) { diff --git a/templates/cluster-template-ignition.yaml b/templates/cluster-template-ignition.yaml index 80ae91cab6..ba0c4062f7 100644 --- a/templates/cluster-template-ignition.yaml +++ b/templates/cluster-template-ignition.yaml @@ -261,6 +261,9 @@ spec: [Service] # Make metadata environment variables available for pre-kubeadm commands. EnvironmentFile=/run/metadata/* + # Log to file + StandardOutput=append:/var/log/kubeadm-service.log + StandardError=inherit initConfiguration: nodeRegistration: criSocket: /var/run/containerd/containerd.sock @@ -361,6 +364,9 @@ spec: [Service] # Make metadata environment variables available for pre-kubeadm commands. EnvironmentFile=/run/metadata/* + # Log to file + StandardOutput=append:/var/log/kubeadm-service.log + StandardError=inherit joinConfiguration: nodeRegistration: criSocket: /var/run/containerd/containerd.sock diff --git a/test/framework/log/collector.go b/test/framework/log/collector.go index 7d9d4e2e31..d244181efd 100644 --- a/test/framework/log/collector.go +++ b/test/framework/log/collector.go @@ -96,6 +96,8 @@ func (c *MachineLogCollector) CollectMachineLog(ctx context.Context, ctrlClient "sudo", "cat", "/var/log/cloud-init.log"), captureLogs("cloud-init-output.log", "sudo", "cat", "/var/log/cloud-init-output.log"), + captureLogs("kubeadm-service.log", + "sudo", "cat", "/var/log/kubeadm-service.log"), ) }