-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup, added README's, renamed clustermetrics-controller to quotama…
…nager-controller Signed-off-by: cwiklik <[email protected]>
- Loading branch information
Showing
8 changed files
with
98 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ kind: Kustomization | |
images: | ||
- name: controller | ||
newName: ko.local/cluster-metrics | ||
newTag: 102f815 | ||
newTag: 15960ac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,13 +57,9 @@ const ( | |
//+kubebuilder:rbac:groups=kueue.x-k8s.io.galaxy.kubestellar.io,resources=admissionchecks/status,verbs=get;update;patch | ||
//+kubebuilder:rbac:groups=kueue.x-k8s.io.galaxy.kubestellar.io,resources=admissionchecks/finalizers,verbs=update | ||
|
||
// Reconcile is part of the main kubernetes reconciliation loop which aims to | ||
// move the current state of the cluster closer to the desired state. | ||
// TODO(user): Modify the Reconcile function to compare the state specified by | ||
// the AdmissionCheck object against the actual cluster state, and then | ||
// perform operations to make the cluster state reflect the state specified by | ||
// the user. | ||
// | ||
|
||
//Reconciles kueue AdmissionCheck | ||
|
||
// For more details, check Reconcile and its Result here: | ||
// - https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/reconcile | ||
func (r *AdmissionCheckReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,13 +81,8 @@ func NewWorkloadReconciler(c client.Client, kueueClient *kueueClient.Clientset, | |
} | ||
|
||
|
||
// Reconcile is part of the main kubernetes reconciliation loop which aims to | ||
// move the current state of the cluster closer to the desired state. | ||
// TODO(user): Modify the Reconcile function to compare the state specified by | ||
// the Workload object against the actual cluster state, and then | ||
// perform operations to make the cluster state reflect the state specified by | ||
// the user. | ||
// | ||
// Reconciles kueue Workload object and if quota exists it downsyncs a job to a worker cluster. | ||
|
||
// For more details, check Reconcile and its Result here: | ||
// - https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/reconcile | ||
func (r *WorkloadReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { | ||
|
@@ -100,13 +95,11 @@ func (r *WorkloadReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c | |
return reconcile.Result{}, client.IgnoreNotFound(err) | ||
} | ||
if !workload.HasQuotaReservation(wl) { | ||
//1.2 workload has no reservation | ||
log.Info("workload with no reservation, delete owned requests") | ||
return reconcile.Result{}, r.evictJob(ctx, wl) | ||
} | ||
|
||
if apimeta.IsStatusConditionTrue(wl.Status.Conditions, kueue.WorkloadFinished) { | ||
//1.2 workload has no reservation or is finished | ||
log.Info("remote workload has completed") | ||
return reconcile.Result{}, nil | ||
} | ||
|
@@ -130,15 +123,12 @@ func (r *WorkloadReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c | |
} | ||
// jobs with assigned cluster have already been scheduled to run | ||
if _, exists := jobObject.GetLabels()[AssignedClusterLabel]; exists { | ||
log.Info("............ Cluster Assignment Present") | ||
|
||
if workload.HasAllChecksReady(wl) { | ||
err := retry.RetryOnConflict(retry.DefaultRetry, func() error { | ||
wl := &kueue.Workload{} | ||
if err := r.Client.Get(ctx, req.NamespacedName, wl); err != nil { | ||
log.Error(err, "Error when fetching Workload object ") | ||
return err | ||
//return reconcile.Result{}, client.IgnoreNotFound(err) | ||
} | ||
log.Info("............ All Checks Ready") | ||
newCondition := metav1.Condition{ | ||
|
@@ -167,7 +157,6 @@ func (r *WorkloadReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c | |
log.Info("New BindingPolicy created for object", "Name", meta.Name) | ||
|
||
} else { | ||
log.Info("............ Not All Checks Ready") | ||
relevantChecks, err := admissioncheck.FilterForController(ctx, r.Client, wl.Status.AdmissionChecks, ControllerName) | ||
if err != nil { | ||
return reconcile.Result{}, err | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# README | ||
|
||
These scripts are currently supporting deployment of KubeStellar, Kueue, and integration controllers on K3D Kubernetes only. | ||
|
||
## Preparation | ||
|
||
Before runnning the scripts, make sure to increase your ulimits and | ||
fs.inotify.max_user_watches and fs.inotify.max_user_instances for the machine | ||
running the kind clusters. See [these instructions](https://kind.sigs.k8s.io/docs/user/known-issues/#pod-errors-due-to-too-many-open-files) for more info. | ||
|
||
For Rancher Desktop follow [these instructions](https://docs.rancherdesktop.io/how-to-guides/increasing-open-file-limit). | ||
and use the following config: | ||
|
||
```yaml | ||
provision: | ||
- mode: system | ||
script: | | ||
#!/bin/sh | ||
cat <<'EOF' > /etc/security/limits.d/rancher-desktop.conf | ||
* soft nofile 82920 | ||
* hard nofile 82920 | ||
EOF | ||
sysctl -w vm.max_map_count=262144 | ||
sysctl -w fs.inotify.max_user_instances=8192 | ||
sysctl -w fs.inotify.max_user_watches=1048576 | ||
``` | ||
Before running the script, make sure to run `go mod tidy` | ||
|
||
|
||
## Running the scripts | ||
|
||
Note: at the start each script deletes yor current kubeflex, cluster1 and cluster2 clusters, and | ||
backs up and delete your default kubeconfig in ~/.kube/config. | ||
|
||
To install, run the `install-all` script: | ||
|
||
```shell | ||
./instal-all.sh | ||
``` |