@@ -66,6 +66,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
66
66
CPU : quantityString (ctx .Config .Workspace .Resources .Limits , corev1 .ResourceCPU ),
67
67
Memory : quantityString (ctx .Config .Workspace .Resources .Limits , corev1 .ResourceMemory ),
68
68
EphemeralStorage : quantityString (ctx .Config .Workspace .Resources .Limits , corev1 .ResourceEphemeralStorage ),
69
+ Storage : quantityString (ctx .Config .Workspace .Resources .Limits , corev1 .ResourceStorage ),
69
70
},
70
71
},
71
72
Templates : templatesCfg ,
@@ -76,6 +77,20 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
76
77
},
77
78
},
78
79
}
80
+
81
+ installationShortNameSuffix := ""
82
+ if ctx .Config .Metadata .InstallationShortname != "" && ctx .Config .Metadata .InstallationShortname != configv1 .InstallationShortNameOldDefault {
83
+ installationShortNameSuffix = "-" + ctx .Config .Metadata .InstallationShortname
84
+ }
85
+
86
+ var schedulerName string
87
+ gitpodHostURL := "https://" + ctx .Config .Domain
88
+ workspaceClusterHost := fmt .Sprintf ("ws.%s" , ctx .Config .Domain )
89
+ workspaceURLTemplate := fmt .Sprintf ("https://{{ .Prefix }}.ws%s.%s" , installationShortNameSuffix , ctx .Config .Domain )
90
+ workspacePortURLTemplate := fmt .Sprintf ("https://{{ .WorkspacePort }}-{{ .Prefix }}.ws%s.%s" , installationShortNameSuffix , ctx .Config .Domain )
91
+
92
+ rateLimits := map [string ]grpc.RateLimit {}
93
+
79
94
err = ctx .WithExperimental (func (ucfg * experimental.Config ) error {
80
95
if ucfg .Workspace == nil {
81
96
return nil
@@ -102,6 +117,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
102
117
CPU : quantityString (c .Resources .Limits , corev1 .ResourceCPU ),
103
118
Memory : quantityString (c .Resources .Limits , corev1 .ResourceMemory ),
104
119
EphemeralStorage : quantityString (c .Resources .Limits , corev1 .ResourceEphemeralStorage ),
120
+ Storage : quantityString (c .Resources .Limits , corev1 .ResourceStorage ),
105
121
},
106
122
},
107
123
Templates : tplsCfg ,
@@ -114,20 +130,31 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
114
130
tpls [tmpl_n ] = tmpl_v
115
131
}
116
132
}
133
+ schedulerName = ucfg .Workspace .SchedulerName
134
+ if ucfg .Workspace .HostURL != "" {
135
+ gitpodHostURL = ucfg .Workspace .HostURL
136
+ }
137
+ if ucfg .Workspace .WorkspaceClusterHost != "" {
138
+ workspaceClusterHost = ucfg .Workspace .WorkspaceClusterHost
139
+ }
140
+ if ucfg .Workspace .WorkspaceURLTemplate != "" {
141
+ workspaceURLTemplate = ucfg .Workspace .WorkspaceURLTemplate
142
+ }
143
+ if ucfg .Workspace .WorkspacePortURLTemplate != "" {
144
+ workspacePortURLTemplate = ucfg .Workspace .WorkspacePortURLTemplate
145
+ }
146
+ rateLimits = ucfg .Workspace .WSManagerRateLimits
147
+
117
148
return nil
118
149
})
119
150
if err != nil {
120
151
return nil , err
121
152
}
122
153
123
- installationShortNameSuffix := ""
124
- if ctx .Config .Metadata .InstallationShortname != "" && ctx .Config .Metadata .InstallationShortname != configv1 .InstallationShortNameOldDefault {
125
- installationShortNameSuffix = "-" + ctx .Config .Metadata .InstallationShortname
126
- }
127
-
128
154
wsmcfg := config.ServiceConfiguration {
129
155
Manager : config.Configuration {
130
156
Namespace : ctx .Namespace ,
157
+ SchedulerName : schedulerName ,
131
158
SeccompProfile : fmt .Sprintf ("localhost/workspace_default_%s.json" , ctx .VersionManifest .Version ),
132
159
DryRun : false ,
133
160
WorkspaceDaemon : config.WorkspaceDaemonConfiguration {
@@ -144,13 +171,13 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
144
171
},
145
172
WorkspaceClasses : classes ,
146
173
HeartbeatInterval : util .Duration (30 * time .Second ),
147
- GitpodHostURL : "https://" + ctx . Config . Domain ,
148
- WorkspaceClusterHost : fmt . Sprintf ( "ws.%s" , ctx . Config . Domain ) ,
174
+ GitpodHostURL : gitpodHostURL ,
175
+ WorkspaceClusterHost : workspaceClusterHost ,
149
176
InitProbe : config.InitProbeConfiguration {
150
177
Timeout : (1 * time .Second ).String (),
151
178
},
152
- WorkspaceURLTemplate : fmt . Sprintf ( "https://{{ .Prefix }}.ws%s.%s" , installationShortNameSuffix , ctx . Config . Domain ) ,
153
- WorkspacePortURLTemplate : fmt . Sprintf ( "https://{{ .WorkspacePort }}-{{ .Prefix }}.ws%s.%s" , installationShortNameSuffix , ctx . Config . Domain ) ,
179
+ WorkspaceURLTemplate : workspaceURLTemplate ,
180
+ WorkspacePortURLTemplate : workspacePortURLTemplate ,
154
181
WorkspaceHostPath : wsdaemon .HostWorkingArea ,
155
182
Timeouts : config.WorkspaceTimeoutConfiguration {
156
183
AfterClose : timeoutAfterClose ,
@@ -190,7 +217,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
190
217
Certificate : "/certs/tls.crt" ,
191
218
PrivateKey : "/certs/tls.key" ,
192
219
},
193
- RateLimits : map [ string ]grpc. RateLimit {}, // todo(sje) add values
220
+ RateLimits : rateLimits ,
194
221
},
195
222
ImageBuilderProxy : struct {
196
223
TargetAddr string "json:\" targetAddr\" "
0 commit comments