diff --git a/Makefile b/Makefile index 5bbf82ae74..e6d0ff7fb0 100644 --- a/Makefile +++ b/Makefile @@ -181,8 +181,8 @@ ci-lint: golangci-lint $(GOLANGCI_LINT) run --timeout 15m0s .PHONY: verify -verify: gomod-verify vet ci-lint fmt-verify toc-verify manifests generate update-helm - git --no-pager diff --exit-code config/components apis charts/kueue/templates client-go +verify: gomod-verify vet ci-lint fmt-verify toc-verify manifests generate update-helm generate-apiref + git --no-pager diff --exit-code config/components apis charts/kueue/templates client-go site/content/en/docs/reference ##@ Build @@ -318,6 +318,12 @@ HELM = $(PROJECT_DIR)/bin/helm helm: ## Download helm locally if necessary. @GOBIN=$(PROJECT_DIR)/bin GO111MODULE=on $(GO_CMD) install helm.sh/helm/v3/cmd/helm@v3.12.1 +GENREF = $(PROJECT_DIR)/bin/genref +.PHONY: genref +genref: ## Download genref locally if necessary. + # TODO: update the package version. "c519be1" - is the master tip on 27-Oct-2023 + @GOBIN=$(PROJECT_DIR)/bin $(GO_CMD) install github.com/kubernetes-sigs/reference-docs/genref@c519be1 + MPIROOT = $(shell $(GO_CMD) list -m -f "{{.Dir}}" github.com/kubeflow/mpi-operator) .PHONY: mpi-operator-crd mpi-operator-crd: @@ -348,3 +354,7 @@ CAROOT = $(shell $(GO_CMD) list -m -f "{{.Dir}}" k8s.io/autoscaler/cluster-autos cluster-autoscaler-crd: mkdir -p $(PROJECT_DIR)/dep-crds/cluster-autoscaler/ cp -f $(CAROOT)/config/crd/* $(PROJECT_DIR)/dep-crds/cluster-autoscaler/ + +.PHONY: generate-apiref +generate-apiref: genref + cd $(PROJECT_DIR)/site/genref/ && $(GENREF) -o $(PROJECT_DIR)/site/content/en/docs/reference diff --git a/site/content/en/docs/reference/kueue-config.v1beta1.md b/site/content/en/docs/reference/kueue-config.v1beta1.md new file mode 100644 index 0000000000..6dcccde428 --- /dev/null +++ b/site/content/en/docs/reference/kueue-config.v1beta1.md @@ -0,0 +1,583 @@ +--- +title: Kueue Configuration API +content_type: tool-reference +package: /v1beta1 +auto_generated: true +description: Generated API reference documentation for Kueue Configuration. +--- + + +## Resource Types + + +- [Configuration](#Configuration) + + + + +## `ClientConnection` {#ClientConnection} + + +**Appears in:** + + + + + + + + + + + + + + + + +
FieldDescription
qps [Required]
+float32 +
+

QPS controls the number of queries per second allowed for K8S api server +connection.

+
burst [Required]
+int32 +
+

Burst allows extra queries to accumulate when a client is exceeding its rate.

+
+ +## `ClusterQueueVisibility` {#ClusterQueueVisibility} + + +**Appears in:** + +- [QueueVisibility](#QueueVisibility) + + + + + + + + + + + + +
FieldDescription
maxCount [Required]
+int32 +
+

MaxCount indicates the maximal number of pending workloads exposed in the +cluster queue status. When the value is set to 0, then ClusterQueue +visibility updates are disabled. +The maximal value is 4000. +Defaults to 10.

+
+ +## `Configuration` {#Configuration} + + + +

Configuration is the Schema for the kueueconfigurations API

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
namespace [Required]
+string +
+

Namespace is the namespace in which kueue is deployed. It is used as part of DNSName of the webhook Service. +If not set, the value is set from the file /var/run/secrets/kubernetes.io/serviceaccount/namespace +If the file doesn't exist, default value is kueue-system.

+
ControllerManager [Required]
+ControllerManager +
(Members of ControllerManager are embedded into this type.) +

ControllerManager returns the configurations for controllers

+
manageJobsWithoutQueueName [Required]
+bool +
+

ManageJobsWithoutQueueName controls whether or not Kueue reconciles +batch/v1.Jobs that don't set the annotation kueue.x-k8s.io/queue-name. +If set to true, then those jobs will be suspended and never started unless +they are assigned a queue and eventually admitted. This also applies to +jobs created before starting the kueue controller. +Defaults to false; therefore, those jobs are not managed and if they are created +unsuspended, they will start immediately.

+
internalCertManagement [Required]
+InternalCertManagement +
+

InternalCertManagement is configuration for internalCertManagement

+
waitForPodsReady [Required]
+WaitForPodsReady +
+

WaitForPodsReady is configuration to provide simple all-or-nothing +scheduling semantics for jobs to ensure they get resources assigned. +This is achieved by blocking the start of new jobs until the previously +started job has all pods running (ready).

+
clientConnection [Required]
+ClientConnection +
+

ClientConnection provides additional configuration options for Kubernetes +API server client.

+
integrations [Required]
+Integrations +
+

Integrations provide configuration options for AI/ML/Batch frameworks +integrations (including K8S job).

+
queueVisibility [Required]
+QueueVisibility +
+

QueueVisibility is configuration to expose the information about the top +pending workloads.

+
+ +## `ControllerConfigurationSpec` {#ControllerConfigurationSpec} + + +**Appears in:** + +- [ControllerManager](#ControllerManager) + + +

ControllerConfigurationSpec defines the global configuration for +controllers registered with the manager.

+ + + + + + + + + + + + + + +
FieldDescription
groupKindConcurrency
+map[string]int +
+

GroupKindConcurrency is a map from a Kind to the number of concurrent reconciliation +allowed for that controller.

+

When a controller is registered within this manager using the builder utilities, +users have to specify the type the controller reconciles in the For(...) call. +If the object's kind passed matches one of the keys in this map, the concurrency +for that controller is set to the number specified.

+

The key is expected to be consistent in form with GroupKind.String(), +e.g. ReplicaSet in apps group (regardless of version) would be ReplicaSet.apps.

+
cacheSyncTimeout
+time.Duration +
+

CacheSyncTimeout refers to the time limit set to wait for syncing caches. +Defaults to 2 minutes if not set.

+
+ +## `ControllerHealth` {#ControllerHealth} + + +**Appears in:** + +- [ControllerManager](#ControllerManager) + + +

ControllerHealth defines the health configs.

+ + + + + + + + + + + + + + + + + +
FieldDescription
healthProbeBindAddress
+string +
+

HealthProbeBindAddress is the TCP address that the controller should bind to +for serving health probes +It can be set to "0" or "" to disable serving the health probe.

+
readinessEndpointName
+string +
+

ReadinessEndpointName, defaults to "readyz"

+
livenessEndpointName
+string +
+

LivenessEndpointName, defaults to "healthz"

+
+ +## `ControllerManager` {#ControllerManager} + + +**Appears in:** + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
webhook
+ControllerWebhook +
+

Webhook contains the controllers webhook configuration

+
leaderElection
+k8s.io/component-base/config/v1alpha1.LeaderElectionConfiguration +
+

LeaderElection is the LeaderElection config to be used when configuring +the manager.Manager leader election

+
metrics
+ControllerMetrics +
+

Metrics contains the controller metrics configuration

+
health
+ControllerHealth +
+

Health contains the controller health configuration

+
pprofBindAddress
+string +
+

PprofBindAddress is the TCP address that the controller should bind to +for serving pprof. +It can be set to "" or "0" to disable the pprof serving. +Since pprof may contain sensitive information, make sure to protect it +before exposing it to public.

+
controller
+ControllerConfigurationSpec +
+

Controller contains global configuration options for controllers +registered within this manager.

+
+ +## `ControllerMetrics` {#ControllerMetrics} + + +**Appears in:** + +- [ControllerManager](#ControllerManager) + + +

ControllerMetrics defines the metrics configs.

+ + + + + + + + + + + + + + +
FieldDescription
bindAddress
+string +
+

BindAddress is the TCP address that the controller should bind to +for serving prometheus metrics. +It can be set to "0" to disable the metrics serving.

+
enableClusterQueueResources
+bool +
+

EnableClusterQueueResources, if true the cluster queue resource usage and quotas +metrics will be reported.

+
+ +## `ControllerWebhook` {#ControllerWebhook} + + +**Appears in:** + +- [ControllerManager](#ControllerManager) + + +

ControllerWebhook defines the webhook server for the controller.

+ + + + + + + + + + + + + + + + + +
FieldDescription
port
+int +
+

Port is the port that the webhook server serves at. +It is used to set webhook.Server.Port.

+
host
+string +
+

Host is the hostname that the webhook server binds to. +It is used to set webhook.Server.Host.

+
certDir
+string +
+

CertDir is the directory that contains the server key and certificate. +if not set, webhook server would look up the server key and certificate in +{TempDir}/k8s-webhook-server/serving-certs. The server key and certificate +must be named tls.key and tls.crt, respectively.

+
+ +## `Integrations` {#Integrations} + + +**Appears in:** + + + + + + + + + + + + + + + + +
FieldDescription
frameworks [Required]
+[]string +
+

List of framework names to be enabled. +Possible options:

+
    +
  • "batch/job"
  • +
  • "kubeflow.org/mpijob"
  • +
  • "ray.io/rayjob"
  • +
  • "jobset.x-k8s.io/jobset"
  • +
  • "kubeflow.org/mxjob"
  • +
  • "kubeflow.org/paddlejob"
  • +
  • "kubeflow.org/pytorchjob"
  • +
  • "kubeflow.org/tfjob"
  • +
  • "kubeflow.org/xgboostjob"
  • +
  • "pod"
  • +
+
podOptions [Required]
+PodIntegrationOptions +
+

PodOptions defines kueue controller behaviour for pod objects

+
+ +## `InternalCertManagement` {#InternalCertManagement} + + +**Appears in:** + + + + + + + + + + + + + + + + + + + +
FieldDescription
enable [Required]
+bool +
+

Enable controls whether to enable internal cert management or not. +Defaults to true. If you want to use a third-party management, e.g. cert-manager, +set it to false. See the user guide for more information.

+
webhookServiceName [Required]
+string +
+

WebhookServiceName is the name of the Service used as part of the DNSName. +Defaults to kueue-webhook-service.

+
webhookSecretName [Required]
+string +
+

WebhookSecretName is the name of the Secret used to store CA and server certs. +Defaults to kueue-webhook-server-cert.

+
+ +## `PodIntegrationOptions` {#PodIntegrationOptions} + + +**Appears in:** + +- [Integrations](#Integrations) + + + + + + + + + + + + + + + +
FieldDescription
namespaceSelector [Required]
+k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector +
+

NamespaceSelector can be used to omit some namespaces from pod reconciliation

+
podSelector [Required]
+k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector +
+

PodSelector can be used to choose what pods to reconcile

+
+ +## `QueueVisibility` {#QueueVisibility} + + +**Appears in:** + + + + + + + + + + + + + + + + +
FieldDescription
clusterQueues [Required]
+ClusterQueueVisibility +
+

ClusterQueues is configuration to expose the information +about the top pending workloads in the cluster queue.

+
updateIntervalSeconds [Required]
+int32 +
+

UpdateIntervalSeconds specifies the time interval for updates to the structure +of the top pending workloads in the queues. +The minimum value is 1. +Defaults to 5.

+
+ +## `WaitForPodsReady` {#WaitForPodsReady} + + +**Appears in:** + + + + + + + + + + + + + + + + + + + +
FieldDescription
enable [Required]
+bool +
+

Enable when true, indicates that each admitted workload +blocks the admission of all other workloads from all queues until it is in the +PodsReady condition. If false, all workloads start as soon as they are +admitted and do not block admission of other workloads. The PodsReady +condition is only added if this setting is enabled. It defaults to false.

+
timeout
+k8s.io/apimachinery/pkg/apis/meta/v1.Duration +
+

Timeout defines the time for an admitted workload to reach the +PodsReady=true condition. When the timeout is reached, the workload admission +is cancelled and requeued in the same cluster queue. Defaults to 5min.

+
blockAdmission [Required]
+bool +
+

BlockAdmission when true, cluster queue will block admissions for all subsequent jobs +until the jobs reach the PodsReady=true condition. It defaults to false if Enable is false +and defaults to true otherwise.

+
\ No newline at end of file diff --git a/site/content/en/docs/reference/kueue.v1beta1.md b/site/content/en/docs/reference/kueue.v1beta1.md new file mode 100644 index 0000000000..e512cb9965 --- /dev/null +++ b/site/content/en/docs/reference/kueue.v1beta1.md @@ -0,0 +1,1670 @@ +--- +title: Kueue API +content_type: tool-reference +package: kueue.x-k8s.io/v1beta1 +auto_generated: true +description: Generated API reference documentation for kueue.x-k8s.io/v1beta1. +--- + + +## Resource Types + + +- [AdmissionCheck](#kueue-x-k8s-io-v1beta1-AdmissionCheck) +- [ClusterQueue](#kueue-x-k8s-io-v1beta1-ClusterQueue) +- [LocalQueue](#kueue-x-k8s-io-v1beta1-LocalQueue) +- [ProvisioningRequestConfig](#kueue-x-k8s-io-v1beta1-ProvisioningRequestConfig) +- [ResourceFlavor](#kueue-x-k8s-io-v1beta1-ResourceFlavor) +- [Workload](#kueue-x-k8s-io-v1beta1-Workload) +- [WorkloadPriorityClass](#kueue-x-k8s-io-v1beta1-WorkloadPriorityClass) + + +## `AdmissionCheck` {#kueue-x-k8s-io-v1beta1-AdmissionCheck} + + +**Appears in:** + + + +

AdmissionCheck is the Schema for the admissionchecks API

+ + + + + + + + + + + + + + + + + +
FieldDescription
apiVersion
string
kueue.x-k8s.io/v1beta1
kind
string
AdmissionCheck
spec [Required]
+AdmissionCheckSpec +
+ No description provided.
status [Required]
+AdmissionCheckStatus +
+ No description provided.
+ +## `ClusterQueue` {#kueue-x-k8s-io-v1beta1-ClusterQueue} + + +**Appears in:** + + + +

ClusterQueue is the Schema for the clusterQueue API.

+ + + + + + + + + + + + + + + + + +
FieldDescription
apiVersion
string
kueue.x-k8s.io/v1beta1
kind
string
ClusterQueue
spec [Required]
+ClusterQueueSpec +
+ No description provided.
status [Required]
+ClusterQueueStatus +
+ No description provided.
+ +## `LocalQueue` {#kueue-x-k8s-io-v1beta1-LocalQueue} + + +**Appears in:** + + + +

LocalQueue is the Schema for the localQueues API

+ + + + + + + + + + + + + + + + + +
FieldDescription
apiVersion
string
kueue.x-k8s.io/v1beta1
kind
string
LocalQueue
spec [Required]
+LocalQueueSpec +
+ No description provided.
status [Required]
+LocalQueueStatus +
+ No description provided.
+ +## `ProvisioningRequestConfig` {#kueue-x-k8s-io-v1beta1-ProvisioningRequestConfig} + + +**Appears in:** + + + +

ProvisioningRequestConfig is the Schema for the provisioningrequestconfig API

+ + + + + + + + + + + + + + +
FieldDescription
apiVersion
string
kueue.x-k8s.io/v1beta1
kind
string
ProvisioningRequestConfig
spec [Required]
+ProvisioningRequestConfigSpec +
+ No description provided.
+ +## `ResourceFlavor` {#kueue-x-k8s-io-v1beta1-ResourceFlavor} + + +**Appears in:** + + + +

ResourceFlavor is the Schema for the resourceflavors API.

+ + + + + + + + + + + + + + +
FieldDescription
apiVersion
string
kueue.x-k8s.io/v1beta1
kind
string
ResourceFlavor
spec [Required]
+ResourceFlavorSpec +
+ No description provided.
+ +## `Workload` {#kueue-x-k8s-io-v1beta1-Workload} + + +**Appears in:** + + + +

Workload is the Schema for the workloads API

+ + + + + + + + + + + + + + + + + +
FieldDescription
apiVersion
string
kueue.x-k8s.io/v1beta1
kind
string
Workload
spec [Required]
+WorkloadSpec +
+ No description provided.
status [Required]
+WorkloadStatus +
+ No description provided.
+ +## `WorkloadPriorityClass` {#kueue-x-k8s-io-v1beta1-WorkloadPriorityClass} + + +**Appears in:** + + + +

WorkloadPriorityClass is the Schema for the workloadPriorityClass API

+ + + + + + + + + + + + + + + + + +
FieldDescription
apiVersion
string
kueue.x-k8s.io/v1beta1
kind
string
WorkloadPriorityClass
value [Required]
+int32 +
+

value represents the integer value of this workloadPriorityClass. This is the actual priority that workloads +receive when jobs have the name of this class in their workloadPriorityClass label. +Changing the value of workloadPriorityClass doesn't affect the priority of workloads that were already created.

+
description
+string +
+

description is an arbitrary string that usually provides guidelines on +when this workloadPriorityClass should be used.

+
+ +## `Admission` {#kueue-x-k8s-io-v1beta1-Admission} + + +**Appears in:** + +- [WorkloadStatus](#kueue-x-k8s-io-v1beta1-WorkloadStatus) + + + + + + + + + + + + + + + +
FieldDescription
clusterQueue [Required]
+ClusterQueueReference +
+

clusterQueue is the name of the ClusterQueue that admitted this workload.

+
podSetAssignments [Required]
+[]PodSetAssignment +
+

PodSetAssignments hold the admission results for each of the .spec.podSets entries.

+
+ +## `AdmissionCheckParametersReference` {#kueue-x-k8s-io-v1beta1-AdmissionCheckParametersReference} + + +**Appears in:** + +- [AdmissionCheckSpec](#kueue-x-k8s-io-v1beta1-AdmissionCheckSpec) + + + + + + + + + + + + + + + + + + +
FieldDescription
apiGroup [Required]
+string +
+

ApiGroup is the group for the resource being referenced.

+
kind [Required]
+string +
+

Kind is the type of the resource being referenced.

+
name [Required]
+string +
+

Name is the name of the resource being referenced.

+
+ +## `AdmissionCheckSpec` {#kueue-x-k8s-io-v1beta1-AdmissionCheckSpec} + + +**Appears in:** + +- [AdmissionCheck](#kueue-x-k8s-io-v1beta1-AdmissionCheck) + + +

AdmissionCheckSpec defines the desired state of AdmissionCheck

+ + + + + + + + + + + + + + + + + +
FieldDescription
controllerName [Required]
+string +
+

controllerName is name of the controller which will actually perform +the checks. This is the name with which controller identifies with, +not necessarily a K8S Pod or Deployment name. Cannot be empty.

+
retryDelayMinutes
+int64 +
+

RetryDelayMinutes specifies how long to keep the workload suspended +after a failed check (after it transitioned to False). +After that the check state goes to "Unknown". +The default is 15 min.

+
parameters
+AdmissionCheckParametersReference +
+

Parameters identifies the resource providing additional check parameters.

+
+ +## `AdmissionCheckState` {#kueue-x-k8s-io-v1beta1-AdmissionCheckState} + + +**Appears in:** + +- [WorkloadStatus](#kueue-x-k8s-io-v1beta1-WorkloadStatus) + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
name [Required]
+string +
+

name identifies the admission check.

+
state [Required]
+CheckState +
+

status of the condition, one of True, False, Unknown.

+
lastTransitionTime [Required]
+k8s.io/apimachinery/pkg/apis/meta/v1.Time +
+

lastTransitionTime is the last time the condition transitioned from one status to another. +This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.

+
message [Required]
+string +
+

message is a human readable message indicating details about the transition. +This may be an empty string.

+
podSetUpdates
+[]PodSetUpdate +
+ No description provided.
+ +## `AdmissionCheckStatus` {#kueue-x-k8s-io-v1beta1-AdmissionCheckStatus} + + +**Appears in:** + +- [AdmissionCheck](#kueue-x-k8s-io-v1beta1-AdmissionCheck) + + +

AdmissionCheckStatus defines the observed state of AdmissionCheck

+ + + + + + + + + + + +
FieldDescription
conditions
+[]k8s.io/apimachinery/pkg/apis/meta/v1.Condition +
+

conditions hold the latest available observations of the AdmissionCheck +current state.

+
+ +## `CheckState` {#kueue-x-k8s-io-v1beta1-CheckState} + +(Alias of `string`) + +**Appears in:** + +- [AdmissionCheckState](#kueue-x-k8s-io-v1beta1-AdmissionCheckState) + + + + + +## `ClusterQueuePendingWorkload` {#kueue-x-k8s-io-v1beta1-ClusterQueuePendingWorkload} + + +**Appears in:** + +- [ClusterQueuePendingWorkloadsStatus](#kueue-x-k8s-io-v1beta1-ClusterQueuePendingWorkloadsStatus) + + +

ClusterQueuePendingWorkload contains the information identifying a pending workload +in the cluster queue.

+ + + + + + + + + + + + + + +
FieldDescription
name [Required]
+string +
+

Name indicates the name of the pending workload.

+
namespace [Required]
+string +
+

Namespace indicates the name of the pending workload.

+
+ +## `ClusterQueuePendingWorkloadsStatus` {#kueue-x-k8s-io-v1beta1-ClusterQueuePendingWorkloadsStatus} + + +**Appears in:** + +- [ClusterQueueStatus](#kueue-x-k8s-io-v1beta1-ClusterQueueStatus) + + + + + + + + + + + + + + + +
FieldDescription
clusterQueuePendingWorkload
+[]ClusterQueuePendingWorkload +
+

Head contains the list of top pending workloads.

+
lastChangeTime [Required]
+k8s.io/apimachinery/pkg/apis/meta/v1.Time +
+

LastChangeTime indicates the time of the last change of the structure.

+
+ +## `ClusterQueuePreemption` {#kueue-x-k8s-io-v1beta1-ClusterQueuePreemption} + + +**Appears in:** + +- [ClusterQueueSpec](#kueue-x-k8s-io-v1beta1-ClusterQueueSpec) + + +

ClusterQueuePreemption contains policies to preempt Workloads from this +ClusterQueue or the ClusterQueue's cohort.

+ + + + + + + + + + + + + + +
FieldDescription
reclaimWithinCohort [Required]
+PreemptionPolicy +
+

reclaimWithinCohort determines whether a pending Workload can preempt +Workloads from other ClusterQueues in the cohort that are using more than +their nominal quota. The possible values are:

+
    +
  • Never (default): do not preempt Workloads in the cohort.
  • +
  • LowerPriority: if the pending Workload fits within the nominal +quota of its ClusterQueue, only preempt Workloads in the cohort that have +lower priority than the pending Workload.
  • +
  • Any: if the pending Workload fits within the nominal quota of its +ClusterQueue, preempt any Workload in the cohort, irrespective of +priority.
  • +
+
withinClusterQueue [Required]
+PreemptionPolicy +
+

withinClusterQueue determines whether a pending Workload that doesn't fit +within the nominal quota for its ClusterQueue, can preempt active Workloads in +the ClusterQueue. The possible values are:

+
    +
  • Never (default): do not preempt Workloads in the ClusterQueue.
  • +
  • LowerPriority: only preempt Workloads in the ClusterQueue that have +lower priority than the pending Workload.
  • +
  • LowerOrNewerEqualPriority: only preempt Workloads in the ClusterQueue that +either have a lower priority than the pending workload or equal priority +and are newer than the pending workload.
  • +
+
+ +## `ClusterQueueReference` {#kueue-x-k8s-io-v1beta1-ClusterQueueReference} + +(Alias of `string`) + +**Appears in:** + +- [Admission](#kueue-x-k8s-io-v1beta1-Admission) + +- [LocalQueueSpec](#kueue-x-k8s-io-v1beta1-LocalQueueSpec) + + +

ClusterQueueReference is the name of the ClusterQueue.

+ + + + +## `ClusterQueueSpec` {#kueue-x-k8s-io-v1beta1-ClusterQueueSpec} + + +**Appears in:** + +- [ClusterQueue](#kueue-x-k8s-io-v1beta1-ClusterQueue) + + +

ClusterQueueSpec defines the desired state of ClusterQueue

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
resourceGroups [Required]
+[]ResourceGroup +
+

resourceGroups describes groups of resources. +Each resource group defines the list of resources and a list of flavors +that provide quotas for these resources. +Each resource and each flavor can only form part of one resource group. +resourceGroups can be up to 16.

+
cohort [Required]
+string +
+

cohort that this ClusterQueue belongs to. CQs that belong to the +same cohort can borrow unused resources from each other.

+

A CQ can be a member of a single borrowing cohort. A workload submitted +to a queue referencing this CQ can borrow quota from any CQ in the cohort. +Only quota for the [resource, flavor] pairs listed in the CQ can be +borrowed. +If empty, this ClusterQueue cannot borrow from any other ClusterQueue and +vice versa.

+

A cohort is a name that links CQs together, but it doesn't reference any +object.

+

Validation of a cohort name is equivalent to that of object names: +subdomain in DNS (RFC 1123).

+
queueingStrategy [Required]
+QueueingStrategy +
+

QueueingStrategy indicates the queueing strategy of the workloads +across the queues in this ClusterQueue. This field is immutable. +Current Supported Strategies:

+
    +
  • StrictFIFO: workloads are ordered strictly by creation time. +Older workloads that can't be admitted will block admitting newer +workloads even if they fit available quota.
  • +
  • BestEffortFIFO: workloads are ordered by creation time, +however older workloads that can't be admitted will not block +admitting newer workloads that fit existing quota.
  • +
+
namespaceSelector [Required]
+k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector +
+

namespaceSelector defines which namespaces are allowed to submit workloads to +this clusterQueue. Beyond this basic support for policy, an policy agent like +Gatekeeper should be used to enforce more advanced policies. +Defaults to null which is a nothing selector (no namespaces eligible). +If set to an empty selector {}, then all namespaces are eligible.

+
flavorFungibility [Required]
+FlavorFungibility +
+

flavorFungibility defines whether a workload should try the next flavor +before borrowing or preempting in the flavor being evaluated.

+
preemption [Required]
+ClusterQueuePreemption +
+

preemption describes policies to preempt Workloads from this ClusterQueue +or the ClusterQueue's cohort.

+

Preemption can happen in two scenarios:

+
    +
  • When a Workload fits within the nominal quota of the ClusterQueue, but +the quota is currently borrowed by other ClusterQueues in the cohort. +Preempting Workloads in other ClusterQueues allows this ClusterQueue to +reclaim its nominal quota.
  • +
  • When a Workload doesn't fit within the nominal quota of the ClusterQueue +and there are admitted Workloads in the ClusterQueue with lower priority.
  • +
+

The preemption algorithm tries to find a minimal set of Workloads to +preempt to accomomdate the pending Workload, preempting Workloads with +lower priority first.

+
admissionChecks
+[]string +
+

admissionChecks lists the AdmissionChecks required by this ClusterQueue

+
+ +## `ClusterQueueStatus` {#kueue-x-k8s-io-v1beta1-ClusterQueueStatus} + + +**Appears in:** + +- [ClusterQueue](#kueue-x-k8s-io-v1beta1-ClusterQueue) + + +

ClusterQueueStatus defines the observed state of ClusterQueue

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
flavorsReservation
+[]FlavorUsage +
+

flavorsReservation are the reserved quotas, by flavor, currently in use by the +workloads assigned to this ClusterQueue.

+
flavorsUsage
+[]FlavorUsage +
+

flavorsUsage are the used quotas, by flavor, currently in use by the +workloads admitted in this ClusterQueue.

+
pendingWorkloads
+int32 +
+

pendingWorkloads is the number of workloads currently waiting to be +admitted to this clusterQueue.

+
reservingWorkloads
+int32 +
+

reservingWorkloads is the number of workloads currently reserving quota in this +clusterQueue.

+
admittedWorkloads
+int32 +
+

admittedWorkloads is the number of workloads currently admitted to this +clusterQueue and haven't finished yet.

+
conditions
+[]k8s.io/apimachinery/pkg/apis/meta/v1.Condition +
+

conditions hold the latest available observations of the ClusterQueue +current state.

+
pendingWorkloadsStatus
+ClusterQueuePendingWorkloadsStatus +
+

PendingWorkloadsStatus contains the information exposed about the current +status of the pending workloads in the cluster queue.

+
+ +## `FlavorFungibility` {#kueue-x-k8s-io-v1beta1-FlavorFungibility} + + +**Appears in:** + +- [ClusterQueueSpec](#kueue-x-k8s-io-v1beta1-ClusterQueueSpec) + + +

FlavorFungibility determines whether a workload should try the next flavor +before borrowing or preempting in current flavor.

+ + + + + + + + + + + + + + +
FieldDescription
whenCanBorrow [Required]
+FlavorFungibilityPolicy +
+

whenCanBorrow determines whether a workload should try the next flavor +before borrowing in current flavor. The possible values are:

+
    +
  • Borrow (default): allocate in current flavor if borrowing +is possible.
  • +
  • TryNextFlavor: try next flavor even if the current +flavor has enough resources to borrow.
  • +
+
whenCanPreempt [Required]
+FlavorFungibilityPolicy +
+

whenCanPreempt determines whether a workload should try the next flavor +before borrowing in current flavor. The possible values are:

+
    +
  • Preempt: allocate in current flavor if it's possible to preempt some workloads.
  • +
  • TryNextFlavor (default): try next flavor even if there are enough +candidates for preemption in the current flavor.
  • +
+
+ +## `FlavorFungibilityPolicy` {#kueue-x-k8s-io-v1beta1-FlavorFungibilityPolicy} + +(Alias of `string`) + +**Appears in:** + +- [FlavorFungibility](#kueue-x-k8s-io-v1beta1-FlavorFungibility) + + + + + +## `FlavorQuotas` {#kueue-x-k8s-io-v1beta1-FlavorQuotas} + + +**Appears in:** + +- [ResourceGroup](#kueue-x-k8s-io-v1beta1-ResourceGroup) + + + + + + + + + + + + + + + +
FieldDescription
name [Required]
+ResourceFlavorReference +
+

name of this flavor. The name should match the .metadata.name of a +ResourceFlavor. If a matching ResourceFlavor does not exist, the +ClusterQueue will have an Active condition set to False.

+
resources [Required]
+[]ResourceQuota +
+

resources is the list of quotas for this flavor per resource. +There could be up to 16 resources.

+
+ +## `FlavorUsage` {#kueue-x-k8s-io-v1beta1-FlavorUsage} + + +**Appears in:** + +- [ClusterQueueStatus](#kueue-x-k8s-io-v1beta1-ClusterQueueStatus) + + + + + + + + + + + + + + + +
FieldDescription
name [Required]
+ResourceFlavorReference +
+

name of the flavor.

+
resources [Required]
+[]ResourceUsage +
+

resources lists the quota usage for the resources in this flavor.

+
+ +## `LocalQueueFlavorUsage` {#kueue-x-k8s-io-v1beta1-LocalQueueFlavorUsage} + + +**Appears in:** + +- [LocalQueueStatus](#kueue-x-k8s-io-v1beta1-LocalQueueStatus) + + + + + + + + + + + + + + + +
FieldDescription
name [Required]
+ResourceFlavorReference +
+

name of the flavor.

+
resources [Required]
+[]LocalQueueResourceUsage +
+

resources lists the quota usage for the resources in this flavor.

+
+ +## `LocalQueueResourceUsage` {#kueue-x-k8s-io-v1beta1-LocalQueueResourceUsage} + + +**Appears in:** + +- [LocalQueueFlavorUsage](#kueue-x-k8s-io-v1beta1-LocalQueueFlavorUsage) + + + + + + + + + + + + + + + +
FieldDescription
name [Required]
+k8s.io/api/core/v1.ResourceName +
+

name of the resource.

+
total [Required]
+k8s.io/apimachinery/pkg/api/resource.Quantity +
+

total is the total quantity of used quota.

+
+ +## `LocalQueueSpec` {#kueue-x-k8s-io-v1beta1-LocalQueueSpec} + + +**Appears in:** + +- [LocalQueue](#kueue-x-k8s-io-v1beta1-LocalQueue) + + +

LocalQueueSpec defines the desired state of LocalQueue

+ + + + + + + + + + + +
FieldDescription
clusterQueue [Required]
+ClusterQueueReference +
+

clusterQueue is a reference to a clusterQueue that backs this localQueue.

+
+ +## `LocalQueueStatus` {#kueue-x-k8s-io-v1beta1-LocalQueueStatus} + + +**Appears in:** + +- [LocalQueue](#kueue-x-k8s-io-v1beta1-LocalQueue) + + +

LocalQueueStatus defines the observed state of LocalQueue

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
pendingWorkloads
+int32 +
+

PendingWorkloads is the number of Workloads in the LocalQueue not yet admitted to a ClusterQueue

+
reservingWorkloads
+int32 +
+

reservingWorkloads is the number of workloads in this LocalQueue +reserving quota in a ClusterQueue and that haven't finished yet.

+
admittedWorkloads
+int32 +
+

admittedWorkloads is the number of workloads in this LocalQueue +admitted to a ClusterQueue and that haven't finished yet.

+
conditions
+[]k8s.io/apimachinery/pkg/apis/meta/v1.Condition +
+

Conditions hold the latest available observations of the LocalQueue +current state.

+
flavorsReservation
+[]LocalQueueFlavorUsage +
+

flavorsReservation are the reserved quotas, by flavor currently in use by the +workloads assigned to this LocalQueue.

+
flavorUsage
+[]LocalQueueFlavorUsage +
+

flavorsUsage are the used quotas, by flavor currently in use by the +workloads assigned to this LocalQueue.

+
+ +## `Parameter` {#kueue-x-k8s-io-v1beta1-Parameter} + +(Alias of `string`) + +**Appears in:** + +- [ProvisioningRequestConfigSpec](#kueue-x-k8s-io-v1beta1-ProvisioningRequestConfigSpec) + + +

Parameter is limited to 255 characters.

+ + + + +## `PodSet` {#kueue-x-k8s-io-v1beta1-PodSet} + + +**Appears in:** + +- [WorkloadSpec](#kueue-x-k8s-io-v1beta1-WorkloadSpec) + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
name [Required]
+string +
+

name is the PodSet name.

+
template [Required]
+k8s.io/api/core/v1.PodTemplateSpec +
+

template is the Pod template.

+

The only allowed fields in template.metadata are labels and annotations.

+

If requests are omitted for a container or initContainer, +they default to the limits if they are explicitly specified for the +container or initContainer.

+

During admission, the rules in nodeSelector and +nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution that match +the keys in the nodeLabels from the ResourceFlavors considered for this +Workload are used to filter the ResourceFlavors that can be assigned to +this podSet.

+
count [Required]
+int32 +
+

count is the number of pods for the spec.

+
minCount
+int32 +
+

minCount is the minimum number of pods for the spec acceptable +if the workload supports partial admission.

+

If not provided, partial admission for the current PodSet is not +enabled.

+

Only one podSet within the workload can use this.

+

This is an alpha field and requires enabling PartialAdmission feature gate.

+
+ +## `PodSetAssignment` {#kueue-x-k8s-io-v1beta1-PodSetAssignment} + + +**Appears in:** + +- [Admission](#kueue-x-k8s-io-v1beta1-Admission) + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
name [Required]
+string +
+

Name is the name of the podSet. It should match one of the names in .spec.podSets.

+
flavors [Required]
+map[k8s.io/api/core/v1.ResourceName]../../apis/kueue/v1beta1.ResourceFlavorReference +
+

Flavors are the flavors assigned to the workload for each resource.

+
resourceUsage [Required]
+k8s.io/api/core/v1.ResourceList +
+

resourceUsage keeps track of the total resources all the pods in the podset need to run.

+

Beside what is provided in podSet's specs, this calculation takes into account +the LimitRange defaults and RuntimeClass overheads at the moment of admission. +This field will not change in case of quota reclaim.

+
count
+int32 +
+

count is the number of pods taken into account at admission time. +This field will not change in case of quota reclaim. +Value could be missing for Workloads created before this field was added, +in that case spec.podSets[*].count value will be used.

+
+ +## `PodSetUpdate` {#kueue-x-k8s-io-v1beta1-PodSetUpdate} + + +**Appears in:** + +- [AdmissionCheckState](#kueue-x-k8s-io-v1beta1-AdmissionCheckState) + + +

PodSetUpdate contains a list of pod set modifications suggested by AdmissionChecks. +The modifications should be additive only - modifications of already existing keys +or having the same key provided by multiple AdmissionChecks is not allowed and will +result in failure during workload admission.

+ + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
name [Required]
+string +
+

Name of the PodSet to modify. Should match to one of the Workload's PodSets.

+
labels
+map[string]string +
+ No description provided.
annotations
+map[string]string +
+ No description provided.
nodeSelector
+map[string]string +
+ No description provided.
tolerations
+[]k8s.io/api/core/v1.Toleration +
+ No description provided.
+ +## `PreemptionPolicy` {#kueue-x-k8s-io-v1beta1-PreemptionPolicy} + +(Alias of `string`) + +**Appears in:** + +- [ClusterQueuePreemption](#kueue-x-k8s-io-v1beta1-ClusterQueuePreemption) + + + + + +## `ProvisioningRequestConfigSpec` {#kueue-x-k8s-io-v1beta1-ProvisioningRequestConfigSpec} + + +**Appears in:** + +- [ProvisioningRequestConfig](#kueue-x-k8s-io-v1beta1-ProvisioningRequestConfig) + + +

ProvisioningRequestConfigSpec defines the desired state of ProvisioningRequestConfig

+ + + + + + + + + + + + + + + + + +
FieldDescription
provisioningClassName [Required]
+string +
+

ProvisioningClassName describes the different modes of provisioning the resources. +Check autoscaling.x-k8s.io ProvisioningRequestSpec.ProvisioningClassName for details.

+
parameters
+map[string]../../apis/kueue/v1beta1.Parameter +
+

Parameters contains all other parameters classes may require.

+
managedResources
+[]k8s.io/api/core/v1.ResourceName +
+

managedResources contains the list of resources managed by the autoscaling.

+

If empty, all resources are considered managed.

+

If not empty, the ProvisioningRequest will contain only the podsets that are +requesting at least one of them.

+

If none of the workloads podsets is requesting at least a managed resource, +the workload is considered ready.

+
+ +## `QueueingStrategy` {#kueue-x-k8s-io-v1beta1-QueueingStrategy} + +(Alias of `string`) + +**Appears in:** + +- [ClusterQueueSpec](#kueue-x-k8s-io-v1beta1-ClusterQueueSpec) + + + + + +## `ReclaimablePod` {#kueue-x-k8s-io-v1beta1-ReclaimablePod} + + +**Appears in:** + +- [WorkloadStatus](#kueue-x-k8s-io-v1beta1-WorkloadStatus) + + + + + + + + + + + + + + + +
FieldDescription
name [Required]
+string +
+

name is the PodSet name.

+
count [Required]
+int32 +
+

count is the number of pods for which the requested resources are no longer needed.

+
+ +## `ResourceFlavorReference` {#kueue-x-k8s-io-v1beta1-ResourceFlavorReference} + +(Alias of `string`) + +**Appears in:** + +- [FlavorQuotas](#kueue-x-k8s-io-v1beta1-FlavorQuotas) + +- [FlavorUsage](#kueue-x-k8s-io-v1beta1-FlavorUsage) + +- [LocalQueueFlavorUsage](#kueue-x-k8s-io-v1beta1-LocalQueueFlavorUsage) + +- [PodSetAssignment](#kueue-x-k8s-io-v1beta1-PodSetAssignment) + + +

ResourceFlavorReference is the name of the ResourceFlavor.

+ + + + +## `ResourceFlavorSpec` {#kueue-x-k8s-io-v1beta1-ResourceFlavorSpec} + + +**Appears in:** + +- [ResourceFlavor](#kueue-x-k8s-io-v1beta1-ResourceFlavor) + + +

ResourceFlavorSpec defines the desired state of the ResourceFlavor

+ + + + + + + + + + + + + + + + + +
FieldDescription
nodeLabels
+map[string]string +
+

nodeLabels are labels that associate the ResourceFlavor with Nodes that +have the same labels. +When a Workload is admitted, its podsets can only get assigned +ResourceFlavors whose nodeLabels match the nodeSelector and nodeAffinity +fields. +Once a ResourceFlavor is assigned to a podSet, the ResourceFlavor's +nodeLabels should be injected into the pods of the Workload by the +controller that integrates with the Workload object.

+

nodeLabels can be up to 8 elements.

+
nodeTaints
+[]k8s.io/api/core/v1.Taint +
+

nodeTaints are taints that the nodes associated with this ResourceFlavor +have. +Workloads' podsets must have tolerations for these nodeTaints in order to +get assigned this ResourceFlavor during admission.

+

An example of a nodeTaint is +cloud.provider.com/preemptible="true":NoSchedule

+

nodeTaints can be up to 8 elements.

+
tolerations
+[]k8s.io/api/core/v1.Toleration +
+

tolerations are extra tolerations that will be added to the pods admitted in +the quota associated with this resource flavor.

+

An example of a toleration is +cloud.provider.com/preemptible="true":NoSchedule

+

tolerations can be up to 8 elements.

+
+ +## `ResourceGroup` {#kueue-x-k8s-io-v1beta1-ResourceGroup} + + +**Appears in:** + +- [ClusterQueueSpec](#kueue-x-k8s-io-v1beta1-ClusterQueueSpec) + + + + + + + + + + + + + + + +
FieldDescription
coveredResources [Required]
+[]k8s.io/api/core/v1.ResourceName +
+

coveredResources is the list of resources covered by the flavors in this +group. +Examples: cpu, memory, vendor.com/gpu. +The list cannot be empty and it can contain up to 16 resources.

+
flavors [Required]
+[]FlavorQuotas +
+

flavors is the list of flavors that provide the resources of this group. +Typically, different flavors represent different hardware models +(e.g., gpu models, cpu architectures) or pricing models (on-demand vs spot +cpus). +Each flavor MUST list all the resources listed for this group in the same +order as the .resources field. +The list cannot be empty and it can contain up to 16 flavors.

+
+ +## `ResourceQuota` {#kueue-x-k8s-io-v1beta1-ResourceQuota} + + +**Appears in:** + +- [FlavorQuotas](#kueue-x-k8s-io-v1beta1-FlavorQuotas) + + + + + + + + + + + + + + + + + + +
FieldDescription
name [Required]
+k8s.io/api/core/v1.ResourceName +
+

name of this resource.

+
nominalQuota [Required]
+k8s.io/apimachinery/pkg/api/resource.Quantity +
+

nominalQuota is the quantity of this resource that is available for +Workloads admitted by this ClusterQueue at a point in time. +The nominalQuota must be non-negative. +nominalQuota should represent the resources in the cluster available for +running jobs (after discounting resources consumed by system components +and pods not managed by kueue). In an autoscaled cluster, nominalQuota +should account for resources that can be provided by a component such as +Kubernetes cluster-autoscaler.

+

If the ClusterQueue belongs to a cohort, the sum of the quotas for each +(flavor, resource) combination defines the maximum quantity that can be +allocated by a ClusterQueue in the cohort.

+
borrowingLimit
+k8s.io/apimachinery/pkg/api/resource.Quantity +
+

borrowingLimit is the maximum amount of quota for the [flavor, resource] +combination that this ClusterQueue is allowed to borrow from the unused +quota of other ClusterQueues in the same cohort. +In total, at a given time, Workloads in a ClusterQueue can consume a +quantity of quota equal to nominalQuota+borrowingLimit, assuming the other +ClusterQueues in the cohort have enough unused quota. +If null, it means that there is no borrowing limit. +If not null, it must be non-negative. +borrowingLimit must be null if spec.cohort is empty.

+
+ +## `ResourceUsage` {#kueue-x-k8s-io-v1beta1-ResourceUsage} + + +**Appears in:** + +- [FlavorUsage](#kueue-x-k8s-io-v1beta1-FlavorUsage) + + + + + + + + + + + + + + + + + + +
FieldDescription
name [Required]
+k8s.io/api/core/v1.ResourceName +
+

name of the resource

+
total [Required]
+k8s.io/apimachinery/pkg/api/resource.Quantity +
+

total is the total quantity of used quota, including the amount borrowed +from the cohort.

+
borrowed [Required]
+k8s.io/apimachinery/pkg/api/resource.Quantity +
+

Borrowed is quantity of quota that is borrowed from the cohort. In other +words, it's the used quota that is over the nominalQuota.

+
+ +## `WorkloadSpec` {#kueue-x-k8s-io-v1beta1-WorkloadSpec} + + +**Appears in:** + +- [Workload](#kueue-x-k8s-io-v1beta1-Workload) + + +

WorkloadSpec defines the desired state of Workload

+ + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
podSets [Required]
+[]PodSet +
+

podSets is a list of sets of homogeneous pods, each described by a Pod spec +and a count. +There must be at least one element and at most 8. +podSets cannot be changed.

+
queueName [Required]
+string +
+

queueName is the name of the LocalQueue the Workload is associated with. +queueName cannot be changed while .status.admission is not null.

+
priorityClassName [Required]
+string +
+

If specified, indicates the workload's priority. +"system-node-critical" and "system-cluster-critical" are two special +keywords which indicate the highest priorities with the former being +the highest priority. Any other name must be defined by creating a +PriorityClass object with that name. If not specified, the workload +priority will be default or zero if there is no default.

+
priority [Required]
+int32 +
+

Priority determines the order of access to the resources managed by the +ClusterQueue where the workload is queued. +The priority value is populated from PriorityClassName. +The higher the value, the higher the priority. +If priorityClassName is specified, priority must not be null.

+
priorityClassSource [Required]
+string +
+

priorityClassSource determines whether the priorityClass field refers to a pod PriorityClass or kueue.x-k8s.io/workloadpriorityclass. +Workload's PriorityClass can accept the name of a pod priorityClass or a workloadPriorityClass. +When using pod PriorityClass, a priorityClassSource field has the scheduling.k8s.io/priorityclass value.

+
+ +## `WorkloadStatus` {#kueue-x-k8s-io-v1beta1-WorkloadStatus} + + +**Appears in:** + +- [Workload](#kueue-x-k8s-io-v1beta1-Workload) + + +

WorkloadStatus defines the observed state of Workload

+ + + + + + + + + + + + + + + + + + + + +
FieldDescription
admission [Required]
+Admission +
+

admission holds the parameters of the admission of the workload by a +ClusterQueue. admission can be set back to null, but its fields cannot be +changed once set.

+
conditions
+[]k8s.io/apimachinery/pkg/apis/meta/v1.Condition +
+

conditions hold the latest available observations of the Workload +current state.

+

The type of the condition could be:

+
    +
  • Admitted: the Workload was admitted through a ClusterQueue.
  • +
  • Finished: the associated workload finished running (failed or succeeded).
  • +
  • PodsReady: at least .spec.podSets[*].count Pods are ready or have +succeeded.
  • +
+
reclaimablePods
+[]ReclaimablePod +
+

reclaimablePods keeps track of the number pods within a podset for which +the resource reservation is no longer needed.

+
admissionChecks
+[]AdmissionCheckState +
+

admissionChecks list all the admission checks required by the workload and the current status

+
+ \ No newline at end of file diff --git a/site/genref/config.yaml b/site/genref/config.yaml new file mode 100644 index 0000000000..9ab2ef6b50 --- /dev/null +++ b/site/genref/config.yaml @@ -0,0 +1,24 @@ +hiddenMemberFields: + - "TypeMeta" + - "ObjectMeta" + +apis: + - name: kueue + title: Kueue API + package: ../.. + path: apis/kueue/v1beta1 + + - name: kueue-config + title: Kueue Configuration API + package: ../.. + path: apis/config/v1beta1 + +externalPackages: + - match: ^k8s\.io/(api|apimachinery/pkg/apis)/ + target: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#{{- lower .TypeIdentifier -}}-{{- arrIndex .PackageSegments -1 -}}-{{- arrIndex .PackageSegments -2 -}} + - match: ^k8s\.io/apimachinery/pkg/api/resource\.Quantity$ + target: https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#Quantity + - match: ^k8s.io/component-base/config/v1alpha1. + target: https://pkg.go.dev/k8s.io/component-base/config/v1alpha1#{{- .TypeIdentifier -}} + - match: ^time\.Duration$ + target: https://pkg.go.dev/time#Duration diff --git a/site/genref/markdown/members.tpl b/site/genref/markdown/members.tpl new file mode 100644 index 0000000000..b9702186cc --- /dev/null +++ b/site/genref/markdown/members.tpl @@ -0,0 +1,34 @@ +{{ define "members" }} + {{/* . is a apiType */}} + {{- range .GetMembers -}} + {{/* . is a apiMember */}} + {{- if not .Hidden }} +{{ .FieldName }} + {{- if not .IsOptional }} [Required]{{- end -}} +
+{{/* Link for type reference */}} + {{- with .GetType -}} + {{- if .Link -}} +{{ .DisplayName }} + {{- else -}} +{{ .DisplayName }} + {{- end -}} + {{- end }} + + + {{- if .IsInline -}} +(Members of {{ .FieldName }} are embedded into this type.) + {{- end }} + {{ if .GetComment -}} + {{ .GetComment }} + {{- else -}} + No description provided. + {{- end }} + {{- if and (eq (.GetType.Name.Name) "ObjectMeta") -}} +Refer to the Kubernetes API documentation for the fields of the metadata field. + {{- end -}} + + + {{- end }} + {{- end }} +{{ end }} diff --git a/site/genref/markdown/pkg.tpl b/site/genref/markdown/pkg.tpl new file mode 100644 index 0000000000..8be7f62701 --- /dev/null +++ b/site/genref/markdown/pkg.tpl @@ -0,0 +1,46 @@ +{{ define "packages" -}} + +{{- range $idx, $val := .packages -}} +{{/* Special handling for config */}} + {{- if .IsMain -}} +--- +title: {{ .Title }} +content_type: tool-reference +package: {{ .DisplayName }} +auto_generated: true +description: Generated API reference documentation for {{ if ne .GroupName "" -}} {{ .DisplayName }}{{ else -}} Kueue Configuration{{- end -}}. +--- +{{ .GetComment -}} + {{- end -}} +{{- end }} + +## Resource Types + +{{ range .packages -}} + {{ $isConfig := (eq .GroupName "") }} + {{- range .VisibleTypes -}} + {{- if or .IsExported (and $isConfig (eq .DisplayName "Configuration")) }} +- [{{ .DisplayName }}]({{ .Link }}) + {{- end -}} + {{- end -}} +{{- end -}} + +{{ range .packages }} + {{ if ne .GroupName "" -}} + {{/* For package with a group name, list all type definitions in it. */}} + {{- range .VisibleTypes }} + {{- if or .Referenced .IsExported -}} +{{ template "type" . }} + {{- end -}} + {{ end }} + {{ else }} + {{/* For package w/o group name, list only types referenced. */}} + {{ $isConfig := (eq .GroupName "") }} + {{- range .VisibleTypes -}} + {{- if or .Referenced $isConfig -}} +{{ template "type" . }} + {{- end -}} + {{- end }} + {{- end }} +{{- end }} +{{- end }} diff --git a/site/genref/markdown/type.tpl b/site/genref/markdown/type.tpl new file mode 100644 index 0000000000..e8e7235893 --- /dev/null +++ b/site/genref/markdown/type.tpl @@ -0,0 +1,37 @@ +{{ define "type" }} + +## `{{ .Name.Name }}` {#{{ .Anchor }}} + +{{ if eq .Kind "Alias" -}} +(Alias of `{{ .Underlying }}`) +{{ end }} + +{{- with .References }} +**Appears in:** +{{ range . }} +{{ if or .Referenced .IsExported -}} +- [{{ .DisplayName }}]({{ .Link }}) +{{ end -}} +{{- end -}} +{{- end }} + +{{ if .GetComment -}} +{{ .GetComment }} +{{ end }} +{{ if .GetMembers -}} + + + + {{/* . is a apiType */}} + {{- if .IsExported -}} +{{/* Add apiVersion and kind rows if deemed necessary */}} + + + {{ end -}} + +{{/* The actual list of members is in the following template */}} +{{- template "members" . -}} + +
FieldDescription
apiVersion
string
{{- .APIGroup -}}
kind
string
{{- .Name.Name -}}
+{{- end -}} +{{- end -}}