From a2fd6aec574f685ef85124aec388f27365dacd06 Mon Sep 17 00:00:00 2001 From: Christian Schlotter Date: Fri, 9 Aug 2024 14:18:24 +0200 Subject: [PATCH] packaging: write kubeadm script log for ignition --- packaging/flavorgen/flavors/generators.go | 5 ++++- templates/cluster-template-ignition.yaml | 6 ++++++ templates/creds.env | 18 ++++++++++++++++++ test/framework/log/collector.go | 2 ++ 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 templates/creds.env 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/templates/creds.env b/templates/creds.env new file mode 100644 index 0000000000..5bba0d00d2 --- /dev/null +++ b/templates/creds.env @@ -0,0 +1,18 @@ +export NAMESPACE="prow-cluster" +export CLUSTER_CLASS_NAME=prow +export CONTROL_PLANE_ENDPOINT_IP=192.168.6.162 +export CPI_IMAGE_K8S_VERSION=v1.29.0 +export KUBERNETES_VERSION=v1.29.0 +export VSPHERE_DATACENTER=SDDC-datacenter +export VSPHERE_NETWORK=sddc-cgw-network-6 +export VSPHERE_PASSWORD='1yU(~!eC%3!F' +export VSPHERE_SERVER=10.2.224.4 +export VSPHERE_SSH_AUTHORIZED_KEY="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFQAq+JGGkZMVgaqlMY6Gwom2YMO+Gf7YuLKX019nGVu services@capv.ci" +export VSPHERE_TLS_THUMBPRINT="D8:64:61:90:26:65:B8:1E:95:18:4B:68:56:D2:F7:34:FA:68:BF:2A" +export VSPHERE_USERNAME="cloudadmin@vmc.local" + +export VSPHERE_DATASTORE="WorkloadDatastore" +export VSPHERE_FOLDER="system" +export VSPHERE_RESOURCE_POOL="system" +export VSPHERE_STORAGE_POLICY="" +export VSPHERE_TEMPLATE="ubuntu-2204-kube-v1.29.0" \ No newline at end of file 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"), ) }