Skip to content

Commit d93f3fa

Browse files
committed
[installer] change service account name
1 parent e7edf67 commit d93f3fa

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

install/installer/pkg/components/dashboard/constants.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,10 @@ const (
1010
PortName = "http"
1111
ServicePort = 3001
1212
ReadinessPort = 8080
13+
14+
// We need a new service account because
15+
// - Update old one will make preview env / dedicated deploy failed with err
16+
// The RoleBinding "dashboard" is invalid: roleRef: Invalid value: rbac.RoleRef{APIGroup:"rbac.authorization.k8s.io", Kind:"Role", Name:"dashboard"}: cannot change roleRef
17+
// - Add new one will not work for dedicated since it will not clean old resources
18+
ComponentServiceAccount = "dashboard-service-account"
1319
)

install/installer/pkg/components/dashboard/deployment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
4343
Spec: corev1.PodSpec{
4444
Affinity: cluster.WithNodeAffinityHostnameAntiAffinity(Component, cluster.AffinityLabelMeta),
4545
TopologySpreadConstraints: cluster.WithHostnameTopologySpread(Component),
46-
ServiceAccountName: Component,
46+
ServiceAccountName: ComponentServiceAccount,
4747
EnableServiceLinks: pointer.Bool(false),
4848
DNSPolicy: corev1.DNSClusterFirst,
4949
RestartPolicy: corev1.RestartPolicyAlways,

install/installer/pkg/components/dashboard/role.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func Role(ctx *common.RenderContext) ([]runtime.Object, error) {
1616
return []runtime.Object{&rbacv1.Role{
1717
TypeMeta: common.TypeMetaRole,
1818
ObjectMeta: metav1.ObjectMeta{
19-
Name: Component,
19+
Name: ComponentServiceAccount,
2020
Namespace: ctx.Namespace,
2121
Labels: common.DefaultLabels(Component),
2222
},

install/installer/pkg/components/dashboard/rolebinding.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ func rolebinding(ctx *common.RenderContext) ([]runtime.Object, error) {
1616
return []runtime.Object{&rbacv1.RoleBinding{
1717
TypeMeta: common.TypeMetaRoleBinding,
1818
ObjectMeta: metav1.ObjectMeta{
19-
Name: Component,
19+
Name: ComponentServiceAccount,
2020
Namespace: ctx.Namespace,
2121
Labels: common.DefaultLabels(Component),
2222
},
2323
RoleRef: rbacv1.RoleRef{
2424
Kind: "Role",
25-
Name: Component,
25+
Name: ComponentServiceAccount,
2626
APIGroup: "rbac.authorization.k8s.io",
2727
},
2828
Subjects: []rbacv1.Subject{{
2929
Kind: "ServiceAccount",
30-
Name: Component,
30+
Name: ComponentServiceAccount,
3131
}},
3232
}}, nil
3333
}

0 commit comments

Comments
 (0)