Skip to content

Commit c6b0a12

Browse files
committed
minor update for cloud init
1 parent 0943ac7 commit c6b0a12

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

cloud/services/compute/instance/cloudinit.go

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func reconcileCloudInitUser(vmid int, vmName, storageName, bootstrap string, con
4444
}
4545

4646
// to do: should be set via API
47+
// to do: storage path
4748
out, err := ssh.RunWithStdin(fmt.Sprintf("tee /var/lib/vz/%s/snippets/%s-user.yml", storageName, vmName), configYaml)
4849
if err != nil {
4950
return errors.Errorf("ssh command error : %s : %v", out, err)
@@ -65,6 +66,7 @@ func ApplyCICustom(vmid int, vmName, storageName, ciType string, ssh scope.SSHCl
6566
return nil
6667
}
6768

69+
// to do : remove these cloud-config
6870
func baseUserData(vmName string) infrav1.User {
6971
return infrav1.User{
7072
GrowPart: infrav1.GrowPart{Mode: "auto", Devices: []string{"/"}, IgnoreGrowrootDisabled: false},
@@ -89,16 +91,6 @@ func baseUserData(vmName string) infrav1.User {
8991
net.bridge.bridge-nf-call-ip6tables = 1
9092
net.ipv4.ip_forward = 1`,
9193
},
92-
{
93-
Path: "/etc/containerd/config.toml",
94-
Owner: "root:root",
95-
Permissions: "0640",
96-
Content: `[plugins."io.containerd.grpc.v1.cri"]
97-
sandbox_image = "registry.k8s.io/pause:3.2"
98-
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
99-
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
100-
SystemdCgroup = true`,
101-
},
10294
},
10395
RunCmd: []string{
10496
"modprobe overlay",
@@ -107,6 +99,9 @@ net.ipv4.ip_forward = 1`,
10799
`mkdir -p /usr/local/bin`,
108100
`curl -L "https://github.com/containerd/containerd/releases/download/v1.7.2/containerd-1.7.2-linux-amd64.tar.gz" | tar Cxvz "/usr/local"`,
109101
`curl -L "https://raw.githubusercontent.com/containerd/containerd/main/containerd.service" -o /etc/systemd/system/containerd.service`,
102+
"mkdir -p /etc/containerd",
103+
"containerd config default > /etc/containerd/config.toml",
104+
"sed 's/SystemdCgroup = false/SystemdCgroup = true/g /etc/containerd/config.toml",
110105
"systemctl daemon-reload",
111106
"systemctl enable --now containerd",
112107
"mkdir -p /usr/local/sbin",

0 commit comments

Comments
 (0)