Skip to content

Commit

Permalink
Add HyperShift specific priorityClass
Browse files Browse the repository at this point in the history
HyperShift needs guest cluster control plane components with priority
"hypershift-control-plane", https://hypershift-docs.netlify.app/how-to/distribute-hosted-cluster-workloads/
  • Loading branch information
jsafrane committed Nov 30, 2022
1 parent 3bd0291 commit 3e1b978
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/operator/starter.go
Expand Up @@ -56,6 +56,8 @@ const (
caBundleKey = "ca-bundle.pem"

infrastructureName = "cluster"

hypershiftPriorityClass = "hypershift-control-plane"
)

func RunOperator(ctx context.Context, controllerConfig *controllercmd.ControllerContext, guestKubeConfigString string) error {
Expand Down Expand Up @@ -169,6 +171,7 @@ func RunOperator(ctx context.Context, controllerConfig *controllercmd.Controller
controlPlaneInformersForEvents,
withHypershiftDeploymentHook(isHypershift, os.Getenv(hypershiftImageEnvName)),
withHypershiftReplicasHook(isHypershift, guestNodeInformer.Lister()),
withHypershiftPriorityClass(isHypershift),
withNamespaceDeploymentHook(controlPlaneNamespace),
csidrivercontrollerservicecontroller.WithSecretHashAnnotationHook(controlPlaneNamespace, secretName, controlPlaneSecretInformer),
csidrivercontrollerservicecontroller.WithObservedProxyDeploymentHook(),
Expand Down Expand Up @@ -518,6 +521,8 @@ func withHypershiftDeploymentHook(isHypershift bool, hypershiftImage string) dc.
return nil
}

deployment.Spec.Template.Spec.PriorityClassName = hypershiftPriorityClass

// Inject into the pod the volumes used by CSI and token minter sidecars.
podSpec := &deployment.Spec.Template.Spec
podSpec.Volumes = append(podSpec.Volumes,
Expand Down

0 comments on commit 3e1b978

Please sign in to comment.