Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Placement score #108

Merged
merged 6 commits into from
Nov 22, 2022
Merged

Placement score #108

merged 6 commits into from
Nov 22, 2022

Conversation

rokej
Copy link
Contributor

@rokej rokej commented Nov 22, 2022

Description of the change(s):

  • Instead of waiting for the hosted cluster's overall status to be completed, which means all nodepools are available as well, once the hosted control plane to be available, copy kubeconfig secret into the klusterlet namespace to finish cluster registration.
  - lastTransitionTime: "2022-11-22T01:19:50Z"
    message: The hosted control plane is available
    observedGeneration: 3
    reason: HostedClusterAsExpected
    status: "True"
    type: Available
  • Whenever the hypershift agent reconciles hosted clusters, it should generate addOnPlacementScore with the number of hosted clusters as a score value in the hosting cluster's namespace on the hub.
apiVersion: cluster.open-cluster-management.io/v1alpha1
kind: AddOnPlacementScore
metadata:
  creationTimestamp: "2022-11-20T16:55:25Z"
  generation: 1
  name: hosted-clusters-score
  namespace: local-cluster
  resourceVersion: "9747083"
  uid: 10020399-3c5b-4d71-b202-cee0ad398232
status:
  scores:
  - name: hostedClustersCount
    value: 1

Why do we need this PR:

  • Hosted cluster placement scheduler can use the addOnPlacementScore to determine the least used hosting cluster and place a new hosted cluster.

Issue reference:

Test API/Unit - Success

Running tool: /usr/local/go/bin/go test -timeout 180s -coverprofile=/var/folders/6m/zwb5lxd157bgxp_wm4bv95fc0000gn/T/vscode-goEd8Foq/go-code-cover -run ^TestReconcile$ github.com/stolostron/hypershift-addon-operator/pkg/agent

ok  	github.com/stolostron/hypershift-addon-operator/pkg/agent	0.743s	coverage: 28.6% of statements

Signed-off-by: Roke Jung <roke@redhat.com>
Signed-off-by: Roke Jung <roke@redhat.com>
Signed-off-by: Roke Jung <roke@redhat.com>
Signed-off-by: Roke Jung <roke@redhat.com>
Signed-off-by: Roke Jung <roke@redhat.com>
@rokej
Copy link
Contributor Author

rokej commented Nov 22, 2022

/test e2e

@rokej
Copy link
Contributor Author

rokej commented Nov 22, 2022

/retest-required

@rokej
Copy link
Contributor Author

rokej commented Nov 22, 2022

/test e2e

@rokej
Copy link
Contributor Author

rokej commented Nov 22, 2022

/test e2e

Signed-off-by: Roke Jung <roke@redhat.com>
@sonarcloud
Copy link

sonarcloud bot commented Nov 22, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

80.0% 80.0% Coverage
0.0% 0.0% Duplication

@o-farag
Copy link
Contributor

o-farag commented Nov 22, 2022

/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Nov 22, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: o-farag, rokej

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit bea602f into stolostron:main Nov 22, 2022
@rokej rokej deleted the placement_score branch November 22, 2022 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants