Skip to content

[installer] change blobserve node to workload_ide #12558

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

Merged
merged 2 commits into from
Sep 9, 2022
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
16 changes: 2 additions & 14 deletions install/installer/cmd/testdata/render/aws-setup/output.golden
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,7 @@ metadata:
namespace: default
spec:
ingress:
- from:
- podSelector:
matchLabels:
component: proxy
- podSelector:
matchLabels:
component: ws-proxy
- podSelector:
matchLabels:
component: ide-proxy
ports:
- port: 32224
protocol: TCP
- {}
podSelector:
matchLabels:
app: gitpod
Expand Down Expand Up @@ -6497,7 +6485,7 @@ spec:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: gitpod.io/workload_workspace_services
- key: gitpod.io/workload_ide
operator: Exists
containers:
- args:
Expand Down
16 changes: 2 additions & 14 deletions install/installer/cmd/testdata/render/azure-setup/output.golden
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,7 @@ metadata:
namespace: default
spec:
ingress:
- from:
- podSelector:
matchLabels:
component: proxy
- podSelector:
matchLabels:
component: ws-proxy
- podSelector:
matchLabels:
component: ide-proxy
ports:
- port: 32224
protocol: TCP
- {}
podSelector:
matchLabels:
app: gitpod
Expand Down Expand Up @@ -6337,7 +6325,7 @@ spec:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: gitpod.io/workload_workspace_services
- key: gitpod.io/workload_ide
operator: Exists
containers:
- args:
Expand Down
16 changes: 2 additions & 14 deletions install/installer/cmd/testdata/render/customization/output.golden
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,7 @@ metadata:
namespace: default
spec:
ingress:
- from:
- podSelector:
matchLabels:
component: proxy
- podSelector:
matchLabels:
component: ws-proxy
- podSelector:
matchLabels:
component: ide-proxy
ports:
- port: 32224
protocol: TCP
- {}
podSelector:
matchLabels:
app: gitpod
Expand Down Expand Up @@ -7705,7 +7693,7 @@ spec:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: gitpod.io/workload_workspace_services
- key: gitpod.io/workload_ide
operator: Exists
containers:
- args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,7 @@ metadata:
namespace: default
spec:
ingress:
- from:
- podSelector:
matchLabels:
component: proxy
- podSelector:
matchLabels:
component: ws-proxy
- podSelector:
matchLabels:
component: ide-proxy
ports:
- port: 32224
protocol: TCP
- {}
podSelector:
matchLabels:
app: gitpod
Expand Down Expand Up @@ -6778,7 +6766,7 @@ spec:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: gitpod.io/workload_workspace_services
- key: gitpod.io/workload_ide
operator: Exists
containers:
- args:
Expand Down
16 changes: 2 additions & 14 deletions install/installer/cmd/testdata/render/gcp-setup/output.golden
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,7 @@ metadata:
namespace: default
spec:
ingress:
- from:
- podSelector:
matchLabels:
component: proxy
- podSelector:
matchLabels:
component: ws-proxy
- podSelector:
matchLabels:
component: ide-proxy
ports:
- port: 32224
protocol: TCP
- {}
podSelector:
matchLabels:
app: gitpod
Expand Down Expand Up @@ -6317,7 +6305,7 @@ spec:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: gitpod.io/workload_workspace_services
- key: gitpod.io/workload_ide
operator: Exists
containers:
- args:
Expand Down
16 changes: 2 additions & 14 deletions install/installer/cmd/testdata/render/minimal/output.golden
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,7 @@ metadata:
namespace: default
spec:
ingress:
- from:
- podSelector:
matchLabels:
component: proxy
- podSelector:
matchLabels:
component: ws-proxy
- podSelector:
matchLabels:
component: ide-proxy
ports:
- port: 32224
protocol: TCP
- {}
podSelector:
matchLabels:
app: gitpod
Expand Down Expand Up @@ -7058,7 +7046,7 @@ spec:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: gitpod.io/workload_workspace_services
- key: gitpod.io/workload_ide
operator: Exists
containers:
- args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,7 @@ metadata:
namespace: default
spec:
ingress:
- from:
- podSelector:
matchLabels:
component: proxy
- podSelector:
matchLabels:
component: ws-proxy
- podSelector:
matchLabels:
component: ide-proxy
ports:
- port: 32224
protocol: TCP
- {}
podSelector:
matchLabels:
app: gitpod
Expand Down Expand Up @@ -7070,7 +7058,7 @@ spec:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: gitpod.io/workload_workspace_services
- key: gitpod.io/workload_ide
operator: Exists
containers:
- args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,7 @@ metadata:
namespace: default
spec:
ingress:
- from:
- podSelector:
matchLabels:
component: proxy
- podSelector:
matchLabels:
component: ws-proxy
- podSelector:
matchLabels:
component: ide-proxy
ports:
- port: 32224
protocol: TCP
- {}
podSelector:
matchLabels:
app: gitpod
Expand Down Expand Up @@ -7502,7 +7490,7 @@ spec:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: gitpod.io/workload_workspace_services
- key: gitpod.io/workload_ide
operator: Exists
containers:
- args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,7 @@ metadata:
namespace: default
spec:
ingress:
- from:
- podSelector:
matchLabels:
component: proxy
- podSelector:
matchLabels:
component: ws-proxy
- podSelector:
matchLabels:
component: ide-proxy
ports:
- port: 32224
protocol: TCP
- {}
podSelector:
matchLabels:
app: gitpod
Expand Down Expand Up @@ -7061,7 +7049,7 @@ spec:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: gitpod.io/workload_workspace_services
- key: gitpod.io/workload_ide
operator: Exists
containers:
- args:
Expand Down
2 changes: 1 addition & 1 deletion install/installer/pkg/components/blobserve/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
}),
},
Spec: corev1.PodSpec{
Affinity: common.NodeAffinity(cluster.AffinityLabelWorkspaceServices),
Affinity: common.NodeAffinity(cluster.AffinityLabelIDE),
ServiceAccountName: Component,
EnableServiceLinks: pointer.Bool(false),
Volumes: []corev1.Volume{{
Expand Down
25 changes: 1 addition & 24 deletions install/installer/pkg/components/blobserve/networkpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@ package blobserve

import (
"github.com/gitpod-io/gitpod/installer/pkg/common"
ideproxy "github.com/gitpod-io/gitpod/installer/pkg/components/ide-proxy"
"github.com/gitpod-io/gitpod/installer/pkg/components/proxy"
wsproxy "github.com/gitpod-io/gitpod/installer/pkg/components/ws-proxy"

networkingv1 "k8s.io/api/networking/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/intstr"
)

func networkpolicy(ctx *common.RenderContext) ([]runtime.Object, error) {
Expand All @@ -29,26 +25,7 @@ func networkpolicy(ctx *common.RenderContext) ([]runtime.Object, error) {
Spec: networkingv1.NetworkPolicySpec{
PodSelector: metav1.LabelSelector{MatchLabels: labels},
PolicyTypes: []networkingv1.PolicyType{"Ingress"},
Ingress: []networkingv1.NetworkPolicyIngressRule{{
Ports: []networkingv1.NetworkPolicyPort{{
Protocol: common.TCPProtocol,
Port: &intstr.IntOrString{IntVal: ContainerPort},
}},
From: []networkingv1.NetworkPolicyPeer{{
PodSelector: &metav1.LabelSelector{MatchLabels: map[string]string{
"component": proxy.Component,
}},
}, {
// TODO: (pd) delete this after all workspace cluster deployed
PodSelector: &metav1.LabelSelector{MatchLabels: map[string]string{
"component": wsproxy.Component,
}},
}, {
PodSelector: &metav1.LabelSelector{MatchLabels: map[string]string{
"component": ideproxy.Component,
}},
}},
}},
Ingress: []networkingv1.NetworkPolicyIngressRule{{}},
},
}}, nil
}