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

🌱 packaging: write kubeadm script log for ignition #3149

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
5 changes: 4 additions & 1 deletion packaging/flavorgen/flavors/generators.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 6 additions & 0 deletions templates/cluster-template-ignition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/framework/log/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this doesn't fail the test because we only bubble up the error to a certain point, but we don't fail the test because of that
(also the reason why the cloud-init files above don't lead to a failure of the ignition test)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact, it does not fail on errors, just logs it.

"sudo", "cat", "/var/log/kubeadm-service.log"),
)
}

Expand Down