@@ -27,11 +27,6 @@ import (
2727 "k8s.io/apimachinery/pkg/runtime"
2828)
2929
30- const (
31- locContainerWorkingArea = "/mnt/workingarea"
32- locNodeWorkingArea = "/mnt/disks/ssd0/workspaces"
33- )
34-
3530func configmap (ctx * common.RenderContext ) ([]runtime.Object , error ) {
3631 var fsshift wsdapi.FSShiftMethod
3732 switch ctx .Config .Workspace .Runtime .FSShiftMethod {
@@ -46,26 +41,38 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
4641 wsdcfg := wsdconfig.Config {
4742 Daemon : daemon.Config {
4843 Runtime : daemon.RuntimeConfig {
44+ KubernetesNamespace : ctx .Namespace ,
4945 Container : & container.Config {
5046 Runtime : container .RuntimeContainerd ,
47+ Mapping : map [string ]string {
48+ ctx .Config .Workspace .Runtime .ContainerDRuntimeDir : "/mnt/node0" ,
49+ },
5150 Mounts : container.NodeMountsLookupConfig {
52- ProcLoc : "/mnt/rootfs/proc " ,
51+ ProcLoc : "/mnt/mounts " ,
5352 },
5453 Containerd : & container.ContainerdConfig {
55- SocketPath : "/mnt/rootfs/run/containerd/ containerd.sock" ,
54+ SocketPath : "/mnt/containerd.sock" ,
5655 },
5756 },
5857 },
5958 Content : content.Config {
60- WorkingArea : locContainerWorkingArea ,
61- WorkingAreaNode : locNodeWorkingArea ,
59+ WorkingArea : "/mnt/workingarea" ,
60+ WorkingAreaNode : HostWorkspacePath ,
61+ TmpDir : "/tmp" ,
6262 UserNamespaces : content.UserNamespacesConfig {
6363 FSShift : content .FSShiftMethod (fsshift ),
6464 },
6565 Storage : common .StorageConfig (& ctx .Config ),
66+ Backup : content.BackupConfig {
67+ Timeout : util .Duration (time .Minute * 5 ),
68+ Attempts : 3 ,
69+ },
70+ Initializer : content.InitializerConfig {
71+ Command : "/app/content-initializer" ,
72+ },
6673 },
6774 Uidmapper : iws.UidmapperConfig {
68- ProcLocation : "/mnt/rootfs/ proc" ,
75+ ProcLocation : "/proc" ,
6976 RootRange : iws.UIDRange {
7077 Start : 33333 ,
7178 Size : 1 ,
@@ -84,7 +91,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
8491 },
8592 ControlPeriod : "15m" ,
8693 SamplingPeriod : "10s" ,
87- CGroupsBasePath : "/mnt/rootfs/sys/fs/cgroup " ,
94+ CGroupsBasePath : "/mnt/node-cgroups " ,
8895 ProcessPriorities : map [resources.ProcessType ]int {
8996 resources .ProcessSupervisor : 0 ,
9097 resources .ProcessTheia : 5 ,
@@ -94,7 +101,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
94101 },
95102 Hosts : hosts.Config {
96103 Enabled : true ,
97- NodeHostsFile : "/mnt/rootfs/etc/ hosts" ,
104+ NodeHostsFile : "/mnt/hosts" ,
98105 FixedHosts : map [string ][]hosts.Host {
99106 "registryFacade" : {{
100107 Name : fmt .Sprintf ("reg.%s" , ctx .Config .Domain ),
@@ -110,11 +117,19 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
110117 Enabled : true ,
111118 Interval : util .Duration (5 * time .Minute ),
112119 Locations : []diskguard.LocationConfig {{
113- Path : locContainerWorkingArea ,
120+ Path : "/mnt/wsdaemon-workingarea" ,
114121 MinBytesAvail : 21474836480 ,
115122 }},
116123 },
117124 },
125+ Service : wsdconfig.AddrTLS {
126+ Addr : fmt .Sprintf (":%d" , ServicePort ),
127+ TLS : & wsdconfig.TLS {
128+ Authority : "/certs/ca.crt" ,
129+ Certificate : "/certs/tls.crt" ,
130+ PrivateKey : "/certs/tls.key" ,
131+ },
132+ },
118133 Prometheus : wsdconfig.Addr {
119134 Addr : "localhost:9500" ,
120135 },
0 commit comments