├── .dockerignore ├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.md │ ├── membership.yml │ ├── proposal.md │ └── question.md ├── OWNERS ├── dependabot.yml ├── pull_request_template.md ├── stale.yml └── workflows │ ├── ci.yaml │ ├── e2e-k8s-1.22.yaml │ ├── e2e-k8s-1.24.yaml │ ├── e2e-k8s-1.28.yaml │ ├── e2e-k8s-latest.yaml │ ├── license.yml │ └── release.yml ├── .gitignore ├── .golangci.yml ├── .goreleaser.yaml ├── .license ├── README.md └── dependency_decisions.yml ├── .licenseignore ├── ADOPTERS.md ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── OWNERS ├── OWNERS_ALIASES ├── PROJECT ├── README-zh_CN.md ├── README.md ├── SECURITY.md ├── apis ├── OWNERS ├── analysis │ └── v1alpha1 │ │ ├── condition.go │ │ ├── groupversion_info.go │ │ ├── recommendation_types.go │ │ └── zz_generated.deepcopy.go ├── config │ └── v1alpha1 │ │ ├── cluster_colocation_profile_types.go │ │ ├── groupversion_info.go │ │ └── zz_generated.deepcopy.go ├── configuration │ ├── slo_controller_config.go │ └── zz_generated.deepcopy.go ├── doc.go ├── extension │ ├── cluster_colocation_profile.go │ ├── constants.go │ ├── coscheduling.go │ ├── cpu_normalization.go │ ├── cpu_normalization_test.go │ ├── deprecated.go │ ├── descheduling.go │ ├── device_share.go │ ├── device_share_test.go │ ├── elastic_quota.go │ ├── load_aware.go │ ├── multi_scheduler.go │ ├── node_colocation.go │ ├── node_qos.go │ ├── node_qos_test.go │ ├── node_reservation.go │ ├── node_reservation_test.go │ ├── node_resource_amplification.go │ ├── node_resource_amplification_test.go │ ├── numa_aware.go │ ├── operating_pod.go │ ├── preemption.go │ ├── preemption_test.go │ ├── preemption_utils.go │ ├── priority.go │ ├── priority_utils.go │ ├── priority_utils_test.go │ ├── qos.go │ ├── qos_utils.go │ ├── qos_utils_test.go │ ├── resctrl.go │ ├── resctrl_test.go │ ├── reservation.go │ ├── reservation_test.go │ ├── resource.go │ ├── resource_test.go │ ├── system_qos.go │ └── system_qos_test.go ├── quota │ └── v1alpha1 │ │ ├── elastic_quota_profile_types.go │ │ ├── groupversion_info.go │ │ └── zz_generated.deepcopy.go ├── runtime │ └── v1alpha1 │ │ ├── api.pb.go │ │ ├── api.proto │ │ └── api_grpc.pb.go ├── scheduling │ └── v1alpha1 │ │ ├── device_types.go │ │ ├── groupversion_info.go │ │ ├── pod_migration_job_types.go │ │ ├── reservation_types.go │ │ └── zz_generated.deepcopy.go ├── scheme │ └── scheme.go ├── slo │ └── v1alpha1 │ │ ├── groupversion_info.go │ │ ├── host_application.go │ │ ├── node.go │ │ ├── node_test.go │ │ ├── nodemetric_types.go │ │ ├── nodeslo_types.go │ │ ├── pod.go │ │ ├── resources.go │ │ ├── slo_extension.go │ │ └── zz_generated.deepcopy.go └── thirdparty │ └── scheduler-plugins │ ├── LICENSE │ └── pkg │ ├── apis │ └── scheduling │ │ ├── register.go │ │ └── v1alpha1 │ │ ├── doc.go │ │ ├── register.go │ │ ├── types.go │ │ └── zz_generated.deepcopy.go │ ├── generated │ ├── clientset │ │ └── versioned │ │ │ ├── clientset.go │ │ │ ├── doc.go │ │ │ ├── fake │ │ │ ├── clientset_generated.go │ │ │ ├── doc.go │ │ │ └── register.go │ │ │ ├── scheme │ │ │ ├── doc.go │ │ │ └── register.go │ │ │ └── typed │ │ │ └── scheduling │ │ │ └── v1alpha1 │ │ │ ├── doc.go │ │ │ ├── elasticquota.go │ │ │ ├── fake │ │ │ ├── doc.go │ │ │ ├── fake_elasticquota.go │ │ │ ├── fake_podgroup.go │ │ │ └── fake_scheduling_client.go │ │ │ ├── generated_expansion.go │ │ │ ├── podgroup.go │ │ │ └── scheduling_client.go │ ├── informers │ │ └── externalversions │ │ │ ├── factory.go │ │ │ ├── generic.go │ │ │ ├── internalinterfaces │ │ │ └── factory_interfaces.go │ │ │ └── scheduling │ │ │ ├── interface.go │ │ │ └── v1alpha1 │ │ │ ├── elasticquota.go │ │ │ ├── interface.go │ │ │ └── podgroup.go │ └── listers │ │ └── scheduling │ │ └── v1alpha1 │ │ ├── elasticquota.go │ │ ├── expansion_generated.go │ │ └── podgroup.go │ └── util │ ├── podgroup.go │ └── resource.go ├── cmd ├── OWNERS ├── koord-descheduler │ ├── app │ │ ├── config │ │ │ └── config.go │ │ ├── options │ │ │ ├── configfile.go │ │ │ ├── insecure_serving.go │ │ │ ├── options.go │ │ │ └── scheme.go │ │ └── server.go │ └── main.go ├── koord-manager │ ├── extensions │ │ └── extension.go │ ├── main.go │ └── options │ │ ├── controllers.go │ │ ├── options.go │ │ ├── options_test.go │ │ └── scheme.go ├── koord-runtime-proxy │ ├── main.go │ └── options │ │ └── options.go ├── koord-scheduler │ ├── app │ │ ├── config │ │ │ └── config.go │ │ ├── options │ │ │ ├── insecure_serving.go │ │ │ └── options.go │ │ └── server.go │ └── main.go └── koordlet │ ├── main.go │ └── options │ └── options.go ├── codecov.yml ├── config ├── OWNERS ├── certmanager │ ├── certificate.yaml │ ├── kustomization.yaml │ └── kustomizeconfig.yaml ├── crd │ ├── bases │ │ ├── analysis.koordinator.sh_recommendations.yaml │ │ ├── config.koordinator.sh_clustercolocationprofiles.yaml │ │ ├── quota.koordinator.sh_elasticquotaprofiles.yaml │ │ ├── scheduling.koordinator.sh_devices.yaml │ │ ├── scheduling.koordinator.sh_podmigrationjobs.yaml │ │ ├── scheduling.koordinator.sh_reservations.yaml │ │ ├── scheduling.sigs.k8s.io_elasticquotas.yaml │ │ ├── scheduling.sigs.k8s.io_podgroups.yaml │ │ ├── slo.koordinator.sh_nodemetrics.yaml │ │ ├── slo.koordinator.sh_nodeslos.yaml │ │ └── topology.node.k8s.io_noderesourcetopologies.yaml │ ├── kustomization.yaml │ ├── kustomizeconfig.yaml │ └── patches │ │ ├── cainjection_in_nodemetrics.yaml │ │ └── webhook_in_nodemetrics.yaml ├── default │ ├── kustomization.yaml │ └── manager_auth_proxy_patch.yaml ├── manager │ ├── descheduler-config.yaml │ ├── descheduler.yaml │ ├── koord-batch.yaml │ ├── koord-free.yaml │ ├── koord-mid.yaml │ ├── koord-prod.yaml │ ├── koordlet.yaml │ ├── kustomization.yaml │ ├── manager.yaml │ ├── scheduler-config.yaml │ ├── scheduler.yaml │ └── slo-controller-config.yaml ├── prometheus │ ├── kustomization.yaml │ └── monitor.yaml ├── rbac │ ├── auth_proxy_client_clusterrole.yaml │ ├── auth_proxy_role.yaml │ ├── auth_proxy_role_binding.yaml │ ├── auth_proxy_service.yaml │ ├── descheduler_role.yaml │ ├── descheduler_role_binding.yaml │ ├── koordlet.yaml │ ├── kustomization.yaml │ ├── leader_election_role.yaml │ ├── leader_election_role_binding.yaml │ ├── nodemetric_editor_role.yaml │ ├── nodemetric_viewer_role.yaml │ ├── role.yaml │ ├── role_binding.yaml │ ├── scheduler_role.yaml │ ├── scheduler_role_binding.yaml │ └── service_account.yaml ├── samples │ ├── analysis_v1aplha1_recommendation.yaml │ ├── scheduling_v1alpha1_reservation.yaml │ └── slo_v1alpha1_nodemetric.yaml └── webhook │ ├── kustomization.yaml │ ├── kustomizeconfig.yaml │ ├── manifests.yaml │ ├── patch_manifests.yaml │ └── service.yaml ├── docker ├── OWNERS ├── koord-descheduler.dockerfile ├── koord-manager.dockerfile ├── koord-runtimeproxy.dockerfile ├── koord-scheduler.dockerfile └── koordlet.dockerfile ├── docs ├── contributors │ ├── first-pr.md │ ├── good-pr.md │ └── logging.md ├── design-archive │ ├── koord-runtime-proxy-design-doc.md │ ├── koordlet-architecture.md │ ├── koordlet-runtime-hooks-mode.md │ └── koordlet-runtime-hooks.md ├── images │ ├── RuntimeProxy.png │ ├── arbitration-mechanism-design.svg │ ├── arbitration-mechanism-filter-design.svg │ ├── arbitration-mechanism-sort-design.svg │ ├── arbitration-mechanism-time-diagram.svg │ ├── cpu-normalization.svg │ ├── cpu-orchestration-seq-uml.svg │ ├── cpu-schedule-latency.svg │ ├── cpu-suppress.svg │ ├── dingtalk.png │ ├── ebpf.png │ ├── forecasting │ │ ├── forecast-closure.svg │ │ ├── forecast-grouping.svg │ │ ├── forecasting-collect.svg │ │ ├── forecasting-controller.svg │ │ ├── metric-apis.svg │ │ ├── metric-exporters.svg │ │ └── metric-on-node.svg │ ├── koord-runtime-proxy-architecture.svg │ ├── koord-runtime-proxy-design.svg │ ├── koord-scheduler-framework-ext.png │ ├── koordetector.jpg │ ├── koordinator-logo.jpeg │ ├── koordlet-arch.svg │ ├── koordlet-hooks-running-mode.svg │ ├── llc-isolation.svg │ ├── load-aware-scheduling-arch.svg │ ├── multi-quota-tree.jpg │ ├── netqos-tc.jpg │ ├── node-prediction.svg │ ├── node-resource-model.png │ ├── noderesource-framework.svg │ ├── nri-proposal.png │ ├── nri.png │ ├── numa-topology-hint-provider.svg │ ├── nvlink.jpg │ ├── proxy.png │ ├── qos-cpu-orchestration.png │ ├── qos-manager.svg │ ├── quotaguarantee1.jpg │ ├── quotaguarantee2.jpg │ ├── quotatree.jpg │ ├── quotatree1.jpg │ ├── quotatree2.jpg │ ├── quotatree3.jpg │ ├── quotatree4.jpg │ ├── resctrl.png │ ├── resource-executor.svg │ ├── resource-reservation.svg │ ├── runtime-hooks-arch.svg │ ├── runtime-hooks-modules.svg │ ├── runtime-hooks-working-mode.svg │ ├── runtimequota1.jpg │ ├── runtimequota2.jpg │ ├── runtimequota3.jpg │ ├── runtimequota4.jpg │ ├── standalone.png │ ├── support-cold-memory-1.svg │ ├── support-cold-memory-2.svg │ ├── system-resource.svg │ ├── tcplugin.png │ └── thread-state-transition.svg ├── proposals │ ├── 20220402-improve-the-efficiency-of-nodemetric.md │ ├── 20221205-cpu-schedule-latency.md │ ├── 20221205-new-repo-koordetector.md │ ├── 20230608-nri-mode-resource-management.md │ ├── 20230613-node-prediction.md │ ├── YYYYMMDD-template.md │ ├── api-machinery │ │ ├── 20220707-rename-extended-resource.md │ │ └── 20230707-add-compatibility-interface-for-priority-class.md │ ├── forecasting │ │ └── 20230613-framework-of-prediction-and-detection.md │ ├── koordlet │ │ ├── 20220615-qos-manager.md │ │ ├── 20221018-koordlet-support-cgroups-v2.md │ │ ├── 20230728-support-cold-memory-compute.md │ │ ├── 20231208-support-netqos.md │ │ ├── 20231227-koordlet-resctrl-qos-enhance.md │ │ └── 20241210-pod-resources-proxy.md │ └── scheduling │ │ ├── 20220510-load-aware-scheduling.md │ │ ├── 20220513-enhanced-scheduler-extension.md │ │ ├── 20220530-fine-grained-cpu-orchestration.md │ │ ├── 20220609-resource-reservation.md │ │ ├── 20220629-fine-grained-device-scheduling.md │ │ ├── 20220701-pod-migration-job.md │ │ ├── 20220701-simple-descheduler-framework.md │ │ ├── 20220722-multi-hierarchy-elastic-quota-management.md │ │ ├── 20220901-gang-scheduling.md │ │ ├── 20221227-node-resource-reservation.md │ │ ├── 20230415-numa-topology-scheduling.md │ │ ├── 20230707-eviction-arbitrate-mechanism-in-descheduler.md │ │ ├── 20230802-device-share-supports-scoring.md │ │ ├── 20230803-device-allocate-hint-apis.md │ │ ├── 20230803-enhance-gpu-share-api.md │ │ ├── 20230811-node-resource-amplification.md │ │ ├── 20230831-cpu-normalization.md │ │ ├── 20240115-support-job-level-preemption.md │ │ ├── 20240131-pod-level-numa-policy.md │ │ ├── 20240201-enbale-reservation-preempt.md │ │ ├── 20240206-multi-tree-quota.md │ │ └── 20241008-gpu-partition-api.md └── slides │ └── koordinator-CPU-Co-location.pptx ├── embargo-policy.md ├── examples ├── OWNERS ├── nginx │ └── nginx.yaml ├── runtime-hook-server │ └── koordlet.json ├── spark-jobs │ ├── cluster-colocation-profile.yaml │ ├── service-account.yaml │ ├── spark-pi.yaml │ ├── spark-tc-complex.yaml │ └── spark-tc-simple.yaml └── spark-operator-chart │ ├── .helmignore │ ├── Chart.yaml │ ├── README.md │ ├── README.md.gotmpl │ ├── ci │ └── ci-values.yaml │ ├── crds │ ├── sparkoperator.k8s.io_scheduledsparkapplications.yaml │ └── sparkoperator.k8s.io_sparkapplications.yaml │ ├── templates │ ├── _helpers.tpl │ ├── deployment.yaml │ ├── prometheus-podmonitor.yaml │ ├── rbac.yaml │ ├── serviceaccount.yaml │ ├── spark-rbac.yaml │ ├── spark-serviceaccount.yaml │ ├── webhook-cleanup-job.yaml │ ├── webhook-init-job.yaml │ └── webhook-service.yaml │ └── values.yaml ├── go.mod ├── go.sum ├── hack ├── OWNERS ├── boilerplate │ └── boilerplate.go.txt ├── deploy_kind.sh ├── generate-groups.sh ├── generate-internal-groups.sh ├── generate-runtime.sh ├── kustomize.sh ├── libpfm.sh ├── mock-gen.sh ├── run-test.sh ├── tools.go ├── update-codegen.sh └── update-license-header.sh ├── pkg ├── client │ ├── OWNERS │ ├── clientset │ │ └── versioned │ │ │ ├── clientset.go │ │ │ ├── doc.go │ │ │ ├── fake │ │ │ ├── clientset_generated.go │ │ │ ├── doc.go │ │ │ └── register.go │ │ │ ├── scheme │ │ │ ├── doc.go │ │ │ └── register.go │ │ │ └── typed │ │ │ ├── analysis │ │ │ └── v1alpha1 │ │ │ │ ├── analysis_client.go │ │ │ │ ├── doc.go │ │ │ │ ├── fake │ │ │ │ ├── doc.go │ │ │ │ ├── fake_analysis_client.go │ │ │ │ └── fake_recommendation.go │ │ │ │ ├── generated_expansion.go │ │ │ │ └── recommendation.go │ │ │ ├── config │ │ │ └── v1alpha1 │ │ │ │ ├── clustercolocationprofile.go │ │ │ │ ├── config_client.go │ │ │ │ ├── doc.go │ │ │ │ ├── fake │ │ │ │ ├── doc.go │ │ │ │ ├── fake_clustercolocationprofile.go │ │ │ │ └── fake_config_client.go │ │ │ │ └── generated_expansion.go │ │ │ ├── quota │ │ │ └── v1alpha1 │ │ │ │ ├── doc.go │ │ │ │ ├── elasticquotaprofile.go │ │ │ │ ├── fake │ │ │ │ ├── doc.go │ │ │ │ ├── fake_elasticquotaprofile.go │ │ │ │ └── fake_quota_client.go │ │ │ │ ├── generated_expansion.go │ │ │ │ └── quota_client.go │ │ │ ├── scheduling │ │ │ └── v1alpha1 │ │ │ │ ├── device.go │ │ │ │ ├── doc.go │ │ │ │ ├── fake │ │ │ │ ├── doc.go │ │ │ │ ├── fake_device.go │ │ │ │ ├── fake_podmigrationjob.go │ │ │ │ ├── fake_reservation.go │ │ │ │ └── fake_scheduling_client.go │ │ │ │ ├── generated_expansion.go │ │ │ │ ├── podmigrationjob.go │ │ │ │ ├── reservation.go │ │ │ │ └── scheduling_client.go │ │ │ └── slo │ │ │ └── v1alpha1 │ │ │ ├── doc.go │ │ │ ├── fake │ │ │ ├── doc.go │ │ │ ├── fake_nodemetric.go │ │ │ ├── fake_nodeslo.go │ │ │ └── fake_slo_client.go │ │ │ ├── generated_expansion.go │ │ │ ├── nodemetric.go │ │ │ ├── nodeslo.go │ │ │ └── slo_client.go │ ├── generic_client.go │ ├── informers │ │ └── externalversions │ │ │ ├── analysis │ │ │ ├── interface.go │ │ │ └── v1alpha1 │ │ │ │ ├── interface.go │ │ │ │ └── recommendation.go │ │ │ ├── config │ │ │ ├── interface.go │ │ │ └── v1alpha1 │ │ │ │ ├── clustercolocationprofile.go │ │ │ │ └── interface.go │ │ │ ├── factory.go │ │ │ ├── generic.go │ │ │ ├── internalinterfaces │ │ │ └── factory_interfaces.go │ │ │ ├── quota │ │ │ ├── interface.go │ │ │ └── v1alpha1 │ │ │ │ ├── elasticquotaprofile.go │ │ │ │ └── interface.go │ │ │ ├── scheduling │ │ │ ├── interface.go │ │ │ └── v1alpha1 │ │ │ │ ├── device.go │ │ │ │ ├── interface.go │ │ │ │ ├── podmigrationjob.go │ │ │ │ └── reservation.go │ │ │ └── slo │ │ │ ├── interface.go │ │ │ └── v1alpha1 │ │ │ ├── interface.go │ │ │ ├── nodemetric.go │ │ │ └── nodeslo.go │ ├── listers │ │ ├── analysis │ │ │ └── v1alpha1 │ │ │ │ ├── expansion_generated.go │ │ │ │ └── recommendation.go │ │ ├── config │ │ │ └── v1alpha1 │ │ │ │ ├── clustercolocationprofile.go │ │ │ │ └── expansion_generated.go │ │ ├── quota │ │ │ └── v1alpha1 │ │ │ │ ├── elasticquotaprofile.go │ │ │ │ └── expansion_generated.go │ │ ├── scheduling │ │ │ └── v1alpha1 │ │ │ │ ├── device.go │ │ │ │ ├── expansion_generated.go │ │ │ │ ├── podmigrationjob.go │ │ │ │ └── reservation.go │ │ └── slo │ │ │ └── v1alpha1 │ │ │ ├── expansion_generated.go │ │ │ ├── nodemetric.go │ │ │ └── nodeslo.go │ └── registry.go ├── controller │ └── colocationprofile │ │ ├── colocationprofile_controller.go │ │ ├── colocationprofile_controller_test.go │ │ ├── colocationprofile_util.go │ │ └── colocationprofile_util_test.go ├── descheduler │ ├── OWNERS │ ├── apis │ │ └── config │ │ │ ├── doc.go │ │ │ ├── floatstr.go │ │ │ ├── register.go │ │ │ ├── scheme │ │ │ └── scheme.go │ │ │ ├── types.go │ │ │ ├── types_loadaware.go │ │ │ ├── types_pluginargs.go │ │ │ ├── v1alpha2 │ │ │ ├── conversion.go │ │ │ ├── conversion_plugins.go │ │ │ ├── default_plugins.go │ │ │ ├── defaults.go │ │ │ ├── defaults_test.go │ │ │ ├── doc.go │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── types_loadaware.go │ │ │ ├── types_pluginargs.go │ │ │ ├── zz_generated.conversion.go │ │ │ ├── zz_generated.deepcopy.go │ │ │ └── zz_generated.defaults.go │ │ │ ├── validation │ │ │ ├── validation.go │ │ │ ├── validation_loadaware.go │ │ │ ├── validation_loadaware_test.go │ │ │ ├── validation_pluginargs.go │ │ │ ├── validation_pluginargs_test.go │ │ │ └── validation_test.go │ │ │ └── zz_generated.deepcopy.go │ ├── controllers │ │ ├── migration │ │ │ ├── arbitrator │ │ │ │ ├── arbitrator.go │ │ │ │ ├── arbitrator_test.go │ │ │ │ ├── filter.go │ │ │ │ ├── filter_test.go │ │ │ │ ├── handler.go │ │ │ │ ├── sort.go │ │ │ │ └── sort_test.go │ │ │ ├── assumed_cache.go │ │ │ ├── assumed_cache_test.go │ │ │ ├── context.go │ │ │ ├── context_test.go │ │ │ ├── controller.go │ │ │ ├── controller_test.go │ │ │ ├── controllerfinder │ │ │ │ ├── controller_finder.go │ │ │ │ ├── pods_finder.go │ │ │ │ └── pods_finder_test.go │ │ │ ├── evict.go │ │ │ ├── evictor │ │ │ │ ├── evictor_delete.go │ │ │ │ ├── evictor_native.go │ │ │ │ ├── evictor_soft.go │ │ │ │ ├── evictor_soft_test.go │ │ │ │ └── interpreter.go │ │ │ ├── reservation │ │ │ │ ├── interpreter.go │ │ │ │ ├── reservation.go │ │ │ │ ├── types.go │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ │ └── util │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── names │ │ │ └── names.go │ │ ├── options │ │ │ └── manager.go │ │ └── registry.go │ ├── descheduler.go │ ├── evictions │ │ ├── eviction_limiter.go │ │ ├── evictions.go │ │ └── evictions_test.go │ ├── fieldindex │ │ └── register.go │ ├── framework │ │ ├── plugins │ │ │ ├── kubernetes │ │ │ │ ├── adaptor │ │ │ │ │ ├── evictor.go │ │ │ │ │ └── framework.go │ │ │ │ ├── defaultevictor │ │ │ │ │ └── evictor.go │ │ │ │ ├── plugin.go │ │ │ │ └── plugin_test.go │ │ │ ├── loadaware │ │ │ │ ├── low_node_load.go │ │ │ │ ├── low_node_load_test.go │ │ │ │ ├── utilization_util.go │ │ │ │ └── utilization_util_test.go │ │ │ └── registry.go │ │ ├── runtime │ │ │ ├── evictor_proxy.go │ │ │ ├── framework.go │ │ │ ├── framework_test.go │ │ │ ├── registry.go │ │ │ └── registry_test.go │ │ ├── testing │ │ │ └── framework_helpers.go │ │ └── types.go │ ├── informers │ │ ├── factory.go │ │ └── generic.go │ ├── metrics │ │ └── metrics.go │ ├── node │ │ ├── node.go │ │ └── node_test.go │ ├── pod │ │ ├── pods.go │ │ └── pods_test.go │ ├── profile │ │ ├── profile.go │ │ └── profile_test.go │ ├── test │ │ └── test_utils.go │ └── utils │ │ ├── anomaly │ │ ├── basic_detector.go │ │ ├── basic_detector_test.go │ │ ├── counter.go │ │ └── types.go │ │ ├── pod.go │ │ ├── pod_test.go │ │ ├── predicates.go │ │ ├── predicates_test.go │ │ ├── priority.go │ │ ├── priority_test.go │ │ └── sorter │ │ ├── helper.go │ │ ├── pod.go │ │ ├── pod_test.go │ │ ├── scorer.go │ │ └── scorer_test.go ├── features │ ├── OWNERS │ ├── features.go │ ├── koordlet_features.go │ ├── koordlet_features_test.go │ └── scheduler_features.go ├── koordlet │ ├── OWNERS │ ├── audit │ │ ├── auditor.go │ │ ├── auditor_test.go │ │ ├── config.go │ │ ├── config_test.go │ │ ├── event_logger.go │ │ ├── event_logger_test.go │ │ ├── logger.go │ │ ├── logger_test.go │ │ └── types.go │ ├── config │ │ ├── config.go │ │ └── config_test.go │ ├── extension │ │ └── interface.go │ ├── koordlet.go │ ├── koordlet_test.go │ ├── metriccache │ │ ├── api.go │ │ ├── config.go │ │ ├── config_test.go │ │ ├── kv_storage.go │ │ ├── kv_storage_test.go │ │ ├── metric_cache.go │ │ ├── metric_resources.go │ │ ├── metric_resources_test.go │ │ ├── metric_result.go │ │ ├── metric_types.go │ │ ├── mockmetriccache │ │ │ ├── mock.go │ │ │ ├── mock_kv_storage.go │ │ │ ├── mock_metric_result.go │ │ │ └── mock_tsdb_storage.go │ │ ├── tsdb_storage.go │ │ ├── tsdb_storage_test.go │ │ ├── util.go │ │ └── util_test.go │ ├── metrics │ │ ├── common.go │ │ ├── core_sched.go │ │ ├── cpi.go │ │ ├── cpu_burst.go │ │ ├── cpu_suppress.go │ │ ├── external_metrics.go │ │ ├── host_application.go │ │ ├── internal_metrics.go │ │ ├── kubelet.go │ │ ├── metrics.go │ │ ├── metrics_test.go │ │ ├── prediction.go │ │ ├── psi.go │ │ ├── psi_test.go │ │ ├── resctrl.go │ │ ├── resource_executor.go │ │ ├── resource_summary.go │ │ └── runtime_hook.go │ ├── metricsadvisor │ │ ├── collectors │ │ │ ├── beresource │ │ │ │ ├── be_resource_collector.go │ │ │ │ └── be_resource_collector_test.go │ │ │ ├── coldmemoryresource │ │ │ │ ├── cold_page_collector.go │ │ │ │ ├── cold_page_collector_test.go │ │ │ │ ├── cold_page_kidled.go │ │ │ │ └── cold_page_kidled_test.go │ │ │ ├── hostapplication │ │ │ │ ├── host_app_collector.go │ │ │ │ └── host_app_collector_test.go │ │ │ ├── nodeinfo │ │ │ │ ├── node_info_collector.go │ │ │ │ └── node_info_collector_test.go │ │ │ ├── noderesource │ │ │ │ ├── node_resource_collector.go │ │ │ │ └── node_resource_collector_test.go │ │ │ ├── nodestorageinfo │ │ │ │ └── node_info_collector.go │ │ │ ├── pagecache │ │ │ │ ├── page_cache_collector.go │ │ │ │ └── page_cache_collector_test.go │ │ │ ├── performance │ │ │ │ ├── performance_collector.go │ │ │ │ ├── performance_collector_linux.go │ │ │ │ ├── performance_collector_linux_test.go │ │ │ │ └── performance_collector_unsupported.go │ │ │ ├── podresource │ │ │ │ ├── pod_resource_collector.go │ │ │ │ └── pod_resource_collector_test.go │ │ │ ├── podthrottled │ │ │ │ ├── pod_throttled_collector.go │ │ │ │ └── pod_throttled_collector_test.go │ │ │ ├── resctrl │ │ │ │ ├── resctrl_collector.go │ │ │ │ └── resctrl_collector_test.go │ │ │ └── sysresource │ │ │ │ ├── system_resource_collector.go │ │ │ │ └── system_resource_collector_test.go │ │ ├── devices │ │ │ ├── gpu │ │ │ │ ├── collector_gpu.go │ │ │ │ ├── collector_gpu_linux.go │ │ │ │ ├── collector_gpu_linux_test.go │ │ │ │ └── collector_gpu_unsupported.go │ │ │ ├── helper │ │ │ │ ├── topology.go │ │ │ │ └── topology_test.go │ │ │ └── rdma │ │ │ │ ├── collector_rdma.go │ │ │ │ ├── collector_rdma_linux.go │ │ │ │ └── collector_rdma_unsupported.go │ │ ├── framework │ │ │ ├── config.go │ │ │ ├── config_test.go │ │ │ ├── context.go │ │ │ ├── context_test.go │ │ │ ├── options.go │ │ │ ├── plugin.go │ │ │ ├── pod_filter.go │ │ │ └── pod_filter_test.go │ │ ├── metrics_advisor.go │ │ ├── metrics_advisor_test.go │ │ └── plugins_profile.go │ ├── pleg │ │ ├── pleg.go │ │ ├── pleg_test.go │ │ ├── watcher.go │ │ ├── watcher_linux.go │ │ ├── watcher_linux_test.go │ │ └── watcher_other.go │ ├── prediction │ │ ├── checkpoint.go │ │ ├── checkpoint_test.go │ │ ├── config.go │ │ ├── config_test.go │ │ ├── peak_predictor.go │ │ ├── peak_predictor_test.go │ │ ├── predict_server.go │ │ ├── predict_server_test.go │ │ ├── prediction.go │ │ └── prediction_test.go │ ├── qosmanager │ │ ├── framework │ │ │ ├── config.go │ │ │ ├── config_test.go │ │ │ ├── context.go │ │ │ ├── context_test.go │ │ │ ├── extension.go │ │ │ ├── options.go │ │ │ ├── pod_qos_control.go │ │ │ └── strategy.go │ │ ├── helpers │ │ │ ├── calculator.go │ │ │ ├── calculator_test.go │ │ │ ├── metrics_query.go │ │ │ ├── metrics_query_test.go │ │ │ ├── operation.go │ │ │ ├── property.go │ │ │ ├── property_test.go │ │ │ └── reason.go │ │ ├── plugins │ │ │ ├── blkio │ │ │ │ ├── blkio_reconcile.go │ │ │ │ └── blkio_reconcile_test.go │ │ │ ├── cgreconcile │ │ │ │ ├── cgroup_reconcile.go │ │ │ │ └── cgroup_reconcile_test.go │ │ │ ├── cpuburst │ │ │ │ ├── cpu_burst.go │ │ │ │ └── cpu_burst_test.go │ │ │ ├── cpuevict │ │ │ │ ├── cpu_evict.go │ │ │ │ └── cpu_evict_test.go │ │ │ ├── cpusuppress │ │ │ │ ├── cpu_suppress.go │ │ │ │ └── cpu_suppress_test.go │ │ │ ├── memoryevict │ │ │ │ ├── memory_evict.go │ │ │ │ └── memory_evict_test.go │ │ │ ├── register.go │ │ │ ├── resctrl │ │ │ │ ├── resctrl_reconcile.go │ │ │ │ └── resctrl_reconcile_test.go │ │ │ └── sysreconcile │ │ │ │ ├── system_config.go │ │ │ │ └── system_config_test.go │ │ ├── qosmanager.go │ │ └── qosmanager_test.go │ ├── resourceexecutor │ │ ├── cgroup.go │ │ ├── cgroup_test.go │ │ ├── config.go │ │ ├── config_test.go │ │ ├── executor.go │ │ ├── executor_test.go │ │ ├── reader.go │ │ ├── reader_test.go │ │ ├── resctrl.go │ │ ├── resctrl_test.go │ │ ├── resctrl_updater.go │ │ ├── resctrl_updater_test.go │ │ ├── updater.go │ │ └── updater_test.go │ ├── runtimehooks │ │ ├── config.go │ │ ├── config_test.go │ │ ├── hooks │ │ │ ├── batchresource │ │ │ │ ├── batch_resource.go │ │ │ │ ├── batch_resource_test.go │ │ │ │ ├── rule.go │ │ │ │ └── rule_test.go │ │ │ ├── coresched │ │ │ │ ├── cookie_cache.go │ │ │ │ ├── cookie_cache_test.go │ │ │ │ ├── core_sched.go │ │ │ │ ├── core_sched_test.go │ │ │ │ ├── helper.go │ │ │ │ ├── helper_test.go │ │ │ │ ├── rule.go │ │ │ │ └── rule_test.go │ │ │ ├── cpunormalization │ │ │ │ ├── cpu_normalization.go │ │ │ │ ├── cpu_normalization_test.go │ │ │ │ ├── rule.go │ │ │ │ └── rule_test.go │ │ │ ├── cpuset │ │ │ │ ├── cpuset.go │ │ │ │ ├── cpuset_test.go │ │ │ │ ├── rule.go │ │ │ │ └── rule_test.go │ │ │ ├── gpu │ │ │ │ ├── gpu.go │ │ │ │ └── gpu_test.go │ │ │ ├── groupidentity │ │ │ │ ├── bvt.go │ │ │ │ ├── bvt_test.go │ │ │ │ ├── interceptor.go │ │ │ │ ├── interceptor_test.go │ │ │ │ ├── rule.go │ │ │ │ └── rule_test.go │ │ │ ├── hooks.go │ │ │ ├── rdma │ │ │ │ └── rdma.go │ │ │ ├── resctrl │ │ │ │ ├── resctrl.go │ │ │ │ ├── resctrl_test.go │ │ │ │ ├── rule.go │ │ │ │ ├── updater.go │ │ │ │ └── updater_test.go │ │ │ ├── tc │ │ │ │ ├── helper.go │ │ │ │ ├── helper_test.go │ │ │ │ ├── ipset.go │ │ │ │ ├── iptables.go │ │ │ │ ├── netqos_tc.go │ │ │ │ ├── rule.go │ │ │ │ ├── tc.go │ │ │ │ ├── tc_linux.go │ │ │ │ └── tc_linux_test.go │ │ │ └── terwayqos │ │ │ │ ├── terwayqos.go │ │ │ │ ├── terwayqos_test.go │ │ │ │ ├── types.go │ │ │ │ └── types_test.go │ │ ├── nri │ │ │ ├── server.go │ │ │ └── server_test.go │ │ ├── protocol │ │ │ ├── container_context.go │ │ │ ├── container_context_test.go │ │ │ ├── filters.go │ │ │ ├── filters_test.go │ │ │ ├── host_qos_context.go │ │ │ ├── kubeqos_context.go │ │ │ ├── pod_context.go │ │ │ ├── pod_context_test.go │ │ │ ├── protocol.go │ │ │ └── protocol_test.go │ │ ├── proxyserver │ │ │ ├── server.go │ │ │ ├── service.go │ │ │ └── service_test.go │ │ ├── reconciler │ │ │ ├── host_app_reconciler.go │ │ │ ├── host_app_reconciler_test.go │ │ │ ├── reconciler.go │ │ │ └── reconciler_test.go │ │ ├── rule │ │ │ ├── inject.go │ │ │ └── rule.go │ │ ├── runtimehooks.go │ │ └── runtimehooks_test.go │ ├── statesinformer │ │ ├── api.go │ │ ├── impl │ │ │ ├── callback_runner.go │ │ │ ├── callback_runner_test.go │ │ │ ├── config.go │ │ │ ├── config_test.go │ │ │ ├── extension_utils.go │ │ │ ├── kubelet_stub.go │ │ │ ├── kubelet_stub_test.go │ │ │ ├── registry.go │ │ │ ├── states_device_linux.go │ │ │ ├── states_device_linux_test.go │ │ │ ├── states_device_unsupported.go │ │ │ ├── states_informer.go │ │ │ ├── states_informer_test.go │ │ │ ├── states_node.go │ │ │ ├── states_node_test.go │ │ │ ├── states_nodemetric.go │ │ │ ├── states_nodemetric_test.go │ │ │ ├── states_noderesourcetopology.go │ │ │ ├── states_noderesourcetopology_test.go │ │ │ ├── states_nodeslo.go │ │ │ ├── states_nodeslo_test.go │ │ │ ├── states_pod_resources.go │ │ │ ├── states_pod_resources_test.go │ │ │ ├── states_pods.go │ │ │ ├── states_pods_test.go │ │ │ └── states_pvc.go │ │ └── mockstatesinformer │ │ │ └── mock.go │ └── util │ │ ├── cgroup_parent_utils.go │ │ ├── cgroup_parent_utils_test.go │ │ ├── cold_page.go │ │ ├── cold_page_test.go │ │ ├── container.go │ │ ├── container_test.go │ │ ├── cpuinfo.go │ │ ├── cpuinfo_test.go │ │ ├── device.go │ │ ├── host_application.go │ │ ├── host_application_test.go │ │ ├── kubelet │ │ ├── cpu_assignment.go │ │ ├── cpu_assignment_test.go │ │ ├── kubelet.go │ │ ├── kubelet_resource_client.go │ │ ├── kubelet_test.go │ │ └── policy_test.go │ │ ├── meminfo.go │ │ ├── meminfo_test.go │ │ ├── node.go │ │ ├── node_test.go │ │ ├── perf │ │ ├── perf_linux.go │ │ ├── perf_linux_test.go │ │ └── perf_unsupported.go │ │ ├── perf_group │ │ ├── perf_group_linux.go │ │ ├── perf_group_linux_test.go │ │ └── perf_group_unsupported.go │ │ ├── pod.go │ │ ├── pod_test.go │ │ ├── resctrl │ │ ├── ctrl_mgr.go │ │ ├── ctrl_mgr_test.go │ │ ├── resctrl.go │ │ └── resctrl_test.go │ │ ├── runtime │ │ ├── handler │ │ │ ├── containerd_runtime.go │ │ │ ├── containerd_runtime_test.go │ │ │ ├── crio_runtime.go │ │ │ ├── crio_runtime_test.go │ │ │ ├── docker_runtime.go │ │ │ ├── docker_runtime_test.go │ │ │ ├── fake_runtime.go │ │ │ ├── interface.go │ │ │ ├── mockclient │ │ │ │ └── mock.go │ │ │ ├── pouch_runtime.go │ │ │ └── pouch_runtime_test.go │ │ ├── runtime.go │ │ └── runtime_test.go │ │ ├── stat.go │ │ ├── stat_test.go │ │ ├── storageinfo.go │ │ ├── storageinfo_test.go │ │ ├── system │ │ ├── cgroup.go │ │ ├── cgroup2.go │ │ ├── cgroup2_test.go │ │ ├── cgroup_driver.go │ │ ├── cgroup_driver_linux.go │ │ ├── cgroup_driver_linux_test.go │ │ ├── cgroup_driver_test.go │ │ ├── cgroup_driver_unsupported.go │ │ ├── cgroup_resource.go │ │ ├── cgroup_resource_test.go │ │ ├── cgroup_test.go │ │ ├── common.go │ │ ├── common_linux.go │ │ ├── common_linux_test.go │ │ ├── common_test.go │ │ ├── common_unsupported.go │ │ ├── config.go │ │ ├── config_test.go │ │ ├── core_sched.go │ │ ├── core_sched_linux.go │ │ ├── core_sched_linux_test.go │ │ ├── core_sched_test.go │ │ ├── core_sched_unsupported.go │ │ ├── cpu_manager_linux.go │ │ ├── cpu_manager_unsupported.go │ │ ├── device_numbers_linux.go │ │ ├── device_numbers_unsupported.go │ │ ├── kidled_util.go │ │ ├── kidled_util_test.go │ │ ├── lscpu.go │ │ ├── lscpu_arm64.go │ │ ├── lscpu_arm64_test.go │ │ ├── proc.go │ │ ├── proc_test.go │ │ ├── psi.go │ │ ├── psi_test.go │ │ ├── resctrl.go │ │ ├── resctrl_linux.go │ │ ├── resctrl_linux_test.go │ │ ├── resctrl_test.go │ │ ├── resctrl_unsupported.go │ │ ├── resctrl_unsupported_test.go │ │ ├── resource.go │ │ ├── sriov.go │ │ ├── system_file.go │ │ ├── system_file_test.go │ │ ├── system_resource.go │ │ ├── system_resource_test.go │ │ ├── util_test_tool.go │ │ ├── util_test_tool_test.go │ │ ├── validator.go │ │ ├── validator_test.go │ │ ├── version.go │ │ └── version_test.go │ │ └── testutil │ │ └── mock_utils.go ├── prediction │ └── OWNERS ├── quota-controller │ └── profile │ │ ├── profile_controller.go │ │ ├── profile_controller_test.go │ │ └── util.go ├── runtimeproxy │ ├── OWNERS │ ├── client │ │ └── hookclient.go │ ├── config │ │ ├── config.go │ │ └── config_manager.go │ ├── dispatcher │ │ ├── dispatcher.go │ │ └── dispatcher_test.go │ ├── resexecutor │ │ ├── cri │ │ │ ├── container.go │ │ │ ├── container_test.go │ │ │ ├── pod.go │ │ │ ├── pod_test.go │ │ │ ├── utils.go │ │ │ └── utils_test.go │ │ ├── resource_executor.go │ │ └── resource_executor_test.go │ ├── server │ │ ├── cri │ │ │ ├── criserver.go │ │ │ ├── runtime.go │ │ │ └── utils.go │ │ ├── docker │ │ │ ├── handler.go │ │ │ ├── handler_test.go │ │ │ ├── server.go │ │ │ ├── server_test.go │ │ │ ├── utils.go │ │ │ └── utils_test.go │ │ ├── server.go │ │ └── types │ │ │ └── docker_types.go │ ├── store │ │ ├── manager.go │ │ └── manager_test.go │ └── utils │ │ ├── utils.go │ │ └── utils_test.go ├── scheduler │ ├── OWNERS │ ├── apis │ │ └── config │ │ │ ├── doc.go │ │ │ ├── register.go │ │ │ ├── scheme │ │ │ └── scheme.go │ │ │ ├── types.go │ │ │ ├── v1 │ │ │ ├── defaults.go │ │ │ ├── doc.go │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── zz_generated.conversion.go │ │ │ ├── zz_generated.deepcopy.go │ │ │ └── zz_generated.defaults.go │ │ │ ├── v1beta3 │ │ │ ├── conversion_plugin.go │ │ │ ├── defaults.go │ │ │ ├── doc.go │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── zz_generated.conversion.go │ │ │ ├── zz_generated.deepcopy.go │ │ │ └── zz_generated.defaults.go │ │ │ ├── validation │ │ │ └── validation_pluginargs.go │ │ │ └── zz_generated.deepcopy.go │ ├── doc.go │ ├── frameworkext │ │ ├── controllers.go │ │ ├── debug.go │ │ ├── debug_test.go │ │ ├── defaultprofile │ │ │ ├── profile.go │ │ │ └── profile_test.go │ │ ├── errorhandler_dispatcher.go │ │ ├── errorhandler_dispatcher_test.go │ │ ├── eventhandlers │ │ │ ├── reservation_handler.go │ │ │ └── reservation_handler_test.go │ │ ├── framework_extender.go │ │ ├── framework_extender_factory.go │ │ ├── framework_extender_factory_test.go │ │ ├── framework_extender_test.go │ │ ├── helper │ │ │ ├── forcesync_eventhandler.go │ │ │ ├── forcesync_eventhandler_test.go │ │ │ ├── forcesync_factory.go │ │ │ ├── forcesync_factory_test.go │ │ │ └── forcesync_informer.go │ │ ├── indexer │ │ │ ├── add_indexer.go │ │ │ ├── reservation.go │ │ │ └── reservation_test.go │ │ ├── informer │ │ │ ├── informers.go │ │ │ └── informers_test.go │ │ ├── interface.go │ │ ├── normalize_score.go │ │ ├── reservation_info.go │ │ ├── reservation_info_test.go │ │ ├── scheduler_adapter.go │ │ ├── scheduler_monitor.go │ │ ├── scheduler_monitor_test.go │ │ ├── schedulingphase │ │ │ └── scheduling_phase.go │ │ ├── services │ │ │ ├── services.go │ │ │ └── types.go │ │ ├── testing │ │ │ └── fake_reservation_nominator.go │ │ └── topologymanager │ │ │ ├── manager.go │ │ │ ├── policy.go │ │ │ ├── policy_best_effort.go │ │ │ ├── policy_best_effort_test.go │ │ │ ├── policy_none.go │ │ │ ├── policy_none_test.go │ │ │ ├── policy_restricted.go │ │ │ ├── policy_restricted_test.go │ │ │ ├── policy_single_numa_node.go │ │ │ ├── policy_single_numa_node_test.go │ │ │ ├── policy_test.go │ │ │ └── store.go │ ├── metrics │ │ └── metrics.go │ └── plugins │ │ ├── coscheduling │ │ ├── controller │ │ │ ├── podgroup.go │ │ │ └── podgroup_test.go │ │ ├── core │ │ │ ├── core.go │ │ │ ├── core_test.go │ │ │ ├── gang.go │ │ │ ├── gang_cache.go │ │ │ ├── gang_cache_test.go │ │ │ ├── gang_context.go │ │ │ ├── gang_summary.go │ │ │ └── ganggroup.go │ │ ├── coscheduling.go │ │ ├── coscheduling_test.go │ │ ├── plugin_controller.go │ │ ├── plugin_service.go │ │ ├── plugin_service_test.go │ │ └── util │ │ │ └── gang_helper.go │ │ ├── defaultprebind │ │ ├── plugin.go │ │ └── plugin_test.go │ │ ├── deviceshare │ │ ├── allocator_gpu.go │ │ ├── allocator_gpu_helper.go │ │ ├── allocator_gpu_helper_test.go │ │ ├── allocator_gpu_test.go │ │ ├── device_allocator.go │ │ ├── device_allocator_test.go │ │ ├── device_cache.go │ │ ├── device_cache_test.go │ │ ├── device_resources.go │ │ ├── device_resources_test.go │ │ ├── device_summary.go │ │ ├── devicehandler_default.go │ │ ├── devicehandler_default_test.go │ │ ├── devicehandler_gpu.go │ │ ├── devicehandler_gpu_test.go │ │ ├── eventhandler_device.go │ │ ├── eventhandler_device_test.go │ │ ├── eventhandler_pod.go │ │ ├── eventhandler_pod_test.go │ │ ├── numa_topology.go │ │ ├── plugin.go │ │ ├── plugin_test.go │ │ ├── reservation.go │ │ ├── reservation_test.go │ │ ├── scoring.go │ │ ├── scoring_test.go │ │ ├── service.go │ │ ├── service_test.go │ │ ├── topology_hint.go │ │ ├── topology_hint_test.go │ │ ├── utils.go │ │ └── utils_test.go │ │ ├── elasticquota │ │ ├── candidate.go │ │ ├── controller.go │ │ ├── controller_test.go │ │ ├── core │ │ │ ├── group_quota_manager.go │ │ │ ├── group_quota_manager_test.go │ │ │ ├── helper.go │ │ │ ├── helper_test.go │ │ │ ├── hook_plugin.go │ │ │ ├── hook_plugin_test.go │ │ │ ├── quota_info.go │ │ │ ├── quota_info_test.go │ │ │ ├── quota_summary.go │ │ │ ├── runtime_quota_calculator.go │ │ │ ├── runtime_quota_calculator_test.go │ │ │ ├── scale_minquota_when_over_root_res.go │ │ │ └── scale_minquota_when_over_root_res_test.go │ │ ├── hook_plugin_test.go │ │ ├── metrics.go │ │ ├── node_handler.go │ │ ├── node_handler_test.go │ │ ├── plugin.go │ │ ├── plugin_helper.go │ │ ├── plugin_helper_test.go │ │ ├── plugin_service.go │ │ ├── plugin_service_test.go │ │ ├── plugin_test.go │ │ ├── pod_handler.go │ │ ├── pod_handler_test.go │ │ ├── preempt.go │ │ ├── quota_handler.go │ │ ├── quota_handler_test.go │ │ ├── quota_overuse_revoke.go │ │ └── quota_overuse_revoke_test.go │ │ ├── loadaware │ │ ├── estimator │ │ │ ├── default_estimator.go │ │ │ ├── default_estimator_test.go │ │ │ └── types.go │ │ ├── helper.go │ │ ├── helper_test.go │ │ ├── load_aware.go │ │ ├── load_aware_test.go │ │ ├── pod_assign_cache.go │ │ └── pod_assign_cache_test.go │ │ ├── nodenumaresource │ │ ├── cpu_accumulator.go │ │ ├── cpu_accumulator_test.go │ │ ├── cpu_topology.go │ │ ├── least_allocated.go │ │ ├── most_allocated.go │ │ ├── node_allocation.go │ │ ├── node_allocation_test.go │ │ ├── plugin.go │ │ ├── plugin_test.go │ │ ├── pod_eventhandler.go │ │ ├── pod_eventhandler_test.go │ │ ├── preempt.go │ │ ├── preempt_test.go │ │ ├── reservation.go │ │ ├── resource_manager.go │ │ ├── resource_manager_test.go │ │ ├── scoring.go │ │ ├── scoring_test.go │ │ ├── service.go │ │ ├── service_test.go │ │ ├── topology_eventhandler.go │ │ ├── topology_hint.go │ │ ├── topology_hint_test.go │ │ ├── topology_options.go │ │ ├── topology_options_test.go │ │ ├── util.go │ │ └── util_test.go │ │ ├── noderesourcefitplus │ │ ├── node_resource_fit_plus_utils.go │ │ ├── node_resources_fit_plus.go │ │ └── node_resources_fit_plus_test.go │ │ ├── reservation │ │ ├── cache.go │ │ ├── cache_test.go │ │ ├── controller │ │ │ ├── controller.go │ │ │ ├── controller_test.go │ │ │ ├── garbage_collection.go │ │ │ ├── garbage_collection_test.go │ │ │ ├── node_eventhandler.go │ │ │ ├── pod_eventhandler.go │ │ │ └── reservation_eventhandler.go │ │ ├── eventhandler.go │ │ ├── eventhandler_test.go │ │ ├── nominator.go │ │ ├── nominator_test.go │ │ ├── plugin.go │ │ ├── plugin_test.go │ │ ├── pod_eventhandler.go │ │ ├── pod_eventhandler_test.go │ │ ├── preemption.go │ │ ├── preemption_test.go │ │ ├── scoring.go │ │ ├── scoring_test.go │ │ ├── service.go │ │ ├── service_test.go │ │ ├── transformer.go │ │ ├── transformer_benchmark_test.go │ │ └── transformer_test.go │ │ └── scarceresourceavoidance │ │ ├── scarce_resource_avoidance.go │ │ └── scarce_resource_avoidance_test.go ├── slo-controller │ ├── OWNERS │ ├── config │ │ ├── colocation_cm_event_handler.go │ │ ├── colocation_cm_event_handler_test.go │ │ ├── configmap_event_handler.go │ │ └── configmap_event_handler_test.go │ ├── metrics │ │ ├── common.go │ │ ├── metrics.go │ │ ├── metrics_test.go │ │ └── node_resource.go │ ├── nodemetric │ │ ├── collect_policy.go │ │ ├── collect_policy_test.go │ │ ├── node_event_handler.go │ │ ├── node_event_handler_test.go │ │ ├── nodemetric.go │ │ ├── nodemetric_controller.go │ │ └── nodemetric_controller_test.go │ ├── noderesource │ │ ├── framework │ │ │ ├── README.md │ │ │ ├── extender_plugin.go │ │ │ ├── extender_plugin_test.go │ │ │ ├── noderesource.go │ │ │ ├── option.go │ │ │ ├── option_test.go │ │ │ ├── registry.go │ │ │ └── registry_test.go │ │ ├── nodemetric_event_handler.go │ │ ├── nodemetric_event_handler_test.go │ │ ├── noderesource_controller.go │ │ ├── noderesource_controller_test.go │ │ ├── plugins │ │ │ ├── batchresource │ │ │ │ ├── noderesourcetopology_event_handler.go │ │ │ │ ├── noderesourcetopology_event_handler_test.go │ │ │ │ ├── plugin.go │ │ │ │ └── plugin_test.go │ │ │ ├── cpunormalization │ │ │ │ ├── configmap_event_handler.go │ │ │ │ ├── configmap_event_handler_test.go │ │ │ │ ├── noderesourcetopology_event_handler.go │ │ │ │ ├── noderesourcetopology_event_handler_test.go │ │ │ │ ├── plugin.go │ │ │ │ └── plugin_test.go │ │ │ ├── gpudeviceresource │ │ │ │ ├── device_event_handler.go │ │ │ │ ├── device_event_handler_test.go │ │ │ │ ├── plugin.go │ │ │ │ ├── plugin_test.go │ │ │ │ └── utils.go │ │ │ ├── midresource │ │ │ │ ├── plugin.go │ │ │ │ └── plugin_test.go │ │ │ ├── rdmadevicereource │ │ │ │ ├── device_event_handler.go │ │ │ │ ├── device_event_handler_test.go │ │ │ │ ├── plugin.go │ │ │ │ └── plugin_test.go │ │ │ ├── resourceamplification │ │ │ │ ├── configmap_event_handler.go │ │ │ │ ├── configmap_event_handler_test.go │ │ │ │ ├── plugin.go │ │ │ │ └── plugin_test.go │ │ │ └── util │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── plugins_profile.go │ │ ├── resource_calculator.go │ │ └── resource_calculator_test.go │ └── nodeslo │ │ ├── extender_config.go │ │ ├── extender_config_test.go │ │ ├── extender_plugin.go │ │ ├── extender_plugin_test.go │ │ ├── nodeslo_cm_event_handler.go │ │ ├── nodeslo_cm_event_handler_test.go │ │ ├── nodeslo_controller.go │ │ ├── nodeslo_controller_test.go │ │ ├── resource_strategy.go │ │ └── resource_strategy_test.go ├── util │ ├── OWNERS │ ├── asynclog │ │ └── async_log.go │ ├── bitmask │ │ ├── bitmask.go │ │ └── bitmask_test.go │ ├── cache │ │ ├── expiration_cache.go │ │ └── expiration_cache_test.go │ ├── client │ │ ├── delegating_client.go │ │ └── no_deepcopy_lister.go │ ├── container.go │ ├── container_test.go │ ├── cpuset │ │ ├── cpuset.go │ │ ├── cpuset_test.go │ │ ├── helper.go │ │ └── helper_test.go │ ├── extended_resource.go │ ├── extended_resource_test.go │ ├── feature.go │ ├── feature │ │ ├── feature_gate.go │ │ └── testing.go │ ├── fieldindex │ │ └── register.go │ ├── histogram │ │ ├── decaying_histogram.go │ │ ├── decaying_histogram_test.go │ │ ├── histogram.go │ │ ├── histogram_checkpoint.go │ │ ├── histogram_mock.go │ │ ├── histogram_options.go │ │ ├── histogram_options_test.go │ │ └── histogram_test.go │ ├── hostport.go │ ├── hostport_test.go │ ├── httputil │ │ ├── reverseproxy.go │ │ └── reverseproxy_test.go │ ├── json.go │ ├── json_test.go │ ├── metrics │ │ ├── expire_metric.go │ │ ├── expire_metric_test.go │ │ ├── koordmanager │ │ │ ├── leader.go │ │ │ └── registry.go │ │ ├── merged_gather.go │ │ └── merged_gather_test.go │ ├── metricsserver │ │ ├── metrics_client.go │ │ ├── metrics_client_test.go │ │ └── metrics_client_test_util.go │ ├── node.go │ ├── node_test.go │ ├── parallelize │ │ └── parallelism.go │ ├── pod.go │ ├── pod_evict.go │ ├── pod_qos_utils.go │ ├── pod_qos_utils_test.go │ ├── pod_resources_utils.go │ ├── pod_resources_utils_test.go │ ├── pod_test.go │ ├── reservation │ │ ├── reservation.go │ │ ├── reservation_test.go │ │ ├── reservation_to_pod_eventhandler.go │ │ └── reservation_to_pod_eventhandler_test.go │ ├── resource.go │ ├── resource_test.go │ ├── routes │ │ └── flags.go │ ├── selector.go │ ├── sloconfig │ │ ├── colocation_config.go │ │ ├── colocation_config_extender.go │ │ ├── colocation_config_extender_test.go │ │ ├── colocation_config_test.go │ │ ├── config.go │ │ ├── nodeslo_config.go │ │ ├── nodeslo_config_test.go │ │ ├── validator.go │ │ └── validator_test.go │ ├── testutil │ │ └── manager.go │ ├── transformer │ │ ├── device_transformer.go │ │ ├── device_transformer_test.go │ │ ├── elastic_quota_transformer.go │ │ ├── elastic_quota_transformer_test.go │ │ ├── node_transformer.go │ │ ├── node_transformer_test.go │ │ ├── pod_transformer.go │ │ ├── pod_transformer_test.go │ │ └── transformers.go │ ├── utils.go │ └── utils_test.go └── webhook │ ├── OWNERS │ ├── add_configmap.go │ ├── add_node.go │ ├── add_pod.go │ ├── add_quota.go │ ├── add_reservation.go │ ├── api_debug_server.go │ ├── cm │ ├── plugins │ │ ├── plugin.go │ │ └── sloconfig │ │ │ ├── checker.go │ │ │ ├── checker_test.go │ │ │ ├── checkers.go │ │ │ ├── checkers_test.go │ │ │ ├── colocation_checker.go │ │ │ ├── colocation_checker_test.go │ │ │ ├── cpu_burst_checker.go │ │ │ ├── cpu_burst_checker_test.go │ │ │ ├── resource_qos_checker.go │ │ │ ├── resource_qos_checker_test.go │ │ │ ├── resource_threshold_checker.go │ │ │ ├── resource_threshold_checker_test.go │ │ │ ├── result.go │ │ │ ├── selector.go │ │ │ ├── slo_config_plugin.go │ │ │ ├── slo_config_plugin_test.go │ │ │ ├── system_config_checker.go │ │ │ └── system_config_checker_test.go │ └── validating │ │ ├── validating_handler.go │ │ ├── validating_handler_test.go │ │ └── webhooks.go │ ├── elasticquota │ ├── mutating │ │ ├── mutating_handle_test.go │ │ ├── mutating_handler.go │ │ └── webhooks.go │ ├── plugin_check_quota_meta_validate.go │ ├── plugin_check_quota_meta_validate_test.go │ ├── pod_check.go │ ├── quota_handler.go │ ├── quota_handler_test.go │ ├── quota_info.go │ ├── quota_topology.go │ ├── quota_topology_check.go │ ├── quota_topology_test.go │ ├── util.go │ └── validating │ │ ├── validating_handler.go │ │ ├── validating_handler_test.go │ │ └── webhooks.go │ ├── metrics │ ├── elasticquota.go │ ├── elasticquota_test.go │ ├── internal_metrics.go │ ├── util.go │ ├── webhook_duration.go │ └── webhook_duration_test.go │ ├── node │ ├── mutating │ │ ├── mutating_handler.go │ │ ├── mutating_handler_test.go │ │ └── webhooks.go │ ├── plugins │ │ ├── plugin.go │ │ ├── resourceamplification │ │ │ ├── resource_amplification.go │ │ │ └── resource_amplification_test.go │ │ └── sloconfig │ │ │ ├── slo_plugin.go │ │ │ └── slo_plugin_test.go │ └── validating │ │ ├── validating_handler.go │ │ ├── validating_handler_test.go │ │ └── webhooks.go │ ├── pod │ ├── mutating │ │ ├── cluster_colocation_profile.go │ │ ├── cluster_colocation_profile_test.go │ │ ├── device_resource_spec.go │ │ ├── device_resource_spec_test.go │ │ ├── extended_resource_spec.go │ │ ├── extended_resource_spec_test.go │ │ ├── multi_quota_tree_affinity.go │ │ ├── multi_quota_tree_affinity_test.go │ │ ├── mutating_handler.go │ │ ├── mutating_handler_test.go │ │ └── webhooks.go │ └── validating │ │ ├── cluster_colocation_profile.go │ │ ├── cluster_colocation_profile_test.go │ │ ├── evaluate_quota.go │ │ ├── evaluate_quota_test.go │ │ ├── validating_handler.go │ │ ├── validating_handler_test.go │ │ ├── verify_annotations.go │ │ ├── verify_annotations_test.go │ │ ├── verify_device_resource.go │ │ ├── verify_device_resource_test.go │ │ └── webhooks.go │ ├── quotaevaluate │ ├── evaluator.go │ ├── evaluator_test.go │ ├── quota_accessor.go │ └── util.go │ ├── reservation │ └── mutating │ │ ├── cluster_colocation_profile.go │ │ ├── cluster_colocation_profile_test.go │ │ ├── mutaing_handler.go │ │ ├── mutating_handler_test.go │ │ └── webhooks.go │ ├── server.go │ └── util │ ├── configuration │ └── configuration.go │ ├── controller │ └── webhook_controller.go │ ├── err │ └── json_error.go │ ├── framework │ └── builder.go │ ├── generator │ ├── certgenerator.go │ ├── fake │ │ └── certgenerator.go │ ├── selfsigned.go │ └── util.go │ ├── health │ ├── checker.go │ └── handler.go │ ├── util.go │ └── writer │ ├── atomic │ └── atomic_writer.go │ ├── certwriter.go │ ├── error.go │ ├── fs.go │ └── secret.go └── test ├── OWNERS ├── e2e ├── README.md ├── common │ └── util.go ├── e2e-example-config.json ├── e2e.go ├── e2e_test.go ├── framework │ ├── OWNERS │ ├── auth │ │ └── helpers.go │ ├── cleanup.go │ ├── config │ │ ├── config.go │ │ └── config_test.go │ ├── deployment │ │ ├── fixtures.go │ │ └── wait.go │ ├── exec_util.go │ ├── expect.go │ ├── flake_reporting_util.go │ ├── framework.go │ ├── ginkgowrapper │ │ └── wrapper.go │ ├── kubectl │ │ └── kubectl_utils.go │ ├── kubesystem │ │ └── kubesystem.go │ ├── log.go │ ├── log │ │ └── logger.go │ ├── log_size_monitoring.go │ ├── log_test.go │ ├── manifest │ │ └── manifest.go │ ├── metrics │ │ ├── api.go │ │ ├── api_server_metrics.go │ │ ├── cluster_autoscaler_metrics.go │ │ ├── controller_manager_metrics.go │ │ ├── e2e_metrics.go │ │ ├── interesting_metrics.go │ │ ├── kubelet_metrics.go │ │ ├── latencies.go │ │ ├── metrics_grabber.go │ │ ├── pod.go │ │ ├── scheduler_metrics.go │ │ └── snapshot_controller_metrics.go │ ├── node │ │ ├── resource.go │ │ ├── runtimeclass.go │ │ ├── wait.go │ │ └── wait_test.go │ ├── nodes_util.go │ ├── pod │ │ ├── create.go │ │ ├── delete.go │ │ ├── dial.go │ │ ├── node_selection.go │ │ ├── resource.go │ │ ├── resource_test.go │ │ ├── utils.go │ │ └── wait.go │ ├── pods.go │ ├── ports.go │ ├── provider.go │ ├── providers │ │ └── kubemark │ │ │ └── kubemark.go │ ├── psp.go │ ├── replicaset │ │ ├── rest.go │ │ └── wait.go │ ├── resource_usage_gatherer.go │ ├── size.go │ ├── skipper │ │ └── skipper.go │ ├── ssh │ │ └── ssh.go │ ├── statefulset │ │ ├── const.go │ │ ├── fixtures.go │ │ ├── rest.go │ │ └── wait.go │ ├── test_context.go │ ├── testfiles │ │ ├── testdata │ │ │ └── a │ │ │ │ └── foo.txt │ │ ├── testfiles.go │ │ └── testfiles_test.go │ ├── timeouts.go │ └── util.go ├── generated │ └── bindata.go ├── perftype │ └── perftype.go ├── quota │ ├── framework.go │ ├── multi_tree.go │ ├── quota.go │ └── quota_guaranteed.go ├── reporters │ ├── progress.go │ └── testDetails.go ├── scheduling │ ├── OWNERS │ ├── deviceshare.go │ ├── framework.go │ ├── helper.go │ ├── hostport.go │ ├── nodenumaresource.go │ ├── preemption.go │ └── reservation.go ├── slocontroller │ ├── OWNERS │ ├── batchresource.go │ ├── cpunormalization.go │ └── framework.go ├── suites.go └── testing-manifests │ ├── README.md │ ├── embed.go │ ├── pod │ ├── rbd-storage-class.yaml │ ├── sample-device-plugin.yaml │ ├── scheduling │ ├── nvidia-driver-installer.yaml │ ├── simple-lsr-pod.yaml │ ├── simple-pod-with-reservation.yaml │ └── simple-reservation.yaml │ ├── slocontroller │ ├── be-demo.yaml │ └── slo-controller-config.yaml │ ├── statefulset │ ├── cassandra │ │ ├── controller.yaml │ │ ├── pdb.yaml │ │ ├── service.yaml │ │ ├── statefulset.yaml │ │ └── tester.yaml │ ├── cockroachdb │ │ ├── service.yaml │ │ └── statefulset.yaml │ ├── etcd │ │ ├── pdb.yaml │ │ ├── service.yaml │ │ ├── statefulset.yaml │ │ └── tester.yaml │ ├── mysql-galera │ │ ├── service.yaml │ │ └── statefulset.yaml │ ├── mysql-upgrade │ │ ├── configmap.yaml │ │ ├── service.yaml │ │ ├── statefulset.yaml │ │ └── tester.yaml │ ├── nginx │ │ ├── service.yaml │ │ └── statefulset.yaml │ ├── redis │ │ ├── service.yaml │ │ └── statefulset.yaml │ └── zookeeper │ │ ├── service.yaml │ │ └── statefulset.yaml │ └── storage-csi │ ├── any-volume-datasource │ ├── crd │ │ ├── hello-populator-crd.yaml │ │ └── populator.storage.k8s.io_volumepopulators.yaml │ ├── hello-populator-deploy.yaml │ └── volume-data-source-validator │ │ ├── rbac-data-source-validator.yaml │ │ └── setup-data-source-validator.yaml │ ├── controller-role.yaml │ ├── external-attacher │ └── rbac.yaml │ ├── external-health-monitor │ └── external-health-monitor-controller │ │ └── rbac.yaml │ ├── external-provisioner │ └── rbac.yaml │ ├── external-resizer │ └── rbac.yaml │ ├── external-snapshotter │ └── csi-snapshotter │ │ └── rbac-csi-snapshotter.yaml │ ├── gce-pd │ ├── controller_ss.yaml │ ├── csi-controller-rbac.yaml │ └── node_ds.yaml │ ├── hostpath │ ├── README.md │ └── hostpath │ │ ├── csi-hostpath-driverinfo.yaml │ │ ├── csi-hostpath-plugin.yaml │ │ ├── csi-hostpath-snapshotclass.yaml │ │ ├── csi-hostpath-testing.yaml │ │ └── e2e-test-rbac.yaml │ └── mock │ ├── csi-mock-driver-attacher.yaml │ ├── csi-mock-driver-resizer.yaml │ ├── csi-mock-driver-snapshotter.yaml │ ├── csi-mock-driver.yaml │ ├── csi-mock-driverinfo.yaml │ ├── csi-mock-proxy.yaml │ ├── csi-mock-rbac.yaml │ └── csi-storageclass.yaml ├── kind-conf.yaml └── utils └── image ├── csi_manifest.go └── manifest.go /.dockerignore: -------------------------------------------------------------------------------- 1 | # More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file 2 | # Ignore build and test binaries. 3 | bin/ 4 | testbin/ 5 | vendor/ 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Create a report to help us improve 4 | title: "[BUG]" 5 | labels: kind/bug 6 | 7 | --- 8 | 9 | 10 | 11 | **What happened**: 12 | 13 | **What you expected to happen**: 14 | 15 | **How to reproduce it (as minimally and precisely as possible)**: 16 | 17 | **Anything else we need to know?**: 18 | 19 | **Environment**: 20 | - App version: 21 | - Kubernetes version (use `kubectl version`): 22 | - Install details (e.g. helm install args): 23 | - Node environment (for koordlet/runtime-proxy issue): 24 | - Containerd/Docker version: 25 | - OS version: 26 | - Kernal version: 27 | - Cgroup driver: cgroupfs/systemd 28 | - Others: 29 | 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/proposal.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Proposal 3 | about: Suggest an idea for this project 4 | title: "[proposal]" 5 | labels: kind/proposal 6 | 7 | --- 8 | 9 | 10 | 11 | **What is your proposal**: 12 | 13 | 14 | **Why is this needed**: 15 | 16 | 17 | **Is there a suggested solution, if so, please add it**: 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question 3 | about: Support request or question relating to Koordinator 4 | title: "[question]" 5 | labels: kind/question 6 | 7 | --- 8 | 9 | 10 | 11 | **What happened:** 12 | 13 | **What you expected to happen:** 14 | 15 | **Environment:** 16 | 17 | 18 | 19 | - Koordinator version: - v0.6.2 20 | - Kubernetes version (use kubectl version): v1.22.5 21 | - docker/containerd version: containerd 1.5.0 22 | - OS (e.g: cat /etc/os-release): Ubuntu 20.04.4 LTS 23 | - Kernel (e.g. uname -a): Linux 5.10.112-11.al8.x86_64 #1 SMP Tue May 24 16:05:50 CST 2022 x86_64 x86_64 x86_64 GNU/Linux 24 | 25 | **Anything else we need to know:** 26 | -------------------------------------------------------------------------------- /.github/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | approvers: 4 | - ci-approvers 5 | reviewers: 6 | - ci-approvers 7 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "gomod" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | labels: 8 | - "dependencies" 9 | commit-message: 10 | prefix: "feat" 11 | include: "scope" 12 | open-pull-requests-limit: 0 13 | - package-ecosystem: "github-actions" 14 | directory: "/" 15 | schedule: 16 | interval: "daily" 17 | labels: 18 | - "dependencies" 19 | commit-message: 20 | prefix: "chore" 21 | include: "scope" 22 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### Ⅰ. Describe what this PR does 2 | 3 | 9 | 10 | ### Ⅱ. Does this pull request fix one issue? 11 | 12 | 13 | 14 | ### Ⅲ. Describe how to verify it 15 | 16 | ### Ⅳ. Special notes for reviews 17 | 18 | ### V. Checklist 19 | 20 | - [ ] I have written necessary docs and comments 21 | - [ ] I have added necessary unit tests and integration tests 22 | - [ ] All checks passed in `make test` 23 | -------------------------------------------------------------------------------- /.github/workflows/license.yml: -------------------------------------------------------------------------------- 1 | name: License 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - release-* 8 | pull_request: {} 9 | workflow_dispatch: {} 10 | 11 | jobs: 12 | license-check: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v4 16 | - uses: ruby/setup-ruby@v1 17 | with: 18 | ruby-version: 2.6 19 | - name: Check license 20 | run: | 21 | gem install license_finder 22 | license_finder --decisions_file .license/dependency_decisions.yml 23 | - uses: actions/setup-go@v5 24 | with: 25 | cache: false 26 | go-version-file: go.mod 27 | - name: Check license header 28 | run: | 29 | make lint-license && git add apis pkg cmd test || exit 1 30 | git diff --cached --exit-code || (echo 'Please run "make lint-license" to verify license header' && exit 1); 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | bin 8 | testbin/* 9 | 10 | # Go dependencies folder 11 | vendor 12 | 13 | # Test binary, build with `go test -c` 14 | *.test 15 | 16 | # Output of the go coverage tool, specifically when used with LiteIDE 17 | *.out 18 | 19 | # Kubernetes Generated files - skip generated files, except for vendored files 20 | 21 | !vendor/**/zz_generated.* 22 | 23 | # editor and IDE paraphernalia 24 | .idea 25 | *.swp 26 | *.swo 27 | *~ 28 | 29 | .vscode 30 | .DS_Store 31 | 32 | dist/ 33 | 34 | README-contributing.md 35 | -------------------------------------------------------------------------------- /.license/README.md: -------------------------------------------------------------------------------- 1 | # License Checker 2 | 3 | Our license checker CI rely on [LicenseFinder](https://github.com/pivotal/LicenseFinder). 4 | 5 | ## How to add a new license 6 | 7 | LicenseFinder is a ruby project, so make sure you have ruby installed. 8 | 9 | ### Install the tool 10 | 11 | ```shell 12 | gem install license_finder 13 | ``` 14 | 15 | ### Add a license 16 | 17 | ```shell 18 | license_finder permitted_licenses add MIT --decisions_file .license/dependency_decisions.yml 19 | ``` 20 | -------------------------------------------------------------------------------- /.license/dependency_decisions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - - :permit 3 | - MIT 4 | - :who: 5 | :why: 6 | :versions: [] 7 | :when: 2021-03-12 07:35:34.645031000 Z 8 | - - :permit 9 | - Apache 2.0 10 | - :who: 11 | :why: 12 | :versions: [] 13 | :when: 2021-03-12 07:19:18.243194000 Z 14 | - - :permit 15 | - New BSD 16 | - :who: 17 | :why: 18 | :versions: [] 19 | :when: 2021-03-12 07:19:28.540675000 Z 20 | - - :permit 21 | - Simplified BSD 22 | - :who: 23 | :why: 24 | :versions: [] 25 | :when: 2021-03-12 07:20:01.774212000 Z 26 | - - :permit 27 | - Mozilla Public License 2.0 28 | - :who: 29 | :why: 30 | :versions: [] 31 | :when: 2021-03-12 07:21:05.194536000 Z 32 | - - :permit 33 | - unknown 34 | - :who: 35 | :why: 36 | :versions: [] 37 | :when: 2021-03-12 07:21:43.379269000 Z 38 | - - :permit 39 | - ISC 40 | - :who: 41 | :why: 42 | :versions: [] 43 | :when: 2021-03-12 07:22:07.265966000 Z 44 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | Koordinator follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). 4 | -------------------------------------------------------------------------------- /OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - hormes 3 | - yihuifeng 4 | 5 | reviewers: 6 | - FillZpp 7 | - hormes 8 | - yihuifeng 9 | -------------------------------------------------------------------------------- /OWNERS_ALIASES: -------------------------------------------------------------------------------- 1 | # See the OWNERS_ALIASES docs at https://go.k8s.io/owners 2 | 3 | aliases: 4 | 5 | ci-approvers: 6 | - eahydra 7 | - jasonliu747 8 | - saintube 9 | 10 | api-machinery-approvers: 11 | - FillZpp 12 | - zwzhang0107 13 | 14 | scheduler-approvers: 15 | - eahydra 16 | - buptcozy 17 | - ZiMengSheng 18 | 19 | slo-controller-approvers: 20 | - jasonliu747 21 | - zwzhang0107 22 | 23 | koordlet-approvers: 24 | - jasonliu747 25 | - saintube 26 | - zwzhang0107 27 | 28 | descheduler-approvers: 29 | - eahydra 30 | - FillZpp 31 | 32 | runtime-proxy-approvers: 33 | - honpey 34 | - ZYecho 35 | 36 | webhook-approvers: 37 | - FillZpp 38 | - eahydra 39 | - zwzhang0107 40 | 41 | prediction-approvers: 42 | - zwzhang0107 43 | - saintube 44 | 45 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | - [Security Policy](#security-policy) 4 | - [Reporting security problems](#reporting-security-problems) 5 | - [Vulnerability Management Plans](#vulnerability-management-plans) 6 | - [Critical Updates And Security Notices](#critical-updates-and-security-notices) 7 | 8 | ## Reporting security problems 9 | 10 | **DO NOT CREATE AN ISSUE** to report a security problem. Instead, please 11 | send an email to kubernetes-security@service.aliyun.com 12 | 13 | Please follow the [embargo policy](./embargo-policy.md) for all security-related problems. 14 | 15 | ## Vulnerability Management Plans 16 | 17 | ### Critical Updates And Security Notices 18 | 19 | We learn about critical software updates and security threats from these sources 20 | 21 | 1. GitHub Security Alerts 22 | 2. [Dependabot](https://dependabot.com/) Dependency Updates 23 | -------------------------------------------------------------------------------- /apis/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | approvers: 4 | - api-machinery-approvers 5 | reviewers: 6 | - api-machinery-approvers 7 | -------------------------------------------------------------------------------- /apis/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package apis 18 | -------------------------------------------------------------------------------- /apis/extension/cluster_colocation_profile.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package extension 18 | 19 | import ( 20 | configv1alpha1 "github.com/koordinator-sh/koordinator/apis/config/v1alpha1" 21 | ) 22 | 23 | const ( 24 | AnnotationSkipUpdateResource = "config.koordinator.sh/skip-update-resources" 25 | ) 26 | 27 | func ShouldSkipUpdateResource(profile *configv1alpha1.ClusterColocationProfile) bool { 28 | if profile == nil || profile.Annotations == nil { 29 | return false 30 | } 31 | _, ok := profile.Annotations[AnnotationSkipUpdateResource] 32 | return ok 33 | } 34 | -------------------------------------------------------------------------------- /apis/extension/multi_scheduler.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package extension 18 | 19 | import ( 20 | corev1 "k8s.io/api/core/v1" 21 | ) 22 | 23 | const ( 24 | // LabelSchedulerName is used to specify the internal scheduler name for a pod, overriding the spec.schedulerName. 25 | LabelSchedulerName = SchedulingDomainPrefix + "/scheduler-name" 26 | ) 27 | 28 | func GetSchedulerName(pod *corev1.Pod) string { 29 | if schedulerName, ok := pod.Labels[LabelSchedulerName]; ok { 30 | return schedulerName 31 | } 32 | return pod.Spec.SchedulerName 33 | } 34 | -------------------------------------------------------------------------------- /apis/extension/preemption_utils.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package extension 18 | 19 | import corev1 "k8s.io/api/core/v1" 20 | 21 | // NOTE: functions in this file can be overwritten for extension 22 | 23 | var DefaultPreemptionPolicy = GetPreemptionPolicyPtr(corev1.PreemptNever) 24 | 25 | func GetPodKoordPreemptionPolicyWithDefault(pod *corev1.Pod) *corev1.PreemptionPolicy { 26 | if preemptionPolicy := GetPodKoordPreemptionPolicy(pod); preemptionPolicy != nil { 27 | return preemptionPolicy 28 | } 29 | 30 | // If the PreemptionPolicy feature enabled but the preemption-policy label is not set, use 31 | // the DefaultPreemptionPolicy. 32 | return DefaultPreemptionPolicy 33 | } 34 | -------------------------------------------------------------------------------- /apis/extension/qos.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package extension 18 | 19 | type QoSClass string 20 | 21 | // https://koordinator.sh/docs/architecture/qos/ 22 | const ( 23 | QoSLSE QoSClass = "LSE" 24 | QoSLSR QoSClass = "LSR" 25 | QoSLS QoSClass = "LS" 26 | QoSBE QoSClass = "BE" 27 | QoSSystem QoSClass = "SYSTEM" 28 | QoSNone QoSClass = "" 29 | ) 30 | 31 | func GetPodQoSClassByName(qos string) QoSClass { 32 | q := QoSClass(qos) 33 | 34 | switch q { 35 | case QoSLSE, QoSLSR, QoSLS, QoSBE, QoSSystem: 36 | return q 37 | } 38 | 39 | return QoSNone 40 | } 41 | -------------------------------------------------------------------------------- /apis/slo/v1alpha1/resources.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package v1alpha1 18 | 19 | import ( 20 | corev1 "k8s.io/api/core/v1" 21 | 22 | schedulingv1alpha1 "github.com/koordinator-sh/koordinator/apis/scheduling/v1alpha1" 23 | ) 24 | 25 | type ResourceMap struct { 26 | corev1.ResourceList `json:"resources,omitempty"` 27 | Devices []schedulingv1alpha1.DeviceInfo `json:"devices,omitempty"` 28 | } 29 | -------------------------------------------------------------------------------- /apis/slo/v1alpha1/slo_extension.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package v1alpha1 18 | 19 | import "github.com/mohae/deepcopy" 20 | 21 | // ExtensionsMap if used for third-party plugins 22 | // +k8s:deepcopy-gen=false 23 | type ExtensionsMap struct { 24 | // +kubebuilder:pruning:PreserveUnknownFields 25 | // +kubebuilder:validation:Schemaless 26 | Object map[string]interface{} `json:",inline"` 27 | } 28 | 29 | func (in *ExtensionsMap) DeepCopyInto(out *ExtensionsMap) { 30 | if in == nil { 31 | return 32 | } else { 33 | outIf := deepcopy.Copy(*in) 34 | *out = outIf.(ExtensionsMap) 35 | } 36 | } 37 | 38 | func (in *ExtensionsMap) DeepCopy() *ExtensionsMap { 39 | if in == nil { 40 | return nil 41 | } 42 | out := new(ExtensionsMap) 43 | in.DeepCopyInto(out) 44 | return out 45 | } 46 | -------------------------------------------------------------------------------- /apis/thirdparty/scheduler-plugins/pkg/apis/scheduling/register.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package scheduling 18 | 19 | // GroupName is the group name used in this package 20 | const ( 21 | GroupName = "scheduling.sigs.k8s.io" 22 | ) 23 | -------------------------------------------------------------------------------- /apis/thirdparty/scheduler-plugins/pkg/apis/scheduling/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // +k8s:deepcopy-gen=package 18 | // +groupName=scheduling.sigs.k8s.io 19 | 20 | // Package v1alpha1 is the v1alpha1 version of the API. 21 | package v1alpha1 22 | -------------------------------------------------------------------------------- /apis/thirdparty/scheduler-plugins/pkg/generated/clientset/versioned/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // This package has the automatically generated clientset. 20 | package versioned 21 | -------------------------------------------------------------------------------- /apis/thirdparty/scheduler-plugins/pkg/generated/clientset/versioned/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // This package has the automatically generated fake clientset. 20 | package fake 21 | -------------------------------------------------------------------------------- /apis/thirdparty/scheduler-plugins/pkg/generated/clientset/versioned/scheme/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // This package contains the scheme of the automatically generated clientset. 20 | package scheme 21 | -------------------------------------------------------------------------------- /apis/thirdparty/scheduler-plugins/pkg/generated/clientset/versioned/typed/scheduling/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // This package has the automatically generated typed clients. 20 | package v1alpha1 21 | -------------------------------------------------------------------------------- /apis/thirdparty/scheduler-plugins/pkg/generated/clientset/versioned/typed/scheduling/v1alpha1/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // Package fake has the automatically generated clients. 20 | package fake 21 | -------------------------------------------------------------------------------- /apis/thirdparty/scheduler-plugins/pkg/generated/clientset/versioned/typed/scheduling/v1alpha1/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | type ElasticQuotaExpansion interface{} 22 | 23 | type PodGroupExpansion interface{} 24 | -------------------------------------------------------------------------------- /cmd/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | approvers: 4 | - api-machinery-approvers 5 | reviewers: 6 | - api-machinery-approvers 7 | -------------------------------------------------------------------------------- /cmd/koord-manager/extensions/extension.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package extensions 18 | 19 | import ( 20 | "context" 21 | 22 | "k8s.io/client-go/rest" 23 | ctrl "sigs.k8s.io/controller-runtime" 24 | ) 25 | 26 | // for third-party extensions 27 | func PrepareExtensions(restConfig *rest.Config, mgr ctrl.Manager) { 28 | 29 | } 30 | 31 | func StartExtensions(ctx context.Context, mgr ctrl.Manager) { 32 | 33 | } 34 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | # https://docs.codecov.com/docs/commit-status 2 | coverage: 3 | status: 4 | project: 5 | # global coverage 6 | default: 7 | target: auto 8 | threshold: 2% 9 | flags: 10 | - unittests 11 | paths: 12 | - "pkg" 13 | if_ci_failed: error 14 | if_no_uploads: error 15 | if_not_found: success 16 | patch: 17 | # diff coverage 18 | default: 19 | target: 70% 20 | flags: 21 | - unittests 22 | paths: 23 | - "pkg" 24 | informational: true 25 | if_ci_failed: ignore 26 | if_no_uploads: success 27 | if_not_found: success 28 | 29 | ignore: 30 | - "apis" 31 | - "pkg/client" 32 | - "**/*_generated.*" 33 | 34 | github_checks: 35 | annotations: true 36 | -------------------------------------------------------------------------------- /config/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | approvers: 4 | - ci-approvers 5 | reviewers: 6 | - ci-approvers 7 | -------------------------------------------------------------------------------- /config/certmanager/certificate.yaml: -------------------------------------------------------------------------------- 1 | # The following manifests contain a self-signed issuer CR and a certificate CR. 2 | # More document can be found at https://docs.cert-manager.io 3 | # WARNING: Targets CertManager 0.11 check https://docs.cert-manager.io/en/latest/tasks/upgrading/index.html for 4 | # breaking changes 5 | apiVersion: cert-manager.io/v1alpha2 6 | kind: Issuer 7 | metadata: 8 | name: selfsigned-issuer 9 | namespace: system 10 | spec: 11 | selfSigned: {} 12 | --- 13 | apiVersion: cert-manager.io/v1alpha2 14 | kind: Certificate 15 | metadata: 16 | name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml 17 | namespace: system 18 | spec: 19 | # $(SERVICE_NAME) and $(SERVICE_NAMESPACE) will be substituted by kustomize 20 | dnsNames: 21 | - $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc 22 | - $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc.cluster.local 23 | issuerRef: 24 | kind: Issuer 25 | name: selfsigned-issuer 26 | secretName: webhook-server-cert # this secret will not be prefixed, since it's not managed by kustomize 27 | -------------------------------------------------------------------------------- /config/certmanager/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - certificate.yaml 3 | 4 | configurations: 5 | - kustomizeconfig.yaml 6 | -------------------------------------------------------------------------------- /config/certmanager/kustomizeconfig.yaml: -------------------------------------------------------------------------------- 1 | # This configuration is for teaching kustomize how to update name ref and var substitution 2 | nameReference: 3 | - kind: Issuer 4 | group: cert-manager.io 5 | fieldSpecs: 6 | - kind: Certificate 7 | group: cert-manager.io 8 | path: spec/issuerRef/name 9 | 10 | varReference: 11 | - kind: Certificate 12 | group: cert-manager.io 13 | path: spec/commonName 14 | - kind: Certificate 15 | group: cert-manager.io 16 | path: spec/dnsNames 17 | -------------------------------------------------------------------------------- /config/crd/kustomizeconfig.yaml: -------------------------------------------------------------------------------- 1 | # This file is for teaching kustomize how to substitute name and namespace reference in CRD 2 | nameReference: 3 | - kind: Service 4 | version: v1 5 | fieldSpecs: 6 | - kind: CustomResourceDefinition 7 | version: v1 8 | group: apiextensions.k8s.io 9 | path: spec/conversion/webhook/clientConfig/service/name 10 | 11 | namespace: 12 | - kind: CustomResourceDefinition 13 | version: v1 14 | group: apiextensions.k8s.io 15 | path: spec/conversion/webhook/clientConfig/service/namespace 16 | create: false 17 | 18 | varReference: 19 | - path: metadata/annotations 20 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_nodemetrics.yaml: -------------------------------------------------------------------------------- 1 | # The following patch adds a directive for certmanager to inject CA into the CRD 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | annotations: 6 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 7 | name: nodemetrics.slo.koordinator.sh 8 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_nodemetrics.yaml: -------------------------------------------------------------------------------- 1 | # The following patch enables a conversion webhook for the CRD 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | name: nodemetrics.slo.koordinator.sh 6 | spec: 7 | conversion: 8 | strategy: Webhook 9 | webhook: 10 | clientConfig: 11 | service: 12 | namespace: system 13 | name: webhook-service 14 | path: /convert 15 | conversionReviewVersions: 16 | - v1 17 | -------------------------------------------------------------------------------- /config/default/manager_auth_proxy_patch.yaml: -------------------------------------------------------------------------------- 1 | # This patch inject a sidecar container which is a HTTP proxy for the 2 | # controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews. 3 | apiVersion: apps/v1 4 | kind: Deployment 5 | metadata: 6 | name: manager 7 | namespace: system 8 | spec: 9 | template: 10 | spec: 11 | containers: 12 | - name: kube-rbac-proxy 13 | image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0 14 | args: 15 | - "--secure-listen-address=0.0.0.0:8443" 16 | - "--upstream=http://127.0.0.1:8080/" 17 | - "--logtostderr=true" 18 | - "--v=0" 19 | ports: 20 | - containerPort: 8443 21 | protocol: TCP 22 | name: https 23 | resources: 24 | limits: 25 | cpu: 500m 26 | memory: 128Mi 27 | requests: 28 | cpu: 5m 29 | memory: 64Mi 30 | - name: manager 31 | args: 32 | - "--health-probe-bind-address=:8081" 33 | - "--metrics-bind-address=127.0.0.1:8080" 34 | - "--leader-elect" 35 | -------------------------------------------------------------------------------- /config/manager/koord-batch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: scheduling.k8s.io/v1 2 | description: Offline tasks, computing tasks, etc. 3 | kind: PriorityClass 4 | metadata: 5 | name: batch 6 | preemptionPolicy: PreemptLowerPriority 7 | value: 5000 8 | -------------------------------------------------------------------------------- /config/manager/koord-free.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: scheduling.k8s.io/v1 2 | description: Run lowest-priority offline batch jobs, generally refers to not making resource budgets. 3 | kind: PriorityClass 4 | metadata: 5 | name: free 6 | preemptionPolicy: PreemptLowerPriority 7 | value: 3000 8 | -------------------------------------------------------------------------------- /config/manager/koord-mid.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: scheduling.k8s.io/v1 2 | description: Nearline computation jobs whose SLO weaker than koord-prod. 3 | kind: PriorityClass 4 | metadata: 5 | name: mid 6 | preemptionPolicy: PreemptLowerPriority 7 | value: 7000 8 | -------------------------------------------------------------------------------- /config/manager/koord-prod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: scheduling.k8s.io/v1 2 | description: Online production system for applications and businesses. 3 | kind: PriorityClass 4 | metadata: 5 | name: prod 6 | preemptionPolicy: PreemptLowerPriority 7 | value: 9000 8 | -------------------------------------------------------------------------------- /config/manager/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - manager.yaml 3 | - scheduler.yaml 4 | - scheduler-config.yaml 5 | - descheduler.yaml 6 | - descheduler-config.yaml 7 | - koordlet.yaml 8 | - koord-batch.yaml 9 | - koord-free.yaml 10 | - koord-mid.yaml 11 | - koord-prod.yaml 12 | - slo-controller-config.yaml 13 | 14 | generatorOptions: 15 | disableNameSuffixHash: true 16 | apiVersion: kustomize.config.k8s.io/v1beta1 17 | kind: Kustomization 18 | images: 19 | - name: descheduler 20 | newName: ghcr.io/koordinator-sh/koord-descheduler 21 | newTag: latest 22 | - name: koordlet 23 | newName: ghcr.io/koordinator-sh/koordlet 24 | newTag: latest 25 | - name: manager 26 | newName: ghcr.io/koordinator-sh/koord-manager 27 | newTag: latest 28 | - name: scheduler 29 | newName: ghcr.io/koordinator-sh/koord-scheduler 30 | newTag: latest 31 | -------------------------------------------------------------------------------- /config/manager/slo-controller-config.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: slo-controller-config 5 | namespace: system 6 | data: 7 | colocation-config: | 8 | { 9 | "enable": true 10 | } 11 | resource-threshold-config: | 12 | { 13 | "clusterStrategy": { 14 | "enable": true 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /config/prometheus/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - monitor.yaml 3 | -------------------------------------------------------------------------------- /config/prometheus/monitor.yaml: -------------------------------------------------------------------------------- 1 | 2 | # Prometheus Monitor Service (Metrics) 3 | apiVersion: monitoring.coreos.com/v1 4 | kind: ServiceMonitor 5 | metadata: 6 | labels: 7 | koord-app: koord-manager 8 | name: manager-metrics-monitor 9 | namespace: system 10 | spec: 11 | endpoints: 12 | - path: /metrics 13 | port: https 14 | scheme: https 15 | bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token 16 | tlsConfig: 17 | insecureSkipVerify: true 18 | selector: 19 | matchLabels: 20 | koord-app: koord-manager 21 | -------------------------------------------------------------------------------- /config/rbac/auth_proxy_client_clusterrole.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRole 3 | metadata: 4 | name: metrics-reader 5 | rules: 6 | - nonResourceURLs: 7 | - "/metrics" 8 | verbs: 9 | - get 10 | -------------------------------------------------------------------------------- /config/rbac/auth_proxy_role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRole 3 | metadata: 4 | name: proxy-role 5 | rules: 6 | - apiGroups: 7 | - authentication.k8s.io 8 | resources: 9 | - tokenreviews 10 | verbs: 11 | - create 12 | - apiGroups: 13 | - authorization.k8s.io 14 | resources: 15 | - subjectaccessreviews 16 | verbs: 17 | - create 18 | -------------------------------------------------------------------------------- /config/rbac/auth_proxy_role_binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: 4 | name: proxy-rolebinding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: proxy-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: manager 12 | namespace: system 13 | -------------------------------------------------------------------------------- /config/rbac/auth_proxy_service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | koord-app: koord-manager 6 | name: manager-metrics-service 7 | namespace: system 8 | spec: 9 | ports: 10 | - name: https 11 | port: 8443 12 | protocol: TCP 13 | targetPort: https 14 | selector: 15 | koord-app: koord-manager 16 | -------------------------------------------------------------------------------- /config/rbac/descheduler_role_binding.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | namespace: system 6 | name: descheduler 7 | --- 8 | apiVersion: rbac.authorization.k8s.io/v1 9 | kind: ClusterRoleBinding 10 | metadata: 11 | name: descheduler-rolebinding 12 | roleRef: 13 | apiGroup: rbac.authorization.k8s.io 14 | kind: ClusterRole 15 | name: descheduler-role 16 | subjects: 17 | - kind: ServiceAccount 18 | name: descheduler 19 | namespace: system 20 | -------------------------------------------------------------------------------- /config/rbac/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | # All RBAC will be applied under this service account in 3 | # the deployment namespace. You may comment out this resource 4 | # if your manager will use a service account that exists at 5 | # runtime. Be sure to update RoleBinding and ClusterRoleBinding 6 | # subjects if changing service account names. 7 | - service_account.yaml 8 | - role.yaml 9 | - role_binding.yaml 10 | - leader_election_role.yaml 11 | - leader_election_role_binding.yaml 12 | - descheduler_role.yaml 13 | - descheduler_role_binding.yaml 14 | - scheduler_role.yaml 15 | - scheduler_role_binding.yaml 16 | - koordlet.yaml 17 | # Comment the following 4 lines if you want to disable 18 | # the auth proxy (https://github.com/brancz/kube-rbac-proxy) 19 | # which protects your /metrics endpoint. 20 | #- auth_proxy_service.yaml 21 | #- auth_proxy_role.yaml 22 | #- auth_proxy_role_binding.yaml 23 | #- auth_proxy_client_clusterrole.yaml 24 | -------------------------------------------------------------------------------- /config/rbac/leader_election_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions to do leader election. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: Role 4 | metadata: 5 | name: leader-election-role 6 | namespace: system 7 | rules: 8 | - apiGroups: 9 | - "" 10 | resources: 11 | - configmaps 12 | verbs: 13 | - get 14 | - list 15 | - watch 16 | - create 17 | - update 18 | - patch 19 | - delete 20 | - apiGroups: 21 | - coordination.k8s.io 22 | resources: 23 | - leases 24 | verbs: 25 | - get 26 | - list 27 | - watch 28 | - create 29 | - update 30 | - patch 31 | - delete 32 | - apiGroups: 33 | - "" 34 | resources: 35 | - events 36 | verbs: 37 | - create 38 | - patch 39 | -------------------------------------------------------------------------------- /config/rbac/leader_election_role_binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | name: leader-election-rolebinding 5 | namespace: system 6 | roleRef: 7 | apiGroup: rbac.authorization.k8s.io 8 | kind: Role 9 | name: leader-election-role 10 | subjects: 11 | - kind: ServiceAccount 12 | name: manager 13 | namespace: system 14 | -------------------------------------------------------------------------------- /config/rbac/nodemetric_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions for end users to edit nodemetrics. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: nodemetric-editor-role 6 | rules: 7 | - apiGroups: 8 | - slo.koordinator.sh 9 | resources: 10 | - nodemetrics 11 | verbs: 12 | - create 13 | - delete 14 | - get 15 | - list 16 | - patch 17 | - update 18 | - watch 19 | - apiGroups: 20 | - slo.koordinator.sh 21 | resources: 22 | - nodemetrics/status 23 | verbs: 24 | - get 25 | -------------------------------------------------------------------------------- /config/rbac/nodemetric_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions for end users to view nodemetrics. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: nodemetric-viewer-role 6 | rules: 7 | - apiGroups: 8 | - slo.koordinator.sh 9 | resources: 10 | - nodemetrics 11 | verbs: 12 | - get 13 | - list 14 | - watch 15 | - apiGroups: 16 | - slo.koordinator.sh 17 | resources: 18 | - nodemetrics/status 19 | verbs: 20 | - get 21 | -------------------------------------------------------------------------------- /config/rbac/role_binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: 4 | name: manager-rolebinding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: manager-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: manager 12 | namespace: system 13 | -------------------------------------------------------------------------------- /config/rbac/scheduler_role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRole 3 | metadata: 4 | name: scheduler-role 5 | rules: 6 | - apiGroups: 7 | - coordination.k8s.io 8 | resources: 9 | - leases 10 | verbs: 11 | - create 12 | - get 13 | - update 14 | - apiGroups: 15 | - "" 16 | resources: 17 | - pods 18 | verbs: 19 | - patch 20 | - apiGroups: 21 | - apiextensions.k8s.io 22 | resources: 23 | - customresourcedefinitions 24 | verbs: 25 | - get 26 | - list 27 | - patch 28 | - update 29 | - watch 30 | - apiGroups: 31 | - config.koordinator.sh 32 | - slo.koordinator.sh 33 | - scheduling.koordinator.sh 34 | - topology.node.k8s.io 35 | - scheduling.sigs.k8s.io 36 | resources: 37 | - "*" 38 | verbs: 39 | - "*" 40 | -------------------------------------------------------------------------------- /config/rbac/scheduler_role_binding.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: scheduler 6 | namespace: system 7 | --- 8 | apiVersion: rbac.authorization.k8s.io/v1 9 | kind: ClusterRoleBinding 10 | metadata: 11 | name: scheduler-rolebinding-custom 12 | roleRef: 13 | apiGroup: rbac.authorization.k8s.io 14 | kind: ClusterRole 15 | name: scheduler-role 16 | subjects: 17 | - kind: ServiceAccount 18 | name: scheduler 19 | namespace: system 20 | --- 21 | apiVersion: rbac.authorization.k8s.io/v1 22 | kind: ClusterRoleBinding 23 | metadata: 24 | name: scheduler-rolebinding 25 | roleRef: 26 | apiGroup: rbac.authorization.k8s.io 27 | kind: ClusterRole 28 | name: system:kube-scheduler 29 | subjects: 30 | - kind: ServiceAccount 31 | name: scheduler 32 | namespace: system 33 | --- 34 | apiVersion: rbac.authorization.k8s.io/v1 35 | kind: ClusterRoleBinding 36 | metadata: 37 | name: scheduler-rolebinding-volume 38 | roleRef: 39 | apiGroup: rbac.authorization.k8s.io 40 | kind: ClusterRole 41 | name: system:volume-scheduler 42 | subjects: 43 | - kind: ServiceAccount 44 | name: scheduler 45 | namespace: system 46 | -------------------------------------------------------------------------------- /config/rbac/service_account.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: manager 5 | namespace: system 6 | -------------------------------------------------------------------------------- /config/samples/analysis_v1aplha1_recommendation.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: analysis.koordinator.sh/v1alpha1 2 | kind: Recommendation 3 | metadata: 4 | namespace: default 5 | name: recommendation-sample 6 | spec: 7 | target: 8 | type: workload 9 | workload: 10 | apiVersion: apps/v1 11 | kind: Deployment 12 | name: nginx-sample-deployment 13 | status: 14 | podStatus: 15 | containerStatuses: 16 | - containerName: nginx 17 | resources: 18 | cpu: 1200m 19 | memory: 1280Mi 20 | updateTime: "2024-03-05T08:00:00Z" 21 | -------------------------------------------------------------------------------- /config/samples/scheduling_v1alpha1_reservation.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: scheduling.koordinator.sh/v1alpha1 2 | kind: Reservation 3 | metadata: 4 | name: reservation-sample 5 | spec: 6 | template: 7 | namespace: default 8 | spec: 9 | containers: 10 | - args: 11 | - '-c' 12 | - '1' 13 | command: 14 | - stress 15 | image: polinux/stress 16 | imagePullPolicy: Always 17 | name: stress 18 | resources: 19 | limits: 20 | cpu: '1' 21 | memory: 1Gi 22 | requests: 23 | cpu: 200m 24 | memory: 400Mi 25 | restartPolicy: Always 26 | schedulerName: koord-scheduler 27 | owners: 28 | - object: 29 | name: reserve-demo-0 30 | namespace: default 31 | -------------------------------------------------------------------------------- /config/samples/slo_v1alpha1_nodemetric.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: slo.koordinator.sh/v1alpha1 2 | kind: NodeMetric 3 | metadata: 4 | name: nodemetric-sample 5 | spec: 6 | # TODO(user): Add fields here 7 | -------------------------------------------------------------------------------- /config/webhook/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - manifests.yaml 3 | - service.yaml 4 | 5 | patchesStrategicMerge: 6 | - patch_manifests.yaml 7 | 8 | configurations: 9 | - kustomizeconfig.yaml 10 | -------------------------------------------------------------------------------- /config/webhook/kustomizeconfig.yaml: -------------------------------------------------------------------------------- 1 | # the following config is for teaching kustomize where to look at when substituting vars. 2 | # It requires kustomize v2.1.0 or newer to work properly. 3 | nameReference: 4 | - kind: Service 5 | version: v1 6 | fieldSpecs: 7 | - kind: MutatingWebhookConfiguration 8 | group: admissionregistration.k8s.io 9 | path: webhooks/clientConfig/service/name 10 | - kind: ValidatingWebhookConfiguration 11 | group: admissionregistration.k8s.io 12 | path: webhooks/clientConfig/service/name 13 | 14 | namespace: 15 | - kind: MutatingWebhookConfiguration 16 | group: admissionregistration.k8s.io 17 | path: webhooks/clientConfig/service/namespace 18 | create: true 19 | - kind: ValidatingWebhookConfiguration 20 | group: admissionregistration.k8s.io 21 | path: webhooks/clientConfig/service/namespace 22 | create: true 23 | 24 | varReference: 25 | - path: metadata/annotations 26 | -------------------------------------------------------------------------------- /config/webhook/patch_manifests.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: admissionregistration.k8s.io/v1 2 | kind: MutatingWebhookConfiguration 3 | metadata: 4 | name: mutating-webhook-configuration 5 | webhooks: 6 | - name: mpod-create.koordinator.sh 7 | namespaceSelector: 8 | matchExpressions: 9 | - key: control-plane 10 | operator: DoesNotExist 11 | - name: mpod-update.koordinator.sh 12 | namespaceSelector: 13 | matchExpressions: 14 | - key: control-plane 15 | operator: DoesNotExist 16 | objectSelector: 17 | matchExpressions: 18 | - key: pod.koordinator.sh/mutating-update 19 | operator: In 20 | values: 21 | - "true" 22 | --- 23 | apiVersion: admissionregistration.k8s.io/v1 24 | kind: ValidatingWebhookConfiguration 25 | metadata: 26 | name: validating-webhook-configuration 27 | webhooks: 28 | - name: vpod.koordinator.sh 29 | namespaceSelector: 30 | matchExpressions: 31 | - key: control-plane 32 | operator: DoesNotExist 33 | - name: vconfigmap.koordinator.sh 34 | objectSelector: 35 | matchExpressions: 36 | - key: koordinator.sh/configmap-type 37 | operator: In 38 | values: 39 | - slo-controller-config 40 | -------------------------------------------------------------------------------- /config/webhook/service.yaml: -------------------------------------------------------------------------------- 1 | 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: webhook-service 6 | namespace: system 7 | spec: 8 | ports: 9 | - port: 443 10 | targetPort: 9876 11 | selector: 12 | koord-app: koord-manager 13 | -------------------------------------------------------------------------------- /docker/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | approvers: 4 | - ci-approvers 5 | reviewers: 6 | - ci-approvers 7 | -------------------------------------------------------------------------------- /docker/koord-descheduler.dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=$TARGETPLATFORM golang:1.20 as builder 2 | WORKDIR /go/src/github.com/koordinator-sh/koordinator 3 | 4 | ARG VERSION 5 | ARG TARGETARCH 6 | ENV VERSION $VERSION 7 | ENV GOOS linux 8 | ENV GOARCH $TARGETARCH 9 | 10 | COPY go.mod go.mod 11 | COPY go.sum go.sum 12 | 13 | RUN go mod download 14 | 15 | COPY apis/ apis/ 16 | COPY cmd/ cmd/ 17 | COPY pkg/ pkg/ 18 | 19 | RUN CGO_ENABLED=0 go build -a -o koord-descheduler cmd/koord-descheduler/main.go 20 | 21 | FROM --platform=$TARGETPLATFORM gcr.io/distroless/static:latest 22 | WORKDIR / 23 | COPY --from=builder /go/src/github.com/koordinator-sh/koordinator/koord-descheduler . 24 | ENTRYPOINT ["/koord-descheduler"] 25 | -------------------------------------------------------------------------------- /docker/koord-manager.dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=$TARGETPLATFORM golang:1.20 as builder 2 | WORKDIR /go/src/github.com/koordinator-sh/koordinator 3 | 4 | ARG VERSION 5 | ARG TARGETARCH 6 | ENV VERSION $VERSION 7 | ENV GOOS linux 8 | ENV GOARCH $TARGETARCH 9 | 10 | COPY go.mod go.mod 11 | COPY go.sum go.sum 12 | 13 | RUN go mod download 14 | 15 | COPY apis/ apis/ 16 | COPY cmd/ cmd/ 17 | COPY pkg/ pkg/ 18 | 19 | RUN CGO_ENABLED=0 go build -a -o koord-manager cmd/koord-manager/main.go 20 | 21 | FROM --platform=$TARGETPLATFORM gcr.io/distroless/static:latest 22 | WORKDIR / 23 | COPY --from=builder /go/src/github.com/koordinator-sh/koordinator/koord-manager . 24 | ENTRYPOINT ["/koord-manager"] 25 | -------------------------------------------------------------------------------- /docker/koord-runtimeproxy.dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=$TARGETPLATFORM golang:1.20 as builder 2 | WORKDIR /go/src/github.com/koordinator-sh/koordinator 3 | 4 | ARG VERSION 5 | ARG TARGETARCH 6 | ENV VERSION $VERSION 7 | ENV GOOS linux 8 | ENV GOARCH $TARGETARCH 9 | 10 | COPY go.mod go.mod 11 | COPY go.sum go.sum 12 | 13 | RUN go mod download 14 | 15 | COPY apis/ apis/ 16 | COPY cmd/ cmd/ 17 | COPY pkg/ pkg/ 18 | 19 | RUN CGO_ENABLED=0 go build -a -o koord-runtime-proxy cmd/koord-runtime-proxy/main.go 20 | 21 | FROM --platform=$TARGETPLATFORM gcr.io/distroless/static:latest 22 | WORKDIR / 23 | COPY --from=builder /go/src/github.com/koordinator-sh/koordinator/koord-runtime-proxy . 24 | ENTRYPOINT ["/koord-runtime-proxy"] 25 | -------------------------------------------------------------------------------- /docker/koord-scheduler.dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=$TARGETPLATFORM golang:1.20 as builder 2 | WORKDIR /go/src/github.com/koordinator-sh/koordinator 3 | 4 | ARG VERSION 5 | ARG TARGETARCH 6 | ENV VERSION $VERSION 7 | ENV GOOS linux 8 | ENV GOARCH $TARGETARCH 9 | 10 | COPY go.mod go.mod 11 | COPY go.sum go.sum 12 | 13 | RUN go mod download 14 | 15 | COPY apis/ apis/ 16 | COPY cmd/ cmd/ 17 | COPY pkg/ pkg/ 18 | 19 | RUN CGO_ENABLED=0 go build -a -o koord-scheduler cmd/koord-scheduler/main.go 20 | 21 | FROM --platform=$TARGETPLATFORM gcr.io/distroless/static:latest 22 | WORKDIR / 23 | COPY --from=builder /go/src/github.com/koordinator-sh/koordinator/koord-scheduler . 24 | ENTRYPOINT ["/koord-scheduler"] 25 | -------------------------------------------------------------------------------- /docs/images/RuntimeProxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/RuntimeProxy.png -------------------------------------------------------------------------------- /docs/images/dingtalk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/dingtalk.png -------------------------------------------------------------------------------- /docs/images/ebpf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/ebpf.png -------------------------------------------------------------------------------- /docs/images/koord-scheduler-framework-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/koord-scheduler-framework-ext.png -------------------------------------------------------------------------------- /docs/images/koordetector.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/koordetector.jpg -------------------------------------------------------------------------------- /docs/images/koordinator-logo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/koordinator-logo.jpeg -------------------------------------------------------------------------------- /docs/images/multi-quota-tree.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/multi-quota-tree.jpg -------------------------------------------------------------------------------- /docs/images/netqos-tc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/netqos-tc.jpg -------------------------------------------------------------------------------- /docs/images/node-resource-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/node-resource-model.png -------------------------------------------------------------------------------- /docs/images/nri-proposal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/nri-proposal.png -------------------------------------------------------------------------------- /docs/images/nri.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/nri.png -------------------------------------------------------------------------------- /docs/images/nvlink.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/nvlink.jpg -------------------------------------------------------------------------------- /docs/images/proxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/proxy.png -------------------------------------------------------------------------------- /docs/images/qos-cpu-orchestration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/qos-cpu-orchestration.png -------------------------------------------------------------------------------- /docs/images/quotaguarantee1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/quotaguarantee1.jpg -------------------------------------------------------------------------------- /docs/images/quotaguarantee2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/quotaguarantee2.jpg -------------------------------------------------------------------------------- /docs/images/quotatree.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/quotatree.jpg -------------------------------------------------------------------------------- /docs/images/quotatree1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/quotatree1.jpg -------------------------------------------------------------------------------- /docs/images/quotatree2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/quotatree2.jpg -------------------------------------------------------------------------------- /docs/images/quotatree3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/quotatree3.jpg -------------------------------------------------------------------------------- /docs/images/quotatree4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/quotatree4.jpg -------------------------------------------------------------------------------- /docs/images/resctrl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/resctrl.png -------------------------------------------------------------------------------- /docs/images/runtimequota1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/runtimequota1.jpg -------------------------------------------------------------------------------- /docs/images/runtimequota2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/runtimequota2.jpg -------------------------------------------------------------------------------- /docs/images/runtimequota3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/runtimequota3.jpg -------------------------------------------------------------------------------- /docs/images/runtimequota4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/runtimequota4.jpg -------------------------------------------------------------------------------- /docs/images/standalone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/standalone.png -------------------------------------------------------------------------------- /docs/images/tcplugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/images/tcplugin.png -------------------------------------------------------------------------------- /docs/slides/koordinator-CPU-Co-location.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koordinator-sh/koordinator/73fa3234ab5fdccbd1eefe33eb3cc76f11498d68/docs/slides/koordinator-CPU-Co-location.pptx -------------------------------------------------------------------------------- /examples/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | approvers: 4 | - ci-approvers 5 | reviewers: 6 | - ci-approvers 7 | -------------------------------------------------------------------------------- /examples/nginx/nginx.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: nginx 5 | labels: 6 | app: nginx 7 | spec: 8 | replicas: 2 9 | selector: 10 | matchLabels: 11 | app: nginx 12 | template: 13 | metadata: 14 | name: nginx 15 | labels: 16 | app: nginx 17 | koordinator.sh/qosClass: LS 18 | spec: 19 | containers: 20 | - name: nginx 21 | image: docker.io/koordinatorsh/nginx:v1.18-koord-example 22 | command: 23 | - "nginx" 24 | - "-g" 25 | - "daemon off; worker_processes 4;" 26 | imagePullPolicy: IfNotPresent 27 | resources: 28 | requests: 29 | cpu: 4 30 | memory: "1Gi" 31 | limits: 32 | cpu: 4 33 | memory: "1Gi" 34 | -------------------------------------------------------------------------------- /examples/runtime-hook-server/koordlet.json: -------------------------------------------------------------------------------- 1 | { 2 | "remote-endpoint": "/var/run/koordlet-runtimehookserver.sock", 3 | "failure-policy": "Fail", 4 | "runtime-hooks": [ 5 | "PreRunPodSandbox" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /examples/spark-jobs/cluster-colocation-profile.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: spark-demo 5 | labels: 6 | koordinator.sh/enable-colocation: "true" 7 | --- 8 | apiVersion: config.koordinator.sh/v1alpha1 9 | kind: ClusterColocationProfile 10 | metadata: 11 | name: spark-demo 12 | spec: 13 | namespaceSelector: 14 | matchLabels: 15 | koordinator.sh/enable-colocation: "true" 16 | selector: 17 | matchLabels: 18 | sparkoperator.k8s.io/launched-by-spark-operator: "true" 19 | qosClass: BE 20 | priorityClassName: koord-batch 21 | koordinatorPriority: 1000 22 | schedulerName: koord-scheduler -------------------------------------------------------------------------------- /examples/spark-jobs/service-account.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: spark-demo 5 | --- 6 | apiVersion: v1 7 | kind: ServiceAccount 8 | metadata: 9 | namespace: spark-demo 10 | name: spark 11 | --- 12 | apiVersion: rbac.authorization.k8s.io/v1 13 | kind: ClusterRoleBinding 14 | metadata: 15 | name: spark-role-binding 16 | roleRef: 17 | apiGroup: rbac.authorization.k8s.io 18 | kind: ClusterRole 19 | name: edit 20 | subjects: 21 | - kind: ServiceAccount 22 | name: spark 23 | namespace: spark-demo -------------------------------------------------------------------------------- /examples/spark-operator-chart/.helmignore: -------------------------------------------------------------------------------- 1 | ci/ -------------------------------------------------------------------------------- /examples/spark-operator-chart/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: spark-operator 3 | description: A Helm chart for Spark on Kubernetes operator 4 | version: 1.1.17 5 | appVersion: v1beta2-1.3.3-3.1.1 6 | keywords: 7 | - spark 8 | home: https://github.com/GoogleCloudPlatform/spark-on-k8s-operator 9 | maintainers: 10 | - name: yuchaoran2011 11 | email: yuchaoran2011@gmail.com 12 | -------------------------------------------------------------------------------- /examples/spark-operator-chart/ci/ci-values.yaml: -------------------------------------------------------------------------------- 1 | image: 2 | tag: "local" 3 | -------------------------------------------------------------------------------- /examples/spark-operator-chart/templates/prometheus-podmonitor.yaml: -------------------------------------------------------------------------------- 1 | {{ if and .Values.metrics.enable .Values.podMonitor.enable }} 2 | apiVersion: monitoring.coreos.com/v1 3 | kind: PodMonitor 4 | metadata: 5 | name: {{ include "spark-operator.name" . -}}-podmonitor 6 | labels: {{ toYaml .Values.podMonitor.labels | nindent 4 }} 7 | spec: 8 | podMetricsEndpoints: 9 | - interval: {{ .Values.podMonitor.podMetricsEndpoint.interval }} 10 | port: {{ .Values.metrics.portName | quote }} 11 | scheme: {{ .Values.podMonitor.podMetricsEndpoint.scheme }} 12 | jobLabel: {{ .Values.podMonitor.jobLabel }} 13 | namespaceSelector: 14 | matchNames: 15 | - {{ .Release.Namespace }} 16 | selector: 17 | matchLabels: 18 | {{- include "spark-operator.selectorLabels" . | nindent 6 }} 19 | {{ end }} -------------------------------------------------------------------------------- /examples/spark-operator-chart/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.serviceAccounts.sparkoperator.create }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "spark-operator.serviceAccountName" . }} 6 | annotations: 7 | "helm.sh/hook": pre-install 8 | "helm.sh/hook-delete-policy": hook-failed, before-hook-creation 9 | {{- with .Values.serviceAccounts.sparkoperator.annotations }} 10 | {{ toYaml . | indent 4 }} 11 | {{- end }} 12 | labels: 13 | {{- include "spark-operator.labels" . | nindent 4 }} 14 | {{- end }} 15 | -------------------------------------------------------------------------------- /examples/spark-operator-chart/templates/spark-rbac.yaml: -------------------------------------------------------------------------------- 1 | {{- if or .Values.rbac.create .Values.rbac.createRole }} 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: Role 4 | metadata: 5 | name: spark-role 6 | namespace: {{ default .Release.Namespace .Values.sparkJobNamespace }} 7 | labels: 8 | {{- include "spark-operator.labels" . | nindent 4 }} 9 | rules: 10 | - apiGroups: 11 | - "" 12 | resources: 13 | - pods 14 | verbs: 15 | - "*" 16 | - apiGroups: 17 | - "" 18 | resources: 19 | - services 20 | verbs: 21 | - "*" 22 | - apiGroups: 23 | - "" 24 | resources: 25 | - configmaps 26 | verbs: 27 | - "*" 28 | - apiGroups: 29 | - "" 30 | resources: 31 | - persistentvolumeclaims 32 | verbs: 33 | - "*" 34 | --- 35 | 36 | apiVersion: rbac.authorization.k8s.io/v1 37 | kind: RoleBinding 38 | metadata: 39 | name: spark 40 | namespace: {{ default .Release.Namespace .Values.sparkJobNamespace }} 41 | labels: 42 | {{- include "spark-operator.labels" . | nindent 4 }} 43 | subjects: 44 | - kind: ServiceAccount 45 | name: {{ include "spark.serviceAccountName" . }} 46 | namespace: {{ default .Release.Namespace .Values.sparkJobNamespace }} 47 | roleRef: 48 | kind: Role 49 | name: spark-role 50 | apiGroup: rbac.authorization.k8s.io 51 | {{- end }} 52 | -------------------------------------------------------------------------------- /examples/spark-operator-chart/templates/spark-serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.serviceAccounts.spark.create }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "spark.serviceAccountName" . }} 6 | namespace: {{ default .Release.Namespace .Values.sparkJobNamespace }} 7 | {{- with .Values.serviceAccounts.spark.annotations }} 8 | annotations: 9 | {{ toYaml . | indent 4 }} 10 | {{- end }} 11 | labels: 12 | {{- include "spark-operator.labels" . | nindent 4 }} 13 | {{- end }} 14 | -------------------------------------------------------------------------------- /examples/spark-operator-chart/templates/webhook-service.yaml: -------------------------------------------------------------------------------- 1 | {{ if .Values.webhook.enable }} 2 | kind: Service 3 | apiVersion: v1 4 | metadata: 5 | name: {{ include "spark-operator.fullname" . }}-webhook 6 | labels: 7 | {{- include "spark-operator.labels" . | nindent 4 }} 8 | spec: 9 | ports: 10 | - port: 443 11 | targetPort: {{ .Values.webhook.port }} 12 | name: webhook 13 | selector: 14 | {{- include "spark-operator.selectorLabels" . | nindent 4 }} 15 | {{ end }} 16 | -------------------------------------------------------------------------------- /hack/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | approvers: 4 | - ci-approvers 5 | reviewers: 6 | - ci-approvers 7 | -------------------------------------------------------------------------------- /hack/boilerplate/boilerplate.go.txt: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | -------------------------------------------------------------------------------- /hack/kustomize.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | KUSTOMIZE=$1 4 | 5 | ${KUSTOMIZE} build config/default | \ 6 | perl -pe 's#koord-webhook-service#koordinator-webhook-service#g' | \ 7 | perl -pe 's#koord-koordlet#koordlet#g' | \ 8 | perl -pe 's#koord-slo-controller-config#slo-controller-config#g' | \ 9 | perl -pe 's#koord-(.*)-webhook-configuration#koordinator-$1-webhook-configuration#g' 10 | -------------------------------------------------------------------------------- /hack/tools.go: -------------------------------------------------------------------------------- 1 | //go:build tools 2 | // +build tools 3 | 4 | /* 5 | Copyright 2022 The Koordinator Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package hack 21 | 22 | import ( 23 | // To generate clientset/informers/listers for apis 24 | _ "k8s.io/code-generator" 25 | 26 | // submodule test dependencies 27 | // https://github.com/kubernetes-sigs/controller-runtime/issues/1670 28 | _ "sigs.k8s.io/controller-runtime/tools/setup-envtest" 29 | ) 30 | -------------------------------------------------------------------------------- /hack/update-license-header.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright 2022 The Koordinator Authors. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | PROJECT=$(cd $(dirname $0)/..; pwd) 19 | 20 | LICENSEHEADERCHECKER_VERSION=v1.5.0 21 | 22 | GOBIN=${PROJECT}/bin go install github.com/lluissm/license-header-checker/cmd/license-header-checker@${LICENSEHEADERCHECKER_VERSION} 23 | 24 | LICENSEIGNORE=$(cat ${PROJECT}/.licenseignore | tr '\n' ',') 25 | 26 | ${PROJECT}/bin/license-header-checker -r -a -v -i ${LICENSEIGNORE} ${PROJECT}/hack/boilerplate/boilerplate.go.txt . go 27 | -------------------------------------------------------------------------------- /pkg/client/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | approvers: 4 | - api-machinery-approvers 5 | reviewers: 6 | - api-machinery-approvers 7 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // This package has the automatically generated clientset. 20 | package versioned 21 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // This package has the automatically generated fake clientset. 20 | package fake 21 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/scheme/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // This package contains the scheme of the automatically generated clientset. 20 | package scheme 21 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/analysis/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // This package has the automatically generated typed clients. 20 | package v1alpha1 21 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/analysis/v1alpha1/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // Package fake has the automatically generated clients. 20 | package fake 21 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/analysis/v1alpha1/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | type RecommendationExpansion interface{} 22 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/config/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // This package has the automatically generated typed clients. 20 | package v1alpha1 21 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/config/v1alpha1/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // Package fake has the automatically generated clients. 20 | package fake 21 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/config/v1alpha1/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | type ClusterColocationProfileExpansion interface{} 22 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/quota/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // This package has the automatically generated typed clients. 20 | package v1alpha1 21 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/quota/v1alpha1/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // Package fake has the automatically generated clients. 20 | package fake 21 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/quota/v1alpha1/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | type ElasticQuotaProfileExpansion interface{} 22 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/scheduling/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // This package has the automatically generated typed clients. 20 | package v1alpha1 21 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/scheduling/v1alpha1/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // Package fake has the automatically generated clients. 20 | package fake 21 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/scheduling/v1alpha1/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | type DeviceExpansion interface{} 22 | 23 | type PodMigrationJobExpansion interface{} 24 | 25 | type ReservationExpansion interface{} 26 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/slo/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // This package has the automatically generated typed clients. 20 | package v1alpha1 21 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/slo/v1alpha1/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // Package fake has the automatically generated clients. 20 | package fake 21 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/slo/v1alpha1/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | type NodeMetricExpansion interface{} 22 | 23 | type NodeSLOExpansion interface{} 24 | -------------------------------------------------------------------------------- /pkg/client/listers/analysis/v1alpha1/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by lister-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // RecommendationListerExpansion allows custom methods to be added to 22 | // RecommendationLister. 23 | type RecommendationListerExpansion interface{} 24 | 25 | // RecommendationNamespaceListerExpansion allows custom methods to be added to 26 | // RecommendationNamespaceLister. 27 | type RecommendationNamespaceListerExpansion interface{} 28 | -------------------------------------------------------------------------------- /pkg/client/listers/config/v1alpha1/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by lister-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // ClusterColocationProfileListerExpansion allows custom methods to be added to 22 | // ClusterColocationProfileLister. 23 | type ClusterColocationProfileListerExpansion interface{} 24 | -------------------------------------------------------------------------------- /pkg/client/listers/quota/v1alpha1/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by lister-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // ElasticQuotaProfileListerExpansion allows custom methods to be added to 22 | // ElasticQuotaProfileLister. 23 | type ElasticQuotaProfileListerExpansion interface{} 24 | 25 | // ElasticQuotaProfileNamespaceListerExpansion allows custom methods to be added to 26 | // ElasticQuotaProfileNamespaceLister. 27 | type ElasticQuotaProfileNamespaceListerExpansion interface{} 28 | -------------------------------------------------------------------------------- /pkg/client/listers/scheduling/v1alpha1/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by lister-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // DeviceListerExpansion allows custom methods to be added to 22 | // DeviceLister. 23 | type DeviceListerExpansion interface{} 24 | 25 | // PodMigrationJobListerExpansion allows custom methods to be added to 26 | // PodMigrationJobLister. 27 | type PodMigrationJobListerExpansion interface{} 28 | 29 | // ReservationListerExpansion allows custom methods to be added to 30 | // ReservationLister. 31 | type ReservationListerExpansion interface{} 32 | -------------------------------------------------------------------------------- /pkg/client/listers/slo/v1alpha1/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by lister-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // NodeMetricListerExpansion allows custom methods to be added to 22 | // NodeMetricLister. 23 | type NodeMetricListerExpansion interface{} 24 | 25 | // NodeSLOListerExpansion allows custom methods to be added to 26 | // NodeSLOLister. 27 | type NodeSLOListerExpansion interface{} 28 | -------------------------------------------------------------------------------- /pkg/descheduler/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | approvers: 4 | - descheduler-approvers 5 | reviewers: 6 | - descheduler-approvers 7 | -------------------------------------------------------------------------------- /pkg/descheduler/apis/config/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // +k8s:deepcopy-gen=package 18 | // +groupName=descheduler 19 | 20 | package config 21 | -------------------------------------------------------------------------------- /pkg/descheduler/apis/config/v1alpha2/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // +k8s:deepcopy-gen=package 18 | // +k8s:conversion-gen=github.com/koordinator-sh/koordinator/pkg/descheduler/apis/config 19 | // +k8s:conversion-gen=k8s.io/component-base/config/v1alpha1 20 | // +k8s:defaulter-gen=TypeMeta 21 | // +k8s:defaulter-gen-input=. 22 | // +groupName=descheduler 23 | 24 | // Package v1alpha2 is the v1alpha2 version of the descheduler API 25 | package v1alpha2 26 | -------------------------------------------------------------------------------- /pkg/descheduler/controllers/names/names.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package names 18 | 19 | const ( 20 | MigrationController = "MigrationController" 21 | ) 22 | -------------------------------------------------------------------------------- /pkg/descheduler/controllers/options/manager.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | Copyright 2022 The Kubernetes Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package options 19 | 20 | import ( 21 | ctrl "sigs.k8s.io/controller-runtime" 22 | ) 23 | 24 | // Manager is set when initializing descheduler. 25 | // Some descheduling scenarios need to be implemented as Controller 26 | // via controller-runtime to simplify the implementation. 27 | var Manager ctrl.Manager 28 | -------------------------------------------------------------------------------- /pkg/descheduler/controllers/registry.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package controllers 18 | 19 | import ( 20 | "github.com/koordinator-sh/koordinator/pkg/descheduler/controllers/migration" 21 | "github.com/koordinator-sh/koordinator/pkg/descheduler/framework/runtime" 22 | ) 23 | 24 | func NewControllerRegistry() runtime.Registry { 25 | return runtime.Registry{ 26 | migration.Name: migration.New, 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /pkg/descheduler/framework/plugins/registry.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package plugins 18 | 19 | import ( 20 | "github.com/koordinator-sh/koordinator/pkg/descheduler/framework/plugins/kubernetes" 21 | "github.com/koordinator-sh/koordinator/pkg/descheduler/framework/plugins/loadaware" 22 | "github.com/koordinator-sh/koordinator/pkg/descheduler/framework/runtime" 23 | ) 24 | 25 | func NewInTreeRegistry() runtime.Registry { 26 | registry := runtime.Registry{ 27 | loadaware.LowNodeLoadName: loadaware.NewLowNodeLoad, 28 | } 29 | kubernetes.SetupK8sDeschedulerPlugins(registry) 30 | return registry 31 | } 32 | -------------------------------------------------------------------------------- /pkg/descheduler/utils/anomaly/types.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package anomaly 18 | 19 | import ( 20 | "fmt" 21 | ) 22 | 23 | // State is a type that represents a state of Detector. 24 | type State int 25 | 26 | // These constants are states of Detector. 27 | const ( 28 | StateOK State = iota 29 | StateAnomaly 30 | ) 31 | 32 | // String implements stringer interface. 33 | func (s State) String() string { 34 | switch s { 35 | case StateOK: 36 | return "ok" 37 | case StateAnomaly: 38 | return "anomaly" 39 | default: 40 | return fmt.Sprintf("unknown state: %d", s) 41 | } 42 | } 43 | 44 | type Detector interface { 45 | Name() string 46 | Mark(normality bool) (State, error) 47 | State() State 48 | Reset() 49 | } 50 | -------------------------------------------------------------------------------- /pkg/features/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | approvers: 4 | - api-machinery-approvers 5 | reviewers: 6 | - api-machinery-approvers 7 | -------------------------------------------------------------------------------- /pkg/koordlet/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | approvers: 4 | - koordlet-approvers 5 | reviewers: 6 | - koordlet-approvers 7 | -------------------------------------------------------------------------------- /pkg/koordlet/config/config_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package config 18 | 19 | import ( 20 | "flag" 21 | "testing" 22 | 23 | "github.com/stretchr/testify/assert" 24 | ) 25 | 26 | func TestConfiguration_InitFlags(t *testing.T) { 27 | cmdArgs := []string{ 28 | "", 29 | "--collect-res-used-interval=2s", 30 | "--reconcile-interval-seconds=5", 31 | "--cgroup-root-dir=/host-cgroup/", 32 | "--feature-gates=AllBeta=true,AllAlpha=false", 33 | } 34 | t.Run("ensure not panic", func(t *testing.T) { 35 | fs := flag.NewFlagSet(cmdArgs[0], flag.ExitOnError) 36 | cfg := NewConfiguration() 37 | cfg.InitFlags(fs) 38 | err := fs.Parse(cmdArgs[1:]) 39 | assert.NoError(t, err) 40 | }) 41 | } 42 | -------------------------------------------------------------------------------- /pkg/koordlet/extension/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package extension 18 | 19 | import ( 20 | clientset "k8s.io/client-go/kubernetes" 21 | 22 | "github.com/koordinator-sh/koordinator/pkg/koordlet/statesinformer" 23 | ) 24 | 25 | type Controller interface { 26 | Run(stopCh <-chan struct{}) error 27 | Name() string 28 | } 29 | 30 | type ControllerInitFunc = func(nodeName string, kubeClient clientset.Interface, statesInformer statesinformer.StatesInformer) Controller 31 | -------------------------------------------------------------------------------- /pkg/koordlet/koordlet_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package agent 18 | 19 | import ( 20 | "testing" 21 | 22 | "github.com/stretchr/testify/assert" 23 | 24 | "github.com/koordinator-sh/koordinator/pkg/koordlet/config" 25 | ) 26 | 27 | func TestNewDaemon(t *testing.T) { 28 | cfg := config.NewConfiguration() 29 | assert.NotPanics(t, func() { 30 | d, err := NewDaemon(cfg) 31 | assert.Nil(t, d) 32 | assert.Error(t, err) 33 | }) 34 | } 35 | -------------------------------------------------------------------------------- /pkg/koordlet/metriccache/api.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package metriccache 18 | 19 | import ( 20 | "github.com/koordinator-sh/koordinator/pkg/koordlet/util" 21 | ) 22 | 23 | type NodeCPUInfo util.LocalCPUInfo 24 | 25 | type NodeLocalStorageInfo util.LocalStorageInfo 26 | 27 | type Devices util.Devices 28 | -------------------------------------------------------------------------------- /pkg/koordlet/metriccache/kv_storage.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package metriccache 18 | 19 | import "sync" 20 | 21 | type KVStorage interface { 22 | Get(key interface{}) (interface{}, bool) 23 | Set(key, value interface{}) 24 | } 25 | 26 | type memoryStorage struct { 27 | value sync.Map 28 | } 29 | 30 | func NewMemoryStorage() KVStorage { 31 | return &memoryStorage{value: sync.Map{}} 32 | } 33 | 34 | func (ms *memoryStorage) Get(key interface{}) (interface{}, bool) { 35 | return ms.value.Load(key) 36 | } 37 | 38 | func (ms *memoryStorage) Set(key, value interface{}) { 39 | ms.value.Store(key, value) 40 | } 41 | -------------------------------------------------------------------------------- /pkg/koordlet/metrics/external_metrics.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package metrics 18 | 19 | import "github.com/prometheus/client_golang/prometheus" 20 | 21 | const ( 22 | ExternalHTTPPath = "/external-metrics" 23 | ) 24 | 25 | var ( 26 | // ExternalRegistry register metrics for users such as PMU or extended resources settings 27 | ExternalRegistry = prometheus.NewRegistry() 28 | ) 29 | 30 | func ExternalMustRegister(metrics ...prometheus.Collector) { 31 | ExternalRegistry.MustRegister(metrics...) 32 | } 33 | 34 | func init() { 35 | ExternalMustRegister(ResourceSummaryCollectors...) 36 | ExternalMustRegister(CPICollectors...) 37 | ExternalMustRegister(PSICollectors...) 38 | ExternalMustRegister(ResctrlCollectors...) 39 | } 40 | -------------------------------------------------------------------------------- /pkg/koordlet/metricsadvisor/collectors/performance/performance_collector.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package performance 18 | 19 | const ( 20 | CollectorName = "PerformanceCollector" 21 | ) 22 | -------------------------------------------------------------------------------- /pkg/koordlet/metricsadvisor/collectors/performance/performance_collector_unsupported.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | /* 5 | Copyright 2022 The Koordinator Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package performance 21 | 22 | import ( 23 | "github.com/koordinator-sh/koordinator/pkg/koordlet/metricsadvisor/framework" 24 | ) 25 | 26 | type performanceCollector struct{} 27 | 28 | func New(opt *framework.Options) framework.Collector { 29 | return &performanceCollector{} 30 | } 31 | 32 | func (p *performanceCollector) Enabled() bool { 33 | return false 34 | } 35 | 36 | func (p *performanceCollector) Setup(c *framework.Context) {} 37 | 38 | func (p *performanceCollector) Run(stopCh <-chan struct{}) {} 39 | 40 | func (p *performanceCollector) Started() bool { 41 | return false 42 | } 43 | -------------------------------------------------------------------------------- /pkg/koordlet/metricsadvisor/devices/gpu/collector_gpu_unsupported.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | /* 5 | Copyright 2022 The Koordinator Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package gpu 21 | 22 | // initGPUDeviceManager will not retry if init fails, 23 | func initGPUDeviceManager() GPUDeviceManager { 24 | return &dummyDeviceManager{} 25 | } 26 | -------------------------------------------------------------------------------- /pkg/koordlet/metricsadvisor/devices/rdma/collector_rdma_unsupported.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | /* 5 | Copyright 2022 The Koordinator Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package rdma 21 | 22 | import ( 23 | "github.com/koordinator-sh/koordinator/pkg/koordlet/metriccache" 24 | ) 25 | 26 | func GetNetDevice() (metriccache.Devices, error) { 27 | // TODO: support rdma devices on non-linux 28 | return nil, nil 29 | } 30 | -------------------------------------------------------------------------------- /pkg/koordlet/metricsadvisor/framework/options.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package framework 18 | 19 | import ( 20 | "github.com/koordinator-sh/koordinator/pkg/koordlet/metriccache" 21 | "github.com/koordinator-sh/koordinator/pkg/koordlet/resourceexecutor" 22 | "github.com/koordinator-sh/koordinator/pkg/koordlet/statesinformer" 23 | ) 24 | 25 | type Options struct { 26 | Config *Config 27 | StatesInformer statesinformer.StatesInformer 28 | MetricCache metriccache.MetricCache 29 | CgroupReader resourceexecutor.CgroupReader 30 | PodFilters map[string]PodFilter 31 | } 32 | -------------------------------------------------------------------------------- /pkg/koordlet/pleg/watcher_other.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | /* 5 | Copyright 2022 The Koordinator Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package pleg 21 | 22 | import ( 23 | "k8s.io/utils/inotify" 24 | ) 25 | 26 | func NewWatcher() (Watcher, error) { 27 | return nil, errNotSupported 28 | } 29 | 30 | func TypeOf(event *inotify.Event) EventType { 31 | if event.Mask&IN_CREATE != 0 && event.Mask&IN_ISDIR != 0 { 32 | return DirCreated 33 | } 34 | if event.Mask&IN_DELETE != 0 && event.Mask&IN_ISDIR != 0 { 35 | return DirRemoved 36 | } 37 | return UnknownType 38 | } 39 | -------------------------------------------------------------------------------- /pkg/koordlet/qosmanager/framework/strategy.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package framework 18 | 19 | type QOSStrategyFactory = func(opt *Options) QOSStrategy 20 | 21 | type QOSStrategy interface { 22 | Enabled() bool 23 | Setup(*Context) 24 | Run(stopCh <-chan struct{}) 25 | } 26 | -------------------------------------------------------------------------------- /pkg/koordlet/qosmanager/helpers/reason.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package helpers 18 | 19 | const ( 20 | UpdateCPU = "UpdateCPU" 21 | UpdateMemory = "UpdateMemory" 22 | UpdateCgroups = "UpdateCgroups" // update cgroups excluding the options already stated above 23 | UpdateSystemConfig = "UpdateSystemConfig" 24 | UpdateResctrlSchemata = "UpdateResctrlSchemata" // update resctrl l3 cat schemata 25 | UpdateResctrlTasks = "UpdateResctrlTasks" // update resctrl tasks 26 | 27 | EvictPodByNodeMemoryUsage = "EvictPodByNodeMemoryUsage" 28 | EvictPodByBECPUSatisfaction = "EvictPodByBECPUSatisfaction" 29 | 30 | AdjustBEByNodeCPUUsage = "AdjustBEByNodeCPUUsage" 31 | 32 | EvictPodSuccess = "evictPodSuccess" 33 | EvictPodFail = "evictPodFail" 34 | ) 35 | -------------------------------------------------------------------------------- /pkg/koordlet/runtimehooks/hooks/tc/tc.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | /* 5 | Copyright 2022 The Koordinator Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package tc 21 | 22 | import ( 23 | "k8s.io/klog/v2" 24 | 25 | "github.com/koordinator-sh/koordinator/pkg/koordlet/runtimehooks/hooks" 26 | ) 27 | 28 | const ( 29 | name = "TCInjection" 30 | description = "set tc rules for nodes" 31 | ) 32 | 33 | type tcPlugin struct{} 34 | 35 | func Object() *tcPlugin { 36 | return nil 37 | } 38 | 39 | func (n *tcPlugin) Reconcile() { 40 | klog.V(5).Info("net qos plugin start to reconcile in !linux os") 41 | return 42 | } 43 | 44 | func (n *tcPlugin) Register(op hooks.Options) { 45 | klog.V(5).Infof("register hook %v", name) 46 | } 47 | -------------------------------------------------------------------------------- /pkg/koordlet/runtimehooks/protocol/filters.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package protocol 18 | 19 | import corev1 "k8s.io/api/core/v1" 20 | 21 | // NOTE: functions in this file can be overwritten for extension 22 | 23 | const ( 24 | runtimeClassKata = "kata" 25 | ) 26 | 27 | func ContainerReconcileIgnoreFilter(pod *corev1.Pod, container *corev1.Container, containerStat *corev1.ContainerStatus) bool { 28 | // for containers in kata pod, no need to reconcile container cgroup 29 | // TODO define filters as runtime hook plugin level 30 | if pod.Spec.RuntimeClassName != nil && *pod.Spec.RuntimeClassName == runtimeClassKata { 31 | return true 32 | } 33 | return false 34 | } 35 | -------------------------------------------------------------------------------- /pkg/koordlet/statesinformer/impl/extension_utils.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package impl 18 | 19 | import ( 20 | corev1 "k8s.io/api/core/v1" 21 | 22 | slov1alpha1 "github.com/koordinator-sh/koordinator/apis/slo/v1alpha1" 23 | ) 24 | 25 | // NOTE: functions in this file can be overwritten for extension 26 | 27 | // fillExtensionMap would fill the Extensions field in PodMetricInfo 28 | func (r *nodeMetricInformer) fillExtensionMap(info *slov1alpha1.PodMetricInfo, pod *corev1.Pod) {} 29 | -------------------------------------------------------------------------------- /pkg/koordlet/statesinformer/impl/registry.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package impl 18 | 19 | // NOTE: variables in this file can be overwritten for extension 20 | 21 | var DefaultPluginRegistry = map[PluginName]informerPlugin{ 22 | nodeSLOInformerName: NewNodeSLOInformer(), 23 | pvcInformerName: NewPVCInformer(), 24 | nodeTopoInformerName: NewNodeTopoInformer(), 25 | nodeInformerName: NewNodeInformer(), 26 | podsInformerName: NewPodsInformer(), 27 | podResourcesInformerName: newPodResourcesInformer(), 28 | nodeMetricInformerName: NewNodeMetricInformer(), 29 | } 30 | -------------------------------------------------------------------------------- /pkg/koordlet/statesinformer/impl/states_device_unsupported.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | /* 5 | Copyright 2022 The Koordinator Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package impl 21 | 22 | func (s *statesInformer) reportDevice() { 23 | return 24 | } 25 | 26 | func (s *statesInformer) initGPU() bool { 27 | return false 28 | } 29 | 30 | func (s *statesInformer) gpuHealCheck(stopCh <-chan struct{}) { 31 | return 32 | } 33 | 34 | func (s *statesInformer) getGPUDriverAndModel() (string, string) { 35 | return "", "" 36 | } 37 | -------------------------------------------------------------------------------- /pkg/koordlet/util/cold_page.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package util 18 | 19 | import ( 20 | "github.com/koordinator-sh/koordinator/pkg/koordlet/resourceexecutor" 21 | ) 22 | 23 | func GetNodeMemUsageWithHotPageCache(coldPageUsageBytes uint64) (uint64, error) { 24 | memInfo, err := GetMemInfo() 25 | if err != nil { 26 | return 0, err 27 | } 28 | return memInfo.MemTotal*1024 - memInfo.MemFree*1024 - coldPageUsageBytes, nil 29 | } 30 | 31 | func GetCgroupMemUsageWithHotPageCache(cgroupReader resourceexecutor.CgroupReader, parentDir string, coldPageUsageBytes uint64) (uint64, error) { 32 | memStat, err := cgroupReader.ReadMemoryStat(parentDir) 33 | if err != nil { 34 | return 0, err 35 | } 36 | return uint64(memStat.UsageWithPageCache()) - coldPageUsageBytes, nil 37 | } 38 | -------------------------------------------------------------------------------- /pkg/koordlet/util/perf_group/perf_group_unsupported.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | /* 5 | Copyright 2022 The Koordinator Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package perf_group 21 | 22 | import "os" 23 | 24 | type PerfGroupCollector struct { 25 | } 26 | 27 | func GetAndStartPerfGroupCollectorOnContainer(cgroupFile *os.File, cpus []int, events []string) (*PerfGroupCollector, error) { 28 | return nil, nil 29 | } 30 | 31 | func GetContainerCyclesAndInstructionsGroup(collector *PerfGroupCollector) (float64, float64, error) { 32 | return 0, 0, nil 33 | } 34 | -------------------------------------------------------------------------------- /pkg/koordlet/util/system/cgroup_driver_unsupported.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | /* 5 | Copyright 2022 The Koordinator Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package system 21 | 22 | func GetCgroupDriverFromCgroupName() CgroupDriverType { 23 | return "" 24 | } 25 | 26 | func GetCgroupDriverFromKubeletPort(port int) (CgroupDriverType, error) { 27 | return kubeletDefaultCgroupDriver, nil 28 | } 29 | 30 | func IsUsingCgroupsV2() bool { 31 | return false 32 | } 33 | -------------------------------------------------------------------------------- /pkg/koordlet/util/system/common_unsupported.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | /* 5 | Copyright 2022 The Koordinator Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package system 21 | 22 | import ( 23 | "fmt" 24 | ) 25 | 26 | func ProcCmdLine(procRoot string, pid int) ([]string, error) { 27 | return []string{}, fmt.Errorf("only support linux") 28 | } 29 | 30 | var PidOf = pidOfFn 31 | 32 | func pidOfFn(procRoot string, name string) ([]int, error) { 33 | return []int{}, fmt.Errorf("only support linux") 34 | } 35 | 36 | var ExecCmdOnHost = execCmdOnHostFn 37 | 38 | func execCmdOnHostFn(cmds []string) ([]byte, int, error) { 39 | return nil, -1, fmt.Errorf("only support linux") 40 | } 41 | 42 | func WorkingDirOf(pid int) (string, error) { 43 | return "", fmt.Errorf("only support linux") 44 | } 45 | -------------------------------------------------------------------------------- /pkg/koordlet/util/system/cpu_manager_linux.go: -------------------------------------------------------------------------------- 1 | //go:build linux 2 | // +build linux 3 | 4 | /* 5 | Copyright 2022 The Koordinator Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package system 21 | 22 | import ( 23 | "fmt" 24 | ) 25 | 26 | func GetKubeletCommandline(port int) ([]string, error) { 27 | kubeletPid, err := KubeletPortToPid(port) 28 | if err != nil { 29 | return nil, err 30 | } 31 | 32 | kubeletArgs, err := ProcCmdLine(Conf.ProcRootDir, kubeletPid) 33 | if err != nil || len(kubeletArgs) <= 1 { 34 | return nil, fmt.Errorf("failed to get kubelet's args: %v", err) 35 | } 36 | return kubeletArgs, nil 37 | } 38 | -------------------------------------------------------------------------------- /pkg/koordlet/util/system/cpu_manager_unsupported.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | /* 5 | Copyright 2022 The Koordinator Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package system 21 | 22 | import ( 23 | "fmt" 24 | ) 25 | 26 | func GetKubeletCommandline(port int) ([]string, error) { 27 | return nil, fmt.Errorf("unsupported") 28 | } 29 | -------------------------------------------------------------------------------- /pkg/koordlet/util/system/device_numbers_linux.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package system 18 | 19 | import ( 20 | "fmt" 21 | "os" 22 | "syscall" 23 | ) 24 | 25 | func major(dev uint64) int64 { 26 | return int64((dev>>8)&0xff) | int64((dev>>12)&0xfff00) 27 | } 28 | 29 | func minor(dev uint64) int64 { 30 | return int64(dev&0xff) | int64((dev>>12)&0xffffff00) 31 | } 32 | 33 | func GetDeviceNumbers(devicePath string) ([]int64, error) { 34 | fileInfo, err := os.Stat(devicePath) 35 | if err != nil { 36 | return nil, fmt.Errorf("failed to stat device file: %v", err) 37 | } 38 | deviceNumber := fileInfo.Sys().(*syscall.Stat_t).Rdev 39 | major := major(deviceNumber) 40 | minor := minor(deviceNumber) 41 | return []int64{major, minor}, nil 42 | } 43 | -------------------------------------------------------------------------------- /pkg/koordlet/util/system/device_numbers_unsupported.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | /* 5 | Copyright 2022 The Koordinator Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package system 21 | 22 | func GetDeviceNumbers(devicePath string) ([]int64, error) { 23 | // TODO implement it 24 | return []int64{0, 0}, nil 25 | } 26 | -------------------------------------------------------------------------------- /pkg/koordlet/util/system/resctrl_unsupported.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | /* 5 | Copyright 2022 The Koordinator Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package system 21 | 22 | import "fmt" 23 | 24 | // MountResctrlSubsystem is not supported for non-linux os 25 | func MountResctrlSubsystem() (bool, error) { 26 | return false, fmt.Errorf("only support linux") 27 | } 28 | -------------------------------------------------------------------------------- /pkg/prediction/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | approvers: 4 | - prediction-approvers 5 | reviewers: 6 | - prediction-approvers 7 | -------------------------------------------------------------------------------- /pkg/quota-controller/profile/util.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package profile 18 | 19 | import ( 20 | corev1 "k8s.io/api/core/v1" 21 | ) 22 | 23 | func GetNodeAllocatable(node corev1.Node) corev1.ResourceList { 24 | return node.Status.Allocatable.DeepCopy() 25 | } 26 | -------------------------------------------------------------------------------- /pkg/runtimeproxy/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | approvers: 4 | - runtime-proxy-approvers 5 | reviewers: 6 | - runtime-proxy-approvers 7 | -------------------------------------------------------------------------------- /pkg/runtimeproxy/server/server.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package server 18 | 19 | type RuntimeManagerServer interface { 20 | Name() string 21 | Run() error 22 | } 23 | -------------------------------------------------------------------------------- /pkg/runtimeproxy/utils/utils.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package utils 18 | 19 | type CallHookPluginOperation string 20 | 21 | const ( 22 | ShouldCallHookPlugin CallHookPluginOperation = "ShouldCallHookPlugin" 23 | ShouldNotCallHookPluginAlways CallHookPluginOperation = "ShouldNotCallHookPluginAlways" 24 | Unknown CallHookPluginOperation = "Unknown" 25 | ) 26 | 27 | func MergeMap(a, b map[string]string) map[string]string { 28 | if a == nil { 29 | a = make(map[string]string) 30 | } 31 | for key, val := range b { 32 | a[key] = val 33 | } 34 | return a 35 | } 36 | -------------------------------------------------------------------------------- /pkg/scheduler/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | approvers: 4 | - scheduler-approvers 5 | reviewers: 6 | - scheduler-approvers 7 | -------------------------------------------------------------------------------- /pkg/scheduler/apis/config/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // +k8s:deepcopy-gen=package 18 | // +groupName=kubescheduler.config.k8s.io 19 | 20 | // Package config of the API. 21 | package config 22 | -------------------------------------------------------------------------------- /pkg/scheduler/apis/config/v1/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // +k8s:deepcopy-gen=package 18 | // +k8s:conversion-gen=github.com/koordinator-sh/koordinator/pkg/scheduler/apis/config 19 | // +k8s:defaulter-gen=TypeMeta 20 | // +k8s:defaulter-gen-input=. 21 | // +groupName=kubescheduler.config.k8s.io 22 | 23 | // Package v1 24 | package v1 25 | -------------------------------------------------------------------------------- /pkg/scheduler/apis/config/v1beta3/conversion_plugin.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package v1beta3 18 | 19 | import ( 20 | "k8s.io/apimachinery/pkg/conversion" 21 | 22 | "github.com/koordinator-sh/koordinator/pkg/scheduler/apis/config" 23 | ) 24 | 25 | func Convert_v1beta3_LoadAwareSchedulingArgs_To_config_LoadAwareSchedulingArgs(in *LoadAwareSchedulingArgs, out *config.LoadAwareSchedulingArgs, s conversion.Scope) error { 26 | if err := autoConvert_v1beta3_LoadAwareSchedulingArgs_To_config_LoadAwareSchedulingArgs(in, out, s); err != nil { 27 | return err 28 | } 29 | 30 | *out.FilterExpiredNodeMetrics = true 31 | 32 | return nil 33 | } 34 | -------------------------------------------------------------------------------- /pkg/scheduler/apis/config/v1beta3/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // +k8s:deepcopy-gen=package 18 | // +k8s:conversion-gen=github.com/koordinator-sh/koordinator/pkg/scheduler/apis/config 19 | // +k8s:defaulter-gen=TypeMeta 20 | // +k8s:defaulter-gen-input=. 21 | // +groupName=kubescheduler.config.k8s.io 22 | 23 | // Package v1beta3 24 | package v1beta3 25 | -------------------------------------------------------------------------------- /pkg/scheduler/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package scheduler 18 | -------------------------------------------------------------------------------- /pkg/scheduler/frameworkext/indexer/add_indexer.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package indexer 18 | 19 | import ( 20 | koordinatorinformers "github.com/koordinator-sh/koordinator/pkg/client/informers/externalversions" 21 | ) 22 | 23 | type addIndexerFunc func(koordinatorSharedInformerFactory koordinatorinformers.SharedInformerFactory) error 24 | 25 | var addIndexerFuncList = []addIndexerFunc{} 26 | 27 | // AddIndexers add indexers to koordinator informer 28 | func AddIndexers(koordinatorSharedInformerFactory koordinatorinformers.SharedInformerFactory) error { 29 | if koordinatorSharedInformerFactory == nil { 30 | return nil 31 | } 32 | for _, f := range addIndexerFuncList { 33 | if err := f(koordinatorSharedInformerFactory); err != nil { 34 | return err 35 | } 36 | } 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /pkg/scheduler/plugins/coscheduling/plugin_service.go: -------------------------------------------------------------------------------- 1 | package coscheduling 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/gin-gonic/gin" 7 | 8 | "github.com/koordinator-sh/koordinator/pkg/scheduler/frameworkext/services" 9 | "github.com/koordinator-sh/koordinator/pkg/scheduler/plugins/coscheduling/util" 10 | ) 11 | 12 | var _ services.APIServiceProvider = &Coscheduling{} 13 | 14 | func (cs *Coscheduling) RegisterEndpoints(group *gin.RouterGroup) { 15 | group.GET("/gang/:namespace/:name", func(c *gin.Context) { 16 | gangNamespace := c.Param("namespace") 17 | gangName := c.Param("name") 18 | gangId := util.GetId(gangNamespace, gangName) 19 | gangSummary, exist := cs.pgMgr.GetGangSummary(gangId) 20 | if !exist { 21 | services.ResponseErrorMessage(c, http.StatusNotFound, "cannot find gang %s/%s", gangNamespace, gangName) 22 | return 23 | } 24 | c.JSON(http.StatusOK, gangSummary) 25 | }) 26 | group.GET("/gangs", func(c *gin.Context) { 27 | allGangSummaries := cs.pgMgr.GetGangSummaries() 28 | c.JSON(http.StatusOK, allGangSummaries) 29 | }) 30 | } 31 | -------------------------------------------------------------------------------- /pkg/scheduler/plugins/elasticquota/candidate.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package elasticquota 18 | 19 | import ( 20 | extenderv1 "k8s.io/kube-scheduler/extender/v1" 21 | ) 22 | 23 | type candidate struct { 24 | victims *extenderv1.Victims 25 | name string 26 | } 27 | 28 | // Victims returns s.victims. 29 | func (s *candidate) Victims() *extenderv1.Victims { 30 | return s.victims 31 | } 32 | 33 | // Name returns s.name. 34 | func (s *candidate) Name() string { 35 | return s.name 36 | } 37 | -------------------------------------------------------------------------------- /pkg/scheduler/plugins/elasticquota/core/helper.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package core 18 | 19 | import ( 20 | corev1 "k8s.io/api/core/v1" 21 | k8sfeature "k8s.io/apiserver/pkg/util/feature" 22 | apiresource "k8s.io/kubernetes/pkg/api/v1/resource" 23 | 24 | "github.com/koordinator-sh/koordinator/pkg/features" 25 | ) 26 | 27 | func PodRequests(pod *corev1.Pod) (reqs corev1.ResourceList) { 28 | if k8sfeature.DefaultFeatureGate.Enabled(features.ElasticQuotaIgnorePodOverhead) { 29 | return apiresource.PodRequests(pod, apiresource.PodResourcesOptions{ 30 | ExcludeOverhead: true, 31 | }) 32 | } 33 | return apiresource.PodRequests(pod, apiresource.PodResourcesOptions{}) 34 | } 35 | -------------------------------------------------------------------------------- /pkg/slo-controller/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | approvers: 4 | - slo-controller-approvers 5 | reviewers: 6 | - slo-controller-approvers 7 | -------------------------------------------------------------------------------- /pkg/slo-controller/nodemetric/nodemetric.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package nodemetric 18 | 19 | import ( 20 | "fmt" 21 | 22 | corev1 "k8s.io/api/core/v1" 23 | 24 | slov1alpha1 "github.com/koordinator-sh/koordinator/apis/slo/v1alpha1" 25 | ) 26 | 27 | func (r *NodeMetricReconciler) initNodeMetric(node *corev1.Node, nodeMetric *slov1alpha1.NodeMetric) error { 28 | if node == nil || nodeMetric == nil { 29 | return fmt.Errorf("both Node and NodeMetric should not be empty") 30 | } 31 | 32 | nodeMetricSpec, err := r.getNodeMetricSpec(node, nil) 33 | if err != nil { 34 | return err 35 | } 36 | 37 | nodeMetric.Spec = *nodeMetricSpec 38 | nodeMetric.SetName(node.GetName()) 39 | nodeMetric.SetNamespace(node.GetNamespace()) 40 | 41 | return nil 42 | } 43 | -------------------------------------------------------------------------------- /pkg/slo-controller/noderesource/framework/option_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package framework 18 | 19 | import ( 20 | "testing" 21 | 22 | "github.com/stretchr/testify/assert" 23 | "k8s.io/apimachinery/pkg/runtime" 24 | "k8s.io/client-go/tools/record" 25 | "sigs.k8s.io/controller-runtime/pkg/client" 26 | ) 27 | 28 | func TestOption(t *testing.T) { 29 | t.Run("test", func(t *testing.T) { 30 | testScheme := runtime.NewScheme() 31 | var testClient client.Client 32 | var testRecorder record.EventRecorder 33 | o := NewOption() 34 | assert.NotNil(t, o) 35 | assert.NotPanics(t, func() { 36 | o1 := o.WithClient(testClient).WithRecorder(testRecorder).WithScheme(testScheme) 37 | assert.Equal(t, o, o1) 38 | }) 39 | }) 40 | } 41 | -------------------------------------------------------------------------------- /pkg/util/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | approvers: 4 | - api-machinery-approvers 5 | reviewers: 6 | - api-machinery-approvers 7 | -------------------------------------------------------------------------------- /pkg/util/histogram/histogram_checkpoint.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2023 The Koordinator Authors. 3 | Copyright 2018 The Kubernetes Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package histogram 19 | 20 | import "time" 21 | 22 | // HistogramCheckpoint contains data needed to reconstruct the histogram. 23 | type HistogramCheckpoint struct { 24 | // Reference timestamp for samples collected within this histogram. 25 | ReferenceTimestamp time.Time `json:"referenceTimestamp,omitempty"` 26 | 27 | // Map from bucket index to bucket weight. 28 | BucketWeights map[int]uint32 `json:"bucketWeights,omitempty"` 29 | 30 | // Sum of samples to be used as denominator for weights from BucketWeights. 31 | TotalWeight float64 `json:"totalWeight,omitempty"` 32 | } 33 | -------------------------------------------------------------------------------- /pkg/util/json.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package util 18 | 19 | import "encoding/json" 20 | 21 | // DumpJSON returns the JSON encoding 22 | func DumpJSON(o interface{}) string { 23 | j, _ := json.Marshal(o) 24 | return string(j) 25 | } 26 | -------------------------------------------------------------------------------- /pkg/util/json_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package util 18 | 19 | import ( 20 | "testing" 21 | 22 | "github.com/stretchr/testify/assert" 23 | ) 24 | 25 | func Test_DumpJSON(t *testing.T) { 26 | in := map[string]int{"foo": 1, "bar": 2, "baz": 3} 27 | out := `{"bar":2,"baz":3,"foo":1}` 28 | got := DumpJSON(in) 29 | assert.Equal(t, out, got) 30 | } 31 | -------------------------------------------------------------------------------- /pkg/util/selector.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package util 18 | 19 | import ( 20 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 21 | "k8s.io/apimachinery/pkg/labels" 22 | ) 23 | 24 | func GetFastLabelSelector(ps *metav1.LabelSelector) (labels.Selector, error) { 25 | var selector labels.Selector 26 | if len(ps.MatchExpressions) == 0 && len(ps.MatchLabels) != 0 { 27 | selector = labels.SelectorFromValidatedSet(ps.MatchLabels) 28 | return selector, nil 29 | } 30 | 31 | return metav1.LabelSelectorAsSelector(ps) 32 | } 33 | -------------------------------------------------------------------------------- /pkg/util/testutil/manager.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package testutil 18 | 19 | import ( 20 | "sigs.k8s.io/controller-runtime/pkg/cache" 21 | "sigs.k8s.io/controller-runtime/pkg/cache/informertest" 22 | "sigs.k8s.io/controller-runtime/pkg/manager" 23 | ) 24 | 25 | type FakeManager struct { 26 | manager.Manager 27 | } 28 | 29 | func (mgr *FakeManager) GetCache() cache.Cache { 30 | return &informertest.FakeInformers{} 31 | } 32 | -------------------------------------------------------------------------------- /pkg/webhook/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | approvers: 4 | - webhook-approvers 5 | reviewers: 6 | - webhook-approvers 7 | -------------------------------------------------------------------------------- /pkg/webhook/add_configmap.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package webhook 18 | 19 | import ( 20 | "github.com/koordinator-sh/koordinator/pkg/features" 21 | utilfeature "github.com/koordinator-sh/koordinator/pkg/util/feature" 22 | "github.com/koordinator-sh/koordinator/pkg/webhook/cm/validating" 23 | ) 24 | 25 | func init() { 26 | addHandlersWithGate(validating.HandlerBuilderMap, func() (enabled bool) { 27 | return utilfeature.DefaultFeatureGate.Enabled(features.ConfigMapValidatingWebhook) 28 | }) 29 | } 30 | -------------------------------------------------------------------------------- /pkg/webhook/add_node.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package webhook 18 | 19 | import ( 20 | "github.com/koordinator-sh/koordinator/pkg/features" 21 | utilfeature "github.com/koordinator-sh/koordinator/pkg/util/feature" 22 | "github.com/koordinator-sh/koordinator/pkg/webhook/node/mutating" 23 | "github.com/koordinator-sh/koordinator/pkg/webhook/node/validating" 24 | ) 25 | 26 | func init() { 27 | 28 | addHandlersWithGate(validating.HandlerBuilderMap, func() (enabled bool) { 29 | return utilfeature.DefaultFeatureGate.Enabled(features.NodeValidatingWebhook) 30 | }) 31 | 32 | addHandlersWithGate(mutating.HandlerBuilderMap, func() (enabled bool) { 33 | return utilfeature.DefaultFeatureGate.Enabled(features.NodeMutatingWebhook) 34 | }) 35 | } 36 | -------------------------------------------------------------------------------- /pkg/webhook/add_pod.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package webhook 18 | 19 | import ( 20 | "github.com/koordinator-sh/koordinator/pkg/features" 21 | utilfeature "github.com/koordinator-sh/koordinator/pkg/util/feature" 22 | "github.com/koordinator-sh/koordinator/pkg/webhook/pod/mutating" 23 | "github.com/koordinator-sh/koordinator/pkg/webhook/pod/validating" 24 | ) 25 | 26 | func init() { 27 | addHandlersWithGate(mutating.HandlerBuilderMap, func() (enabled bool) { 28 | return utilfeature.DefaultFeatureGate.Enabled(features.PodMutatingWebhook) 29 | }) 30 | 31 | addHandlersWithGate(validating.HandlerBuilderMap, func() (enabled bool) { 32 | return utilfeature.DefaultFeatureGate.Enabled(features.PodValidatingWebhook) 33 | }) 34 | } 35 | -------------------------------------------------------------------------------- /pkg/webhook/add_reservation.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package webhook 18 | 19 | import ( 20 | "github.com/koordinator-sh/koordinator/pkg/features" 21 | utilfeature "github.com/koordinator-sh/koordinator/pkg/util/feature" 22 | "github.com/koordinator-sh/koordinator/pkg/webhook/reservation/mutating" 23 | ) 24 | 25 | func init() { 26 | addHandlersWithGate(mutating.HandlerBuilderMap, func() (enabled bool) { 27 | return utilfeature.DefaultFeatureGate.Enabled(features.ReservationMutatingWebhook) 28 | }) 29 | } 30 | -------------------------------------------------------------------------------- /pkg/webhook/api_debug_server.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package webhook 18 | 19 | import ( 20 | "net/http" 21 | 22 | "k8s.io/klog/v2" 23 | "sigs.k8s.io/controller-runtime/pkg/webhook" 24 | ) 25 | 26 | var debugAPIProviderMap = map[string]http.Handler{} 27 | 28 | func RegisterDebugAPIProvider(name string, provider http.Handler) { 29 | debugAPIProviderMap[name] = provider 30 | } 31 | 32 | func InstallDebugAPIHandler(server webhook.Server) { 33 | for name, provider := range debugAPIProviderMap { 34 | server.Register(name, provider) 35 | klog.Infof("Success register debug api handler, name:%v", name) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /pkg/webhook/cm/plugins/plugin.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package plugins 18 | 19 | import ( 20 | "context" 21 | 22 | corev1 "k8s.io/api/core/v1" 23 | "sigs.k8s.io/controller-runtime/pkg/webhook/admission" 24 | ) 25 | 26 | type ConfigMapPlugin interface { 27 | Name() string 28 | // Validate makes an admission decision based on the request attributes. It is NOT allowed to mutate 29 | Validate(ctx context.Context, req admission.Request, config, oldConfig *corev1.ConfigMap) error 30 | // Admit makes an admission decision based on the request attributes 31 | Admit(ctx context.Context, req admission.Request, config, oldConfig *corev1.ConfigMap) error 32 | } 33 | -------------------------------------------------------------------------------- /pkg/webhook/metrics/elasticquota.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package metrics 18 | 19 | import ( 20 | "github.com/prometheus/client_golang/prometheus" 21 | v1 "k8s.io/api/core/v1" 22 | ) 23 | 24 | var ( 25 | quotaSharedWeight = prometheus.NewGaugeVec( 26 | prometheus.GaugeOpts{ 27 | Subsystem: KoordManagerWebhookSubsystem, 28 | Name: "quota_shared_weight", 29 | Help: "The shared weight of the quota", 30 | }, 31 | []string{ElasticQuotaNameKey, ResourceNameKey}, 32 | ) 33 | ElasticQuotaCollector = []prometheus.Collector{ 34 | quotaSharedWeight, 35 | } 36 | ) 37 | 38 | func RecordQuotaSharedWeight(quotaName string, max v1.ResourceList) { 39 | for k, v := range max { 40 | quotaSharedWeight.WithLabelValues(quotaName, string(k)).Set(float64(v.Value())) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /pkg/webhook/metrics/elasticquota_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package metrics 18 | 19 | import ( 20 | "testing" 21 | 22 | corev1 "k8s.io/api/core/v1" 23 | "k8s.io/apimachinery/pkg/api/resource" 24 | ) 25 | 26 | func TestElasticQuotaCollectors(t *testing.T) { 27 | testingMaximum := corev1.ResourceList{ 28 | corev1.ResourceCPU: resource.MustParse("1"), 29 | corev1.ResourceMemory: resource.MustParse("1Gi"), 30 | } 31 | t.Run("test not panic", func(t *testing.T) { 32 | RecordQuotaSharedWeight("test-quota", testingMaximum) 33 | }) 34 | } 35 | -------------------------------------------------------------------------------- /pkg/webhook/metrics/internal_metrics.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package metrics 18 | 19 | import ( 20 | kmmetrics "github.com/koordinator-sh/koordinator/pkg/util/metrics/koordmanager" 21 | ) 22 | 23 | func init() { 24 | kmmetrics.InternalMustRegister(WebhookDurationCollectors...) 25 | kmmetrics.InternalMustRegister(ElasticQuotaCollector...) 26 | } 27 | -------------------------------------------------------------------------------- /pkg/webhook/metrics/webhook_duration_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package metrics 18 | 19 | import ( 20 | "testing" 21 | ) 22 | 23 | func TestWebhookDurationCollectors(t *testing.T) { 24 | t.Run("test not panic", func(t *testing.T) { 25 | RecordWebhookDurationMilliseconds(MutatingWebhook, Pod, "CREATE", nil, "test-plugin", 0.1) 26 | }) 27 | } 28 | -------------------------------------------------------------------------------- /pkg/webhook/node/plugins/plugin.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package plugins 18 | 19 | import ( 20 | "context" 21 | 22 | corev1 "k8s.io/api/core/v1" 23 | "sigs.k8s.io/controller-runtime/pkg/webhook/admission" 24 | ) 25 | 26 | type NodePlugin interface { 27 | Name() string 28 | // Validate makes an admission decision based on the request attributes. It is NOT allowed to mutate 29 | Validate(ctx context.Context, req admission.Request, node, oldNode *corev1.Node) error 30 | // Admit makes an admission decision based on the request attributes 31 | Admit(ctx context.Context, req admission.Request, node, oldNode *corev1.Node) error 32 | } 33 | -------------------------------------------------------------------------------- /pkg/webhook/quotaevaluate/util.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package quotaevaluate 18 | 19 | import ( 20 | corev1 "k8s.io/api/core/v1" 21 | 22 | "github.com/koordinator-sh/koordinator/apis/extension" 23 | "github.com/koordinator-sh/koordinator/apis/thirdparty/scheduler-plugins/pkg/apis/scheduling/v1alpha1" 24 | ) 25 | 26 | func GetQuotaAdmission(quota *v1alpha1.ElasticQuota) (corev1.ResourceList, error) { 27 | admission, err := extension.GetAdmission(quota) 28 | if err != nil { 29 | return nil, err 30 | } 31 | 32 | // admission is empty (it may not be configured or may have no content), return max 33 | if len(admission) == 0 { 34 | return quota.Spec.Max, nil 35 | } 36 | 37 | return admission, nil 38 | } 39 | -------------------------------------------------------------------------------- /pkg/webhook/util/err/json_error.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package err 18 | 19 | import ( 20 | "encoding/json" 21 | "fmt" 22 | ) 23 | 24 | type Reason string 25 | 26 | var _ error = &JsonFormatError{} 27 | 28 | var contentStart = "___" 29 | var contentEnd = "___" 30 | 31 | type JsonFormatError struct { 32 | Reason Reason `json:"reason,omitempty"` 33 | Message interface{} `json:"message,omitempty"` 34 | } 35 | 36 | func (e *JsonFormatError) Error() string { 37 | if e == nil { 38 | return "" 39 | } 40 | errorBytes, err := json.Marshal(e) 41 | if err != nil { 42 | return err.Error() 43 | } 44 | return fmt.Sprintf("%s%s%s", contentStart, string(errorBytes), contentEnd) 45 | } 46 | -------------------------------------------------------------------------------- /pkg/webhook/util/framework/builder.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package framework 18 | 19 | import ( 20 | ctrl "sigs.k8s.io/controller-runtime" 21 | "sigs.k8s.io/controller-runtime/pkg/webhook/admission" 22 | ) 23 | 24 | type HandlerBuilder interface { 25 | WithControllerManager(mgr ctrl.Manager) HandlerBuilder 26 | Build() admission.Handler 27 | } 28 | -------------------------------------------------------------------------------- /pkg/webhook/util/health/handler.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package health 18 | 19 | import "net/http" 20 | 21 | type Handler struct{} 22 | 23 | var _ http.Handler = &Handler{} 24 | 25 | func (wh *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { 26 | w.WriteHeader(200) 27 | } 28 | -------------------------------------------------------------------------------- /pkg/webhook/util/writer/error.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package writer 18 | 19 | type notFoundError struct { 20 | err error 21 | } 22 | 23 | func (e notFoundError) Error() string { 24 | return e.err.Error() 25 | } 26 | 27 | func isNotFound(err error) bool { 28 | _, ok := err.(notFoundError) 29 | return ok 30 | } 31 | 32 | type alreadyExistError struct { 33 | err error 34 | } 35 | 36 | func (e alreadyExistError) Error() string { 37 | return e.err.Error() 38 | } 39 | 40 | func isAlreadyExists(err error) bool { 41 | _, ok := err.(alreadyExistError) 42 | return ok 43 | } 44 | -------------------------------------------------------------------------------- /test/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | approvers: 4 | - ci-approvers 5 | reviewers: 6 | - ci-approvers 7 | -------------------------------------------------------------------------------- /test/e2e/e2e-example-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "provider":"local" 3 | } 4 | -------------------------------------------------------------------------------- /test/e2e/framework/OWNERS: -------------------------------------------------------------------------------- 1 | reviewers: 2 | - eahydra 3 | -------------------------------------------------------------------------------- /test/e2e/framework/metrics/latencies.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package metrics 18 | 19 | import ( 20 | "time" 21 | ) 22 | 23 | // PodLatencyData encapsulates pod startup latency information. 24 | type PodLatencyData struct { 25 | // Name of the pod 26 | Name string 27 | // Node this pod was running on 28 | Node string 29 | // Latency information related to pod startuptime 30 | Latency time.Duration 31 | } 32 | 33 | // LatencySlice is an array of PodLatencyData which encapsulates pod startup latency information. 34 | type LatencySlice []PodLatencyData 35 | 36 | func (a LatencySlice) Len() int { return len(a) } 37 | func (a LatencySlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] } 38 | func (a LatencySlice) Less(i, j int) bool { return a[i].Latency < a[j].Latency } 39 | -------------------------------------------------------------------------------- /test/e2e/framework/metrics/pod.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package metrics 18 | 19 | import ( 20 | "time" 21 | ) 22 | 23 | // LatencyMetric is a struct for dashboard metrics. 24 | type LatencyMetric struct { 25 | Perc50 time.Duration `json:"Perc50"` 26 | Perc90 time.Duration `json:"Perc90"` 27 | Perc99 time.Duration `json:"Perc99"` 28 | Perc100 time.Duration `json:"Perc100"` 29 | } 30 | -------------------------------------------------------------------------------- /test/e2e/framework/ports.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package framework 18 | 19 | // NOTE: constants in this file are copied from pkg/cluster/ports/ports.go 20 | 21 | const ( 22 | // KubeletPort is the default port for the kubelet server on each host machine. 23 | // May be overridden by a flag at startup. 24 | KubeletPort = 10250 25 | // KubeControllerManagerPort is the default port for the controller manager status server. 26 | // May be overridden by a flag at startup. 27 | KubeControllerManagerPort = 10257 28 | ) 29 | -------------------------------------------------------------------------------- /test/e2e/framework/replicaset/rest.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package replicaset 18 | 19 | import ( 20 | appsv1 "k8s.io/api/apps/v1" 21 | clientset "k8s.io/client-go/kubernetes" 22 | testutils "k8s.io/kubernetes/test/utils" 23 | 24 | "github.com/koordinator-sh/koordinator/test/e2e/framework" 25 | ) 26 | 27 | // UpdateReplicaSetWithRetries updates replicaset template with retries. 28 | func UpdateReplicaSetWithRetries(c clientset.Interface, namespace, name string, applyUpdate testutils.UpdateReplicaSetFunc) (*appsv1.ReplicaSet, error) { 29 | return testutils.UpdateReplicaSetWithRetries(c, namespace, name, applyUpdate, framework.Logf, framework.Poll, framework.PollShortTimeout) 30 | } 31 | -------------------------------------------------------------------------------- /test/e2e/framework/statefulset/const.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package statefulset 18 | 19 | import ( 20 | "time" 21 | ) 22 | 23 | const ( 24 | // StatefulSetPoll is a poll interval for StatefulSet tests 25 | StatefulSetPoll = 10 * time.Second 26 | // StatefulSetTimeout is a timeout interval for StatefulSet operations 27 | StatefulSetTimeout = 10 * time.Minute 28 | // StatefulPodTimeout is a timeout for stateful pods to change state 29 | StatefulPodTimeout = 5 * time.Minute 30 | ) 31 | -------------------------------------------------------------------------------- /test/e2e/framework/testfiles/testdata/a/foo.txt: -------------------------------------------------------------------------------- 1 | Hello World 2 | -------------------------------------------------------------------------------- /test/e2e/quota/framework.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package quota 18 | 19 | import "github.com/onsi/ginkgo/v2" 20 | 21 | // SIGDescribe describes SIG information 22 | func SIGDescribe(text string, body func()) bool { 23 | return ginkgo.Describe("[quota] "+text, body) 24 | } 25 | -------------------------------------------------------------------------------- /test/e2e/scheduling/OWNERS: -------------------------------------------------------------------------------- 1 | reviewers: 2 | - eahydra 3 | -------------------------------------------------------------------------------- /test/e2e/scheduling/framework.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package scheduling 18 | 19 | import "github.com/onsi/ginkgo/v2" 20 | 21 | // SIGDescribe describes SIG information 22 | func SIGDescribe(text string, body func()) bool { 23 | return ginkgo.Describe("[scheduling] "+text, body) 24 | } 25 | -------------------------------------------------------------------------------- /test/e2e/slocontroller/OWNERS: -------------------------------------------------------------------------------- 1 | reviewers: 2 | - slo-controller-approvers 3 | - koordlet-approvers 4 | approvers: 5 | - slo-controller-approvers 6 | - koordlet-approvers 7 | -------------------------------------------------------------------------------- /test/e2e/slocontroller/framework.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package slocontroller 18 | 19 | import "github.com/onsi/ginkgo/v2" 20 | 21 | // SIGDescribe describes SIG information 22 | func SIGDescribe(text string, body func()) bool { 23 | return ginkgo.Describe("[slo-controller] "+text, body) 24 | } 25 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/README.md: -------------------------------------------------------------------------------- 1 | # test/e2e/testing-manifests 2 | 3 | ## Embedded Test Data 4 | 5 | In case one needs to use any test fixture inside your tests and those are defined inside this directory, they need to be added to the `//go:embed` directive in `embed.go`. 6 | 7 | For example, if one wants to include this Readme as a test fixture (potential bad idea in reality!), 8 | 9 | ``` 10 | // embed.go 11 | 12 | ... 13 | //go:embed some other files README.md 14 | ... 15 | ``` 16 | 17 | This fixture can be accessed in the e2e tests using `test/e2e/framework/testfiles.Read` like 18 | `testfiles.Read("test/e2e/testing-manifests/README.md)`. 19 | 20 | This is needed since [migrating to //go:embed from go-bindata][1]. 21 | 22 | [1]: https://github.com/kubernetes/kubernetes/pull/99829 23 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/embed.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Koordinator Authors. 3 | Copyright 2021 The Kubernetes Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package testing_manifests 19 | 20 | import ( 21 | "embed" 22 | 23 | e2etestfiles "github.com/koordinator-sh/koordinator/test/e2e/framework/testfiles" 24 | ) 25 | 26 | //go:embed sample-device-plugin.yaml scheduling statefulset slocontroller storage-csi 27 | var e2eTestingManifestsFS embed.FS 28 | 29 | func GetE2ETestingManifestsFS() e2etestfiles.EmbeddedFileSource { 30 | return e2etestfiles.EmbeddedFileSource{ 31 | EmbeddedFS: e2eTestingManifestsFS, 32 | Root: "test/e2e/testing-manifests", 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/pod: -------------------------------------------------------------------------------- 1 | # Copy of pod.yaml without file extension for test 2 | apiVersion: v1 3 | kind: Pod 4 | metadata: 5 | name: nginx 6 | labels: 7 | name: nginx 8 | spec: 9 | containers: 10 | - name: nginx 11 | image: nginx 12 | ports: 13 | - containerPort: 80 14 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/rbd-storage-class.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | name: slow 5 | provisioner: kubernetes.io/rbd 6 | parameters: 7 | monitors: 127.0.0.1:6789 8 | adminId: admin 9 | adminSecretName: ceph-secret-admin 10 | adminSecretNamespace: "kube-system" 11 | pool: kube 12 | userId: kube 13 | userSecretName: ceph-secret-user 14 | 15 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/scheduling/simple-lsr-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: simple-lsr-pod 5 | labels: 6 | app: e2e-test 7 | koordinator.sh/qosClass: LSR 8 | annotations: 9 | scheduling.koordinator.sh/resource-spec: |- 10 | {"preferredCPUBindPolicy": "SpreadByPCPUs"} 11 | spec: 12 | schedulerName: koord-scheduler 13 | priorityClassName: koord-prod 14 | tolerations: 15 | - operator: Exists 16 | containers: 17 | - name: main 18 | image: {{.PauseImage}} 19 | resources: 20 | requests: 21 | cpu: "2" 22 | memory: "1Gi" 23 | limits: 24 | cpu: "2" 25 | memory: "1Gi" 26 | 27 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/scheduling/simple-pod-with-reservation.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: simple-pod-with-reservation 5 | labels: 6 | app: e2e-test-reservation 7 | spec: 8 | schedulerName: koord-scheduler 9 | tolerations: 10 | - operator: Exists 11 | containers: 12 | - name: main 13 | image: {{.PauseImage}} 14 | resources: 15 | requests: 16 | cpu: "1" 17 | memory: "1Gi" 18 | limits: 19 | cpu: "1" 20 | memory: "1Gi" 21 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/scheduling/simple-reservation.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: scheduling.koordinator.sh/v1alpha1 2 | kind: Reservation 3 | metadata: 4 | name: simple-reservation 5 | labels: 6 | e2e-test-reservation: "true" 7 | spec: 8 | allocateOnce: true 9 | owners: 10 | - labelSelector: 11 | matchLabels: 12 | app: e2e-test-reservation 13 | template: 14 | metadata: 15 | name: {{.PauseImage}} 16 | namespace: default 17 | spec: 18 | containers: 19 | - resources: 20 | limits: 21 | cpu: "1" 22 | memory: "1Gi" 23 | requests: 24 | cpu: "1" 25 | memory: "1Gi" 26 | restartPolicy: Always 27 | schedulerName: koord-scheduler 28 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/slocontroller/be-demo.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Pod 4 | metadata: 5 | labels: 6 | app: e2e-test 7 | koordinator.sh/qosClass: BE 8 | name: be-demo 9 | name: be-demo 10 | spec: 11 | schedulerName: koord-scheduler 12 | priorityClassName: koord-batch 13 | containers: 14 | - image: {{.BusyBoxImage}} 15 | imagePullPolicy: IfNotPresent 16 | name: pause 17 | command: ["sleep", "2000000000000"] 18 | resources: 19 | limits: 20 | kubernetes.io/batch-cpu: "50" 21 | kubernetes.io/batch-memory: 128Mi 22 | requests: 23 | kubernetes.io/batch-cpu: "25" 24 | kubernetes.io/batch-memory: 64Mi 25 | restartPolicy: Never 26 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/slocontroller/slo-controller-config.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: slo-controller-config 5 | namespace: koordinator-system # the installed namespace 6 | data: 7 | colocation-config: | 8 | { 9 | "enable": true, 10 | "cpuReclaimThresholdPercent": 60, 11 | "memoryReclaimThresholdPercent": 65, 12 | "memoryCalculatePolicy": "usage" 13 | } 14 | resource-threshold-config: | 15 | { 16 | "clusterStrategy": { 17 | "enable": false 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/statefulset/cassandra/pdb.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: policy/v1 2 | kind: PodDisruptionBudget 3 | metadata: 4 | name: cassandra-pdb 5 | labels: 6 | pdb: cassandra 7 | spec: 8 | minAvailable: 2 9 | selector: 10 | matchLabels: 11 | app: cassandra 12 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/statefulset/cassandra/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | app: cassandra 6 | name: cassandra 7 | spec: 8 | clusterIP: None 9 | ports: 10 | - port: 9042 11 | selector: 12 | app: cassandra 13 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/statefulset/cassandra/tester.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: cassandra-test-server 5 | spec: 6 | replicas: 3 7 | selector: 8 | matchLabels: 9 | app: test-server 10 | template: 11 | metadata: 12 | labels: 13 | app: test-server 14 | spec: 15 | containers: 16 | - name: test-server 17 | image: k8s.gcr.io/cassandra-e2e-test:0.1 18 | imagePullPolicy: Always 19 | ports: 20 | - containerPort: 8080 21 | readinessProbe: 22 | httpGet: 23 | path: /healthz 24 | port: 8080 25 | initialDelaySeconds: 2 26 | periodSeconds: 2 27 | --- 28 | apiVersion: policy/v1 29 | kind: PodDisruptionBudget 30 | metadata: 31 | name: tester-pdb 32 | labels: 33 | pdb: test-server 34 | spec: 35 | minAvailable: 1 36 | selector: 37 | matchLabels: 38 | app: test-server 39 | --- 40 | apiVersion: v1 41 | kind: Service 42 | metadata: 43 | labels: 44 | app: test-server 45 | name: test-server 46 | spec: 47 | ports: 48 | - port: 8080 49 | selector: 50 | app: test-server 51 | type: LoadBalancer 52 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/statefulset/cockroachdb/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | # This service only exists to create DNS entries for each pod in the stateful 5 | # set such that they can resolve each other's IP addresses. It does not 6 | # create a load-balanced ClusterIP and should not be used directly by clients 7 | # in most circumstances. 8 | name: cockroachdb 9 | labels: 10 | app: cockroachdb 11 | annotations: 12 | # Enable automatic monitoring of all instances when Prometheus is running in the cluster. 13 | prometheus.io/scrape: "true" 14 | prometheus.io/path: "_status/vars" 15 | prometheus.io/port: "8080" 16 | spec: 17 | ports: 18 | - port: 26257 19 | targetPort: 26257 20 | name: grpc 21 | - port: 8080 22 | targetPort: 8080 23 | name: http 24 | clusterIP: None 25 | selector: 26 | app: cockroachdb 27 | # This is needed to make the peer-finder work properly and to help avoid 28 | # edge cases where instance 0 comes up after losing its data and needs to 29 | # decide whether it should create a new cluster or try to join an existing 30 | # one. If it creates a new cluster when it should have joined an existing 31 | # one, we'd end up with two separate clusters listening at the same service 32 | # endpoint, which would be very bad. 33 | publishNotReadyAddresses: true 34 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/statefulset/etcd/pdb.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: policy/v1 2 | kind: PodDisruptionBudget 3 | metadata: 4 | name: etcd-pdb 5 | labels: 6 | pdb: etcd 7 | spec: 8 | minAvailable: 2 9 | selector: 10 | matchLabels: 11 | app: etcd 12 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/statefulset/etcd/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: etcd 5 | labels: 6 | app: etcd 7 | spec: 8 | ports: 9 | - port: 2380 10 | name: etcd-server 11 | - port: 2379 12 | name: etcd-client 13 | clusterIP: None 14 | selector: 15 | app: etcd 16 | publishNotReadyAddresses: true 17 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/statefulset/etcd/tester.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: etcd-test-server 5 | spec: 6 | replicas: 3 7 | selector: 8 | matchLabels: 9 | app: test-server 10 | template: 11 | metadata: 12 | labels: 13 | app: test-server 14 | spec: 15 | containers: 16 | - name: test-server 17 | image: k8s.gcr.io/etcd-statefulset-e2e-test:0.0 18 | imagePullPolicy: Always 19 | ports: 20 | - containerPort: 8080 21 | readinessProbe: 22 | httpGet: 23 | path: /healthz 24 | port: 8080 25 | initialDelaySeconds: 2 26 | periodSeconds: 2 27 | 28 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/statefulset/mysql-galera/service.yaml: -------------------------------------------------------------------------------- 1 | # A headless service to create DNS records 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: galera 6 | labels: 7 | app: mysql 8 | spec: 9 | ports: 10 | - port: 3306 11 | name: mysql 12 | # *.galear.default.svc.cluster.local 13 | clusterIP: None 14 | selector: 15 | app: mysql 16 | publishNotReadyAddresses: true 17 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/statefulset/mysql-upgrade/configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: mysql 5 | labels: 6 | app: mysql 7 | data: 8 | master.cnf: | 9 | [mysqld] 10 | log-bin 11 | slave.cnf: | 12 | [mysqld] 13 | super-read-only 14 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/statefulset/mysql-upgrade/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | labels: 6 | app: mysql 7 | spec: 8 | ports: 9 | - name: mysql 10 | port: 3306 11 | clusterIP: None 12 | selector: 13 | app: mysql 14 | --- 15 | apiVersion: v1 16 | kind: Service 17 | metadata: 18 | name: mysql-read 19 | labels: 20 | app: mysql 21 | spec: 22 | ports: 23 | - name: mysql 24 | port: 3306 25 | selector: 26 | app: mysql 27 | type: LoadBalancer 28 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/statefulset/mysql-upgrade/tester.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: mysql-test-server 5 | spec: 6 | replicas: 3 7 | selector: 8 | matchLabels: 9 | app: test-server 10 | template: 11 | metadata: 12 | labels: 13 | app: test-server 14 | spec: 15 | containers: 16 | - name: test-server 17 | image: k8s.gcr.io/mysql-e2e-test:0.1 18 | imagePullPolicy: Always 19 | ports: 20 | - containerPort: 8080 21 | readinessProbe: 22 | httpGet: 23 | path: /healthz 24 | port: 8080 25 | initialDelaySeconds: 2 26 | periodSeconds: 2 27 | --- 28 | apiVersion: policy/v1 29 | kind: PodDisruptionBudget 30 | metadata: 31 | name: tester-pdb 32 | labels: 33 | pdb: test-server 34 | spec: 35 | minAvailable: 1 36 | selector: 37 | matchLabels: 38 | app: test-server 39 | --- 40 | apiVersion: v1 41 | kind: Service 42 | metadata: 43 | labels: 44 | app: test-server 45 | name: test-server 46 | spec: 47 | ports: 48 | - port: 8080 49 | selector: 50 | app: test-server 51 | type: LoadBalancer 52 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/statefulset/nginx/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: nginx 5 | labels: 6 | app: nginx 7 | spec: 8 | ports: 9 | - port: 80 10 | name: web 11 | clusterIP: None 12 | selector: 13 | app: nginx -------------------------------------------------------------------------------- /test/e2e/testing-manifests/statefulset/nginx/statefulset.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: StatefulSet 3 | metadata: 4 | name: web 5 | spec: 6 | serviceName: "nginx" 7 | replicas: 3 8 | selector: 9 | matchLabels: 10 | app: nginx 11 | template: 12 | metadata: 13 | labels: 14 | app: nginx 15 | spec: 16 | containers: 17 | - name: nginx 18 | image: nginx:1.15-alpine 19 | ports: 20 | - containerPort: 80 21 | name: web 22 | volumeMounts: 23 | - name: www 24 | mountPath: /usr/share/nginx/html 25 | volumeClaimTemplates: 26 | - metadata: 27 | name: www 28 | annotations: 29 | volume.beta.kubernetes.io/storage-class: nginx-sc 30 | spec: 31 | accessModes: [ "ReadWriteOnce" ] 32 | resources: 33 | requests: 34 | storage: 1Gi 35 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/statefulset/redis/service.yaml: -------------------------------------------------------------------------------- 1 | # A headless service to create DNS records 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: redis 6 | labels: 7 | app: redis 8 | spec: 9 | ports: 10 | - port: 6379 11 | name: peer 12 | # *.redis.default.svc.cluster.local 13 | clusterIP: None 14 | selector: 15 | app: redis 16 | publishNotReadyAddresses: true 17 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/statefulset/zookeeper/service.yaml: -------------------------------------------------------------------------------- 1 | # A headless service to create DNS records 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: zk 6 | labels: 7 | app: zk 8 | spec: 9 | ports: 10 | - port: 2888 11 | name: peer 12 | - port: 3888 13 | name: leader-election 14 | # *.zk.default.svc.cluster.local 15 | clusterIP: None 16 | selector: 17 | app: zk 18 | publishNotReadyAddresses: true 19 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/storage-csi/any-volume-datasource/volume-data-source-validator/rbac-data-source-validator.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: volume-data-source-validator 5 | namespace: kube-system 6 | 7 | --- 8 | apiVersion: rbac.authorization.k8s.io/v1 9 | kind: ClusterRole 10 | metadata: 11 | name: volume-data-source-validator 12 | rules: 13 | - apiGroups: [populator.storage.k8s.io] 14 | resources: [volumepopulators] 15 | verbs: [get, list, watch] 16 | - apiGroups: [""] 17 | resources: [persistentvolumeclaims] 18 | verbs: [get, list, watch] 19 | - apiGroups: [""] 20 | resources: [events] 21 | verbs: [list, watch, create, update, patch] 22 | 23 | --- 24 | apiVersion: rbac.authorization.k8s.io/v1 25 | kind: ClusterRoleBinding 26 | metadata: 27 | name: volume-data-source-validator 28 | labels: 29 | addonmanager.kubernetes.io/mode: Reconcile 30 | subjects: 31 | - kind: ServiceAccount 32 | name: volume-data-source-validator 33 | namespace: kube-system 34 | roleRef: 35 | kind: ClusterRole 36 | name: volume-data-source-validator 37 | apiGroup: rbac.authorization.k8s.io 38 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/storage-csi/any-volume-datasource/volume-data-source-validator/setup-data-source-validator.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: StatefulSet 3 | metadata: 4 | name: volume-data-source-validator 5 | namespace: kube-system 6 | spec: 7 | serviceName: volume-data-source-validator 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: volume-data-source-validator 12 | template: 13 | metadata: 14 | labels: 15 | app: volume-data-source-validator 16 | spec: 17 | serviceAccount: volume-data-source-validator 18 | containers: 19 | - name: volume-data-source-validator 20 | image: k8s.gcr.io/sig-storage/volume-data-source-validator:v1.0.0 21 | args: 22 | - "--v=5" 23 | - "--leader-election=false" 24 | imagePullPolicy: Always 25 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/storage-csi/controller-role.yaml: -------------------------------------------------------------------------------- 1 | # Replaced by individual roles for external-attacher, external-provisioner and external-snapshotter: 2 | # - https://github.com/kubernetes-csi/external-attacher/blob/master/deploy/kubernetes/rbac.yaml 3 | # - https://github.com/kubernetes-csi/external-provisioner/blob/master/deploy/kubernetes/rbac.yaml 4 | # - https://github.com/kubernetes-csi/external-snapshotter/blob/master/deploy/kubernetes/rbac.yaml -------------------------------------------------------------------------------- /test/e2e/testing-manifests/storage-csi/hostpath/README.md: -------------------------------------------------------------------------------- 1 | The files in this directory are exact copys of "kubernetes-latest" in 2 | https://github.com/kubernetes-csi/csi-driver-host-path/tree/v1.7.3/deploy/ 3 | 4 | Do not edit manually. Run ./update-hostpath.sh to refresh the content. 5 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-driverinfo.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: CSIDriver 3 | metadata: 4 | name: hostpath.csi.k8s.io 5 | labels: 6 | app.kubernetes.io/instance: hostpath.csi.k8s.io 7 | app.kubernetes.io/part-of: csi-driver-host-path 8 | app.kubernetes.io/name: hostpath.csi.k8s.io 9 | app.kubernetes.io/component: csi-driver 10 | spec: 11 | # Supports persistent and ephemeral inline volumes. 12 | volumeLifecycleModes: 13 | - Persistent 14 | - Ephemeral 15 | # To determine at runtime which mode a volume uses, pod info and its 16 | # "csi.storage.k8s.io/ephemeral" entry are needed. 17 | podInfoOnMount: true 18 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-snapshotclass.yaml: -------------------------------------------------------------------------------- 1 | # Usage of the v1 API implies that the cluster must have 2 | # external-snapshotter v4.x installed. 3 | apiVersion: snapshot.storage.k8s.io/v1 4 | kind: VolumeSnapshotClass 5 | metadata: 6 | name: csi-hostpath-snapclass 7 | labels: 8 | app.kubernetes.io/instance: hostpath.csi.k8s.io 9 | app.kubernetes.io/part-of: csi-driver-host-path 10 | app.kubernetes.io/name: csi-hostpath-snapclass 11 | app.kubernetes.io/component: volumesnapshotclass 12 | driver: hostpath.csi.k8s.io #csi-hostpath 13 | deletionPolicy: Delete 14 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/storage-csi/hostpath/hostpath/e2e-test-rbac.yaml: -------------------------------------------------------------------------------- 1 | # priviledged Pod Security Policy, previously defined just for gcePD via PrivilegedTestPSPClusterRoleBinding() 2 | kind: ClusterRoleBinding 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | metadata: 5 | name: psp-csi-hostpath-role 6 | subjects: 7 | # This list of ServiceAccount intentionally covers everything that might 8 | # be needed. In practice, only some of these accounts are actually 9 | # used. 10 | - kind: ServiceAccount 11 | name: csi-attacher 12 | namespace: default 13 | - kind: ServiceAccount 14 | name: csi-provisioner 15 | namespace: default 16 | - kind: ServiceAccount 17 | name: csi-snapshotter 18 | namespace: default 19 | - kind: ServiceAccount 20 | name: csi-resizer 21 | namespace: default 22 | - kind: ServiceAccount 23 | name: csi-external-health-monitor-controller 24 | namespace: default 25 | - kind: ServiceAccount 26 | name: csi-hostpathplugin-sa 27 | namespace: default 28 | roleRef: 29 | kind: ClusterRole 30 | name: e2e-test-privileged-psp 31 | apiGroup: rbac.authorization.k8s.io 32 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/storage-csi/mock/csi-mock-driver-attacher.yaml: -------------------------------------------------------------------------------- 1 | kind: StatefulSet 2 | apiVersion: apps/v1 3 | metadata: 4 | name: csi-mockplugin-attacher 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: csi-mockplugin-attacher 9 | replicas: 1 10 | template: 11 | metadata: 12 | labels: 13 | app: csi-mockplugin-attacher 14 | spec: 15 | serviceAccountName: csi-mock 16 | containers: 17 | - name: csi-attacher 18 | image: k8s.gcr.io/sig-storage/csi-attacher:v3.3.0 19 | args: 20 | - --v=5 21 | - --csi-address=$(ADDRESS) 22 | env: 23 | - name: ADDRESS 24 | value: /csi/csi.sock 25 | securityContext: 26 | privileged: true 27 | volumeMounts: 28 | - mountPath: /csi 29 | name: socket-dir 30 | volumes: 31 | - hostPath: 32 | path: /var/lib/kubelet/plugins/csi-mock 33 | type: DirectoryOrCreate 34 | name: socket-dir 35 | 36 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/storage-csi/mock/csi-mock-driver-resizer.yaml: -------------------------------------------------------------------------------- 1 | kind: StatefulSet 2 | apiVersion: apps/v1 3 | metadata: 4 | name: csi-mockplugin-resizer 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: csi-mockplugin-resizer 9 | replicas: 1 10 | template: 11 | metadata: 12 | labels: 13 | app: csi-mockplugin-resizer 14 | spec: 15 | serviceAccountName: csi-mock 16 | containers: 17 | - name: csi-resizer 18 | image: k8s.gcr.io/sig-storage/csi-resizer:v1.3.0 19 | args: 20 | - "--v=5" 21 | - "--csi-address=$(ADDRESS)" 22 | env: 23 | - name: ADDRESS 24 | value: /csi/csi.sock 25 | securityContext: 26 | privileged: true 27 | volumeMounts: 28 | - mountPath: /csi 29 | name: socket-dir 30 | volumes: 31 | - hostPath: 32 | path: /var/lib/kubelet/plugins/csi-mock 33 | type: DirectoryOrCreate 34 | name: socket-dir 35 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/storage-csi/mock/csi-mock-driver-snapshotter.yaml: -------------------------------------------------------------------------------- 1 | kind: StatefulSet 2 | apiVersion: apps/v1 3 | metadata: 4 | name: csi-mockplugin-snapshotter 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: csi-mockplugin-snapshotter 10 | template: 11 | metadata: 12 | labels: 13 | app: csi-mockplugin-snapshotter 14 | spec: 15 | serviceAccountName: csi-mock 16 | containers: 17 | - name: csi-snapshotter 18 | image: k8s.gcr.io/sig-storage/csi-snapshotter:v4.2.1 19 | args: 20 | - "--v=5" 21 | - "--csi-address=$(ADDRESS)" 22 | - "--leader-election=false" 23 | env: 24 | - name: ADDRESS 25 | value: /csi/csi.sock 26 | securityContext: 27 | privileged: true 28 | imagePullPolicy: Always 29 | volumeMounts: 30 | - name: socket-dir 31 | mountPath: /csi 32 | volumes: 33 | - name: socket-dir 34 | hostPath: 35 | path: /var/lib/kubelet/plugins/csi-mock 36 | type: DirectoryOrCreate 37 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/storage-csi/mock/csi-mock-driverinfo.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: CSIDriver 3 | metadata: 4 | name: mock.storage.k8s.io 5 | # Intentionally no spec. All values in the 6 | # spec will be inserted dynamically by PatchCSIDeployment() 7 | # in test/e2e/storage/utils/deployment.go. 8 | -------------------------------------------------------------------------------- /test/e2e/testing-manifests/storage-csi/mock/csi-storageclass.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | name: csi-mock-sc 5 | provisioner: csi-mock 6 | reclaimPolicy: Delete 7 | volumeBindingMode: Immediate 8 | -------------------------------------------------------------------------------- /test/kind-conf.yaml: -------------------------------------------------------------------------------- 1 | kind: Cluster 2 | apiVersion: kind.x-k8s.io/v1alpha4 3 | nodes: 4 | - role: control-plane 5 | - role: worker 6 | - role: worker 7 | 8 | kubeadmConfigPatches: 9 | - | 10 | kind: InitConfiguration 11 | nodeRegistration: 12 | kubeletExtraArgs: 13 | "cgroup-root": "/" 14 | --- 15 | kind: KubeletConfiguration 16 | cgroupRoot: / 17 | --------------------------------------------------------------------------------