Skip to content

Commit 37eaca4

Browse files
committed
The console-deployment should set the number of replicas based on the ControlPlaneTopology
The node selector for the console deployment requires deploying it on the master nodes, The node selector for the console deployment requires deploying it on the master nodes, while the replica count is determined by the infrastructureTopology, which primarily tracks the workers' setup. When an OpenShift cluster is installed with a single master node and multiple workers, this leads the console deployment to request 3 replicas as infrastructureTopology is set to HighlyAvailable. Instead, ControlPlaneTopology is set to SingleReplica as expected. This commit makes the operator drive the number of replicas for the console deployment based on the ControlPlaneTopology rather than the InfrastructureTopology.
1 parent 04134ca commit 37eaca4

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pkg/console/subresource/deployment/deployment.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func DefaultDownloadsDeployment(
114114

115115
func withReplicas(deployment *appsv1.Deployment, infrastructureConfig *configv1.Infrastructure) {
116116
replicas := int32(SingleNodeConsoleReplicas)
117-
if infrastructureConfig.Status.InfrastructureTopology != configv1.SingleReplicaTopologyMode {
117+
if infrastructureConfig.Status.ControlPlaneTopology != configv1.SingleReplicaTopologyMode {
118118
replicas = int32(DefaultConsoleReplicas)
119119
}
120120
deployment.Spec.Replicas = &replicas
@@ -126,7 +126,7 @@ func withAffinity(
126126
component string,
127127
) {
128128
affinity := &corev1.Affinity{}
129-
if infrastructureConfig.Status.InfrastructureTopology != configv1.SingleReplicaTopologyMode {
129+
if infrastructureConfig.Status.ControlPlaneTopology != configv1.SingleReplicaTopologyMode {
130130
affinity = &corev1.Affinity{
131131
PodAntiAffinity: &corev1.PodAntiAffinity{
132132
RequiredDuringSchedulingIgnoredDuringExecution: []corev1.PodAffinityTerm{{

pkg/console/subresource/deployment/deployment_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ func TestWithConsoleAnnotations(t *testing.T) {
542542
ResourceVersion: "12345",
543543
},
544544
Status: configv1.InfrastructureStatus{
545-
InfrastructureTopology: configv1.SingleReplicaTopologyMode,
545+
ControlPlaneTopology: configv1.SingleReplicaTopologyMode,
546546
},
547547
}
548548

test/e2e/deployment_replicas_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func TestDeploymentsReplicas(t *testing.T) {
3434
}
3535

3636
var expectedReplicas int32
37-
if infrastructureConfig.Status.InfrastructureTopology == configv1.SingleReplicaTopologyMode {
37+
if infrastructureConfig.Status.ControlPlaneTopology == configv1.SingleReplicaTopologyMode {
3838
expectedReplicas = int32(deploymentsub.SingleNodeConsoleReplicas)
3939
} else {
4040
expectedReplicas = int32(deploymentsub.DefaultConsoleReplicas)

0 commit comments

Comments
 (0)