Skip to content

Commit

Permalink
Expose cluster state to allow provider to view the state of the cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
engedaam committed Jan 10, 2025
1 parent a740974 commit c123c34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions kwok/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

kwok "sigs.k8s.io/karpenter/kwok/cloudprovider"
"sigs.k8s.io/karpenter/pkg/controllers"
"sigs.k8s.io/karpenter/pkg/controllers/state"
"sigs.k8s.io/karpenter/pkg/operator"
)

Expand All @@ -32,6 +33,7 @@ func main() {
}

cloudProvider := kwok.NewCloudProvider(ctx, op.GetClient(), instanceTypes)
clusterState := state.NewCluster(op.Clock, op.GetClient(), cloudProvider)
op.
WithControllers(ctx, controllers.NewControllers(
ctx,
Expand All @@ -40,5 +42,6 @@ func main() {
op.GetClient(),
op.EventRecorder,
cloudProvider,
clusterState,
)...).Start(ctx)
}
2 changes: 1 addition & 1 deletion pkg/controllers/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ func NewControllers(
kubeClient client.Client,
recorder events.Recorder,
cloudProvider cloudprovider.CloudProvider,
cluster *state.Cluster,
) []controller.Controller {
cluster := state.NewCluster(clock, kubeClient, cloudProvider)
p := provisioning.NewProvisioner(kubeClient, recorder, cloudProvider, cluster, clock)
evictionQueue := terminator.NewQueue(kubeClient, recorder)
disruptionQueue := orchestration.NewQueue(kubeClient, recorder, cluster, clock, p)
Expand Down

0 comments on commit c123c34

Please sign in to comment.