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

Introduce Applications Aware Quota #2748

Merged
merged 1 commit into from
Jan 25, 2024
Merged

Conversation

nunnatsa
Copy link
Collaborator

@nunnatsa nunnatsa commented Jan 21, 2024

What this PR does / why we need it

Add the AAQ deployment and custom resource.

Jira Ticket:

https://issues.redhat.com/browse/CNV-36394

Release note:

Introduce Applications Aware Quota

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Jan 21, 2024
@nunnatsa nunnatsa requested a review from tiraboschi January 21, 2024 15:00
@kubevirt-bot kubevirt-bot requested a review from sradco January 21, 2024 15:00
@nunnatsa nunnatsa force-pushed the add-aaq branch 3 times, most recently from 4bbd9c2 to 32e235e Compare January 22, 2024 08:38
@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 22, 2024
@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 22, 2024
@coveralls
Copy link
Collaborator

coveralls commented Jan 22, 2024

Pull Request Test Coverage Report for Build 7641243961

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.09%) to 86.539%

Totals Coverage Status
Change from base Build 7630165089: 0.09%
Covered Lines: 5394
Relevant Lines: 6233

💛 - Coveralls

Comment on lines 143 to 132
func NewAAQ(hc *hcov1beta1.HyperConverged) *aaqv1alpha1.AAQ {
spec := aaqv1alpha1.AAQSpec{
PriorityClass: ptr.To[aaqv1alpha1.AAQPriorityClass](kvPriorityClass),
ImagePullPolicy: corev1.PullIfNotPresent,
CertConfig: &aaqv1alpha1.AAQCertConfig{
CA: &aaqv1alpha1.CertConfig{
Duration: hc.Spec.CertConfig.CA.Duration,
RenewBefore: hc.Spec.CertConfig.CA.RenewBefore,
},
Server: &aaqv1alpha1.CertConfig{
Duration: hc.Spec.CertConfig.Server.Duration,
RenewBefore: hc.Spec.CertConfig.Server.RenewBefore,
},
},
}

if hc.Spec.Infra.NodePlacement != nil {
hc.Spec.Infra.NodePlacement.DeepCopyInto(&spec.Infra)
}

if hc.Spec.Workloads.NodePlacement != nil {
hc.Spec.Workloads.NodePlacement.DeepCopyInto(&spec.Workloads)
}

if config := hc.Spec.ApplicationAwareConfig; config != nil {
if config.VmiCalcConfigName != nil {
spec.Configuration.VmiCalculatorConfiguration.ConfigName = *config.VmiCalcConfigName
}

if config.NamespaceSelector != nil {
spec.NamespaceSelector = config.NamespaceSelector.DeepCopy()
}

spec.Configuration.EnableClusterAppsResourceQuota = config.EnableClusterAppsResourceQuota
}

aaq := NewAAQWithNameOnly(hc)
aaq.Spec = spec
return aaq
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AAQ initialization looks good to me :)

@Barakmor1
Copy link
Member

@nunnatsa
i think we should add the following line

kubectl apply ${LABEL_SELECTOR_ARG} -f https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/main/deploy/crds/applications-aware-quota00.crd.yaml

to deploy/deploy.sh like with mtq:
https://github.com/kubevirt/hyperconverged-cluster-operator/pull/2673/files

@nunnatsa nunnatsa changed the title WIP: Introduce Applications Aware Quota Introduce Applications Aware Quota Jan 22, 2024
@kubevirt-bot kubevirt-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 22, 2024
@nunnatsa nunnatsa force-pushed the add-aaq branch 2 times, most recently from 0cf8826 to 5546cf5 Compare January 22, 2024 14:53
Comment on lines 741 to 734
// NamespaceSelector determines in which namespaces scheduling gate will be added to pods, and it's very likely that
// to allow skipping scheduling gates in some namespaces.
NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

	// NamespaceSelector determines in which namespaces scheduling gate will be added to pods, and it's very likely that
	// to allow skipping scheduling gates in some namespaces.
	NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"`

Maybe something like:

	// NamespaceSelector determines in which namespaces scheduling gate will be added to pods.
	NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"`

Comment on lines 1129 to 1146
To configure AAQ, add the `applicationAwareConfig` object to the HyperConverged resource's spec. The
`applicationAwareConfig` object contains several fields:
* `vmiCalcConfigName` - determine how resource allocation will be done with ApplicationsResourceQuota.
allowed values are:
* `VmiPodUsage` - Calculate usage of launcher like any other pod but hide migration additional resources
* `VirtualResources` - Calculate usage of launcher like any other pod but hide migration additional resources
* `DedicatedVirtualResources` (default) - Calculate vmi.requests.memory as the vmi's ram size and vmi.requests.cpu as
number of threads of vmi in this configuration no memory.request/limits and cpu.request/limits won't be included
* `IgnoreVmiCalculator` - in this configuration no memory.request/limits and cpu.request/limits won't be included
* `namespaceSelector` - determines in which namespaces scheduling gate will be added to pods. This field is a standard
kubernetes selector.
* `enableClusterAppsResourceQuota` (default = false) - set to true, to allows creation and management of ClusterAppsResourceQuota

**note**: this setting cause some performance cost. Only set to true if there is a good reason.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VmiPodUsage calculates pod usage for VM-associated pods while concealing migration-specific resources.

VirtualResources allocates resources for VM-associated pods, using the VM's RAM size for memory and CPU threads for processing.

DedicatedVirtualResources (default) allocates resources for VM-associated pods, appending a /vm suffix to requests/limits.cpu and requests/limits.memory, derived from the VM's RAM size and CPU threads. Notably, it does not allocate resources for the standard requests/limits.cpu and requests/limits.memory .

IgnoreVmiCalculator avoids allocating VM-associated pods differently from normal pods, maintaining uniform resource allocation.

@nunnatsa nunnatsa force-pushed the add-aaq branch 2 times, most recently from 0014de0 to 645fe37 Compare January 22, 2024 15:42
@hco-bot
Copy link
Collaborator

hco-bot commented Jan 22, 2024

hco-e2e-operator-sdk-sno-aws lane succeeded.
/override ci/prow/hco-e2e-operator-sdk-sno-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-operator-sdk-sno-azure

In response to this:

hco-e2e-operator-sdk-sno-aws lane succeeded.
/override ci/prow/hco-e2e-operator-sdk-sno-azure

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 22, 2024

hco-e2e-upgrade-prev-operator-sdk-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-operator-sdk-sno-aws
okd-hco-e2e-upgrade-operator-sdk-gcp lane succeeded.
/override ci/prow/okd-hco-e2e-upgrade-operator-sdk-aws
hco-e2e-operator-sdk-gcp lane succeeded.
/override ci/prow/hco-e2e-operator-sdk-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-operator-sdk-aws, ci/prow/hco-e2e-upgrade-prev-operator-sdk-sno-aws, ci/prow/okd-hco-e2e-upgrade-operator-sdk-aws

In response to this:

hco-e2e-upgrade-prev-operator-sdk-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-operator-sdk-sno-aws
okd-hco-e2e-upgrade-operator-sdk-gcp lane succeeded.
/override ci/prow/okd-hco-e2e-upgrade-operator-sdk-aws
hco-e2e-operator-sdk-gcp lane succeeded.
/override ci/prow/hco-e2e-operator-sdk-aws

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 22, 2024

hco-e2e-operator-sdk-gcp lane succeeded.
/override ci/prow/hco-e2e-operator-sdk-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-operator-sdk-azure

In response to this:

hco-e2e-operator-sdk-gcp lane succeeded.
/override ci/prow/hco-e2e-operator-sdk-azure

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
3.4% Duplication on New Code

See analysis details on SonarCloud

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 24, 2024

okd-hco-e2e-operator-sdk-aws lane succeeded.
/override ci/prow/okd-hco-e2e-operator-sdk-gcp

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/okd-hco-e2e-operator-sdk-gcp

In response to this:

okd-hco-e2e-operator-sdk-aws lane succeeded.
/override ci/prow/okd-hco-e2e-operator-sdk-gcp

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 24, 2024
@hco-bot
Copy link
Collaborator

hco-bot commented Jan 24, 2024

okd-hco-e2e-upgrade-operator-sdk-aws lane succeeded.
/override ci/prow/okd-hco-e2e-upgrade-operator-sdk-gcp

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/okd-hco-e2e-upgrade-operator-sdk-gcp

In response to this:

okd-hco-e2e-upgrade-operator-sdk-aws lane succeeded.
/override ci/prow/okd-hco-e2e-upgrade-operator-sdk-gcp

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@nunnatsa
Copy link
Collaborator Author

/retest

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 24, 2024

hco-e2e-upgrade-prev-operator-sdk-sno-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-operator-sdk-sno-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-prev-operator-sdk-sno-azure

In response to this:

hco-e2e-upgrade-prev-operator-sdk-sno-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-operator-sdk-sno-azure

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 24, 2024

hco-e2e-operator-sdk-sno-aws lane succeeded.
/override ci/prow/hco-e2e-operator-sdk-sno-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-operator-sdk-sno-azure

In response to this:

hco-e2e-operator-sdk-sno-aws lane succeeded.
/override ci/prow/hco-e2e-operator-sdk-sno-azure

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 24, 2024

hco-e2e-upgrade-prev-operator-sdk-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-operator-sdk-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-prev-operator-sdk-azure

In response to this:

hco-e2e-upgrade-prev-operator-sdk-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-operator-sdk-azure

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@nunnatsa
Copy link
Collaborator Author

/retest

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 24, 2024

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-azure

In response to this:

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 24, 2024

hco-e2e-upgrade-operator-sdk-sno-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-operator-sdk-sno-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-operator-sdk-sno-azure

In response to this:

hco-e2e-upgrade-operator-sdk-sno-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-operator-sdk-sno-azure

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 24, 2024

hco-e2e-consecutive-operator-sdk-upgrades-aws lane succeeded.
/override ci/prow/hco-e2e-consecutive-operator-sdk-upgrades-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-consecutive-operator-sdk-upgrades-azure

In response to this:

hco-e2e-consecutive-operator-sdk-upgrades-aws lane succeeded.
/override ci/prow/hco-e2e-consecutive-operator-sdk-upgrades-azure

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 24, 2024

hco-e2e-consecutive-operator-sdk-upgrades-aws lane succeeded.
/override ci/prow/hco-e2e-consecutive-operator-sdk-upgrades-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-consecutive-operator-sdk-upgrades-azure

In response to this:

hco-e2e-consecutive-operator-sdk-upgrades-aws lane succeeded.
/override ci/prow/hco-e2e-consecutive-operator-sdk-upgrades-azure

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tiraboschi
Copy link
Member

/retest

Copy link

openshift-ci bot commented Jan 24, 2024

@nunnatsa: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/hco-e2e-upgrade-prev-operator-sdk-azure c3e0bfc link true /test hco-e2e-upgrade-prev-operator-sdk-azure
ci/prow/hco-e2e-kv-smoke-azure c3e0bfc link true /test hco-e2e-kv-smoke-azure
ci/prow/hco-e2e-consecutive-operator-sdk-upgrades-azure c3e0bfc link true /test hco-e2e-consecutive-operator-sdk-upgrades-azure
ci/prow/hco-e2e-upgrade-prev-operator-sdk-sno-azure c3e0bfc link false /test hco-e2e-upgrade-prev-operator-sdk-sno-azure
ci/prow/hco-e2e-operator-sdk-azure c3e0bfc link true /test hco-e2e-operator-sdk-azure
ci/prow/hco-e2e-upgrade-operator-sdk-azure c3e0bfc link true /test hco-e2e-upgrade-operator-sdk-azure

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@nunnatsa
Copy link
Collaborator Author

hco-e2e-operator-sdk-aws and hco-e2e-operator-sdk-gcp lane passed
/override ci/prow/hco-e2e-operator-sdk-azure

co-e2e-upgrade-operator-sdk-aws lane passed
/override ci/prow/hco-e2e-upgrade-operator-sdk-azure

hco-e2e-upgrade-prev-operator-sdk-sno-aws lane passed
/override ci/prow/hco-e2e-upgrade-prev-operator-sdk-sno-azure

@kubevirt-bot
Copy link
Contributor

@nunnatsa: Overrode contexts on behalf of nunnatsa: ci/prow/hco-e2e-operator-sdk-azure, ci/prow/hco-e2e-upgrade-operator-sdk-azure, ci/prow/hco-e2e-upgrade-prev-operator-sdk-sno-azure

In response to this:

hco-e2e-operator-sdk-aws and hco-e2e-operator-sdk-gcp lane passed
/override ci/prow/hco-e2e-operator-sdk-azure

co-e2e-upgrade-operator-sdk-aws lane passed
/override ci/prow/hco-e2e-upgrade-operator-sdk-azure

hco-e2e-upgrade-prev-operator-sdk-sno-aws lane passed
/override ci/prow/hco-e2e-upgrade-prev-operator-sdk-sno-azure

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@kubevirt-bot kubevirt-bot merged commit 23218d2 into kubevirt:main Jan 25, 2024
4 checks passed
@nunnatsa nunnatsa deleted the add-aaq branch January 25, 2024 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants