Skip to content

Commit 40e78a2

Browse files
WVerlaekroboquat
authored andcommitted
[image-builder] Change affinity in ws clusters
1 parent 81ee9a1 commit 40e78a2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

install/installer/cmd/testdata/render/kind-workspace/output.golden

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

install/installer/pkg/components/image-builder-mk3/deployment.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"fmt"
99

1010
"github.com/gitpod-io/gitpod/installer/pkg/cluster"
11+
"github.com/gitpod-io/gitpod/installer/pkg/config/v1"
1112

1213
"github.com/gitpod-io/gitpod/installer/pkg/common"
1314
dockerregistry "github.com/gitpod-io/gitpod/installer/pkg/components/docker-registry"
@@ -109,6 +110,11 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
109110
volumeMounts = append(volumeMounts, *mnt)
110111
}
111112

113+
var nodeAffinity = cluster.AffinityLabelMeta
114+
if ctx.Config.Kind == config.InstallationWorkspace {
115+
nodeAffinity = cluster.AffinityLabelWorkspaceServices
116+
}
117+
112118
return []runtime.Object{&appsv1.Deployment{
113119
TypeMeta: common.TypeMetaDeployment,
114120
ObjectMeta: metav1.ObjectMeta{
@@ -133,7 +139,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
133139
}),
134140
},
135141
Spec: corev1.PodSpec{
136-
Affinity: common.NodeAffinity(cluster.AffinityLabelMeta),
142+
Affinity: common.NodeAffinity(nodeAffinity),
137143
ServiceAccountName: Component,
138144
EnableServiceLinks: pointer.Bool(false),
139145
DNSPolicy: "ClusterFirst",

0 commit comments

Comments
 (0)