Skip to content

Commit

Permalink
Keep the visibility-apf for v1 as opt-in.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbobrovskyi committed Jan 28, 2025
1 parent be9696e commit eee2e4c
Show file tree
Hide file tree
Showing 17 changed files with 80 additions and 28 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ artifacts: kustomize yq helm ## Generate release artifacts.
$(KUSTOMIZE) build config/dev -o artifacts/manifests-dev.yaml
$(KUSTOMIZE) build config/alpha-enabled -o artifacts/manifests-alpha-enabled.yaml
$(KUSTOMIZE) build config/prometheus -o artifacts/prometheus.yaml
$(KUSTOMIZE) build config/visibility-apf -o artifacts/visibility-apf.yaml
@$(call clean-manifests)
# Update the image tag and policy
$(YQ) e '.controllerManager.manager.image.repository = "$(IMAGE_REPO)" | .controllerManager.manager.image.tag = "$(GIT_TAG)" | .controllerManager.manager.image.pullPolicy = "IfNotPresent"' -i charts/kueue/values.yaml
Expand Down
1 change: 1 addition & 0 deletions charts/kueue/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ The following table lists the configurable parameters of the kueue chart and the
| `fullnameOverride` | override the resource name | `` |
| `enablePrometheus` | enable Prometheus | `false` |
| `enableCertManager` | enable CertManager | `false` |
| `enableVisibilityAPF` | enable APF for the visibility API | `false` |
| `controllerManager.manager.image.repository` | controllerManager.manager's repository and image | `us-central1-docker.pkg.dev/k8s-staging-images/kueue/kueue` |
| `controllerManager.manager.image.tag` | controllerManager.manager's tag | `main` |
| `controllerManager.manager.resources` | controllerManager.manager's resources | abbr. |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.enableVisibilityAPF }}
apiVersion: flowcontrol.apiserver.k8s.io/v1
kind: FlowSchema
metadata:
Expand Down Expand Up @@ -29,3 +30,4 @@ spec:
- group:
name: system:authenticated
kind: Group
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.enableVisibilityAPF }}
apiVersion: flowcontrol.apiserver.k8s.io/v1
kind: PriorityLevelConfiguration
metadata:
Expand All @@ -16,3 +17,4 @@ spec:
type: Queue
nominalConcurrencyShares: 10
type: Limited
{{- end }}
2 changes: 2 additions & 0 deletions charts/kueue/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ fullnameOverride: ""
enablePrometheus: false
# Enable x509 automated certificate management using cert-manager (cert-manager.io)
enableCertManager: false
# Enable API Priority and Fairness configuration for the visibility API
enableVisibilityAPF: false
# Customize controllerManager
controllerManager:
#featureGates:
Expand Down
3 changes: 3 additions & 0 deletions config/components/visibility-apf/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resources:
- flowschema.yaml
- prioritylevelconfigurations.yaml
2 changes: 0 additions & 2 deletions config/components/visibility/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ resources:
- apiservice_v1beta1.yaml
- role_binding.yaml
- service.yaml
- flowschema.yaml
- prioritylevelconfigurations.yaml
14 changes: 14 additions & 0 deletions config/visibility-apf/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This overlay builds the APF components to be used in combination
# with other overlays.

namespace: kueue-system
namePrefix: kueue-

labels:
- pairs:
app.kubernetes.io/name: kueue
app.kubernetes.io/component: controller
control-plane: controller-manager

resources:
- ../components/visibility-apf/
17 changes: 17 additions & 0 deletions hack/update-helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ SRC_CRD_DIR=config/components/crd/bases
SRC_RBAC_DIR=config/components/rbac
SRC_WEBHOOK_DIR=config/components/webhook
SRC_VISIBILITY_DIR=config/components/visibility
SRC_VISIBILITY_APF_DIR=config/components/visibility-apf

DEST_CRD_DIR=charts/kueue/templates/crd
DEST_RBAC_DIR=charts/kueue/templates/rbac
DEST_WEBHOOK_DIR=charts/kueue/templates/webhook
DEST_VISIBILITY_DIR=charts/kueue/templates/visibility
DEST_VISIBILITY_APF_DIR=charts/kueue/templates/visibility-apf

YQ=./bin/yq
SED=${SED:-/usr/bin/sed}
Expand All @@ -48,6 +50,8 @@ find $SRC_RBAC_DIR -name "*.yaml" $EXCLUDE_FILES_ARGS -exec cp "{}" $DEST_RBAC_D
find $SRC_WEBHOOK_DIR -name "*.yaml" $EXCLUDE_FILES_ARGS -exec cp "{}" $DEST_WEBHOOK_DIR \;
# shellcheck disable=SC2086
find $SRC_VISIBILITY_DIR -name "*.yaml" $EXCLUDE_FILES_ARGS -exec cp "{}" $DEST_VISIBILITY_DIR \;
# shellcheck disable=SC2086
find $SRC_VISIBILITY_APF_DIR -name "*.yaml" $EXCLUDE_FILES_ARGS -exec cp "{}" $DEST_VISIBILITY_APF_DIR \;
$YQ -N -s '.kind' ${DEST_WEBHOOK_DIR}/manifests.yaml
rm ${DEST_WEBHOOK_DIR}/manifests.yaml
files=("MutatingWebhookConfiguration.yml" "ValidatingWebhookConfiguration.yml")
Expand Down Expand Up @@ -343,3 +347,16 @@ EOT
fi
$SED -i '/^metadata:.*/a\ labels:\n {{- include "kueue.labels" . | nindent 4 }}' "$output_file"
done

# Replace flowcontrol version on visibility-apf directory
for output_file in "${DEST_VISIBILITY_APF_DIR}"/*.yaml; do
$YQ -N -i '.metadata.name |= "{{ include \"kueue.fullname\" . }}-" + .' "$output_file"
$YQ -N -i '.metadata.namespace = "{{ .Release.Namespace }}"' "$output_file"
$SED -i '/^metadata:.*/a\ labels:\n {{- include "kueue.labels" . | nindent 4 }}' "$output_file"
{
echo '{{- if .Values.enableVisibilityAPF }}'
cat "$output_file"
echo "{{- end }}"
} > "${output_file}.tmp"
mv "${output_file}.tmp" "${output_file}"
done
5 changes: 5 additions & 0 deletions site/content/en/docs/installation/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ description: >
- [Before you begin](#before-you-begin)
- [Install a released version](#install-a-released-version)
- [Add metrics scraping for prometheus-operator](#add-metrics-scraping-for-prometheus-operator)
- [Add API Priority and Fairness configuration for the visibility API](#add-api-priority-and-fairness-configuration-for-the-visibility-api)
- [Uninstall](#uninstall)
- [Install a custom-configured released version](#install-a-custom-configured-released-version)
- [Install the latest development version](#install-the-latest-development-version)
Expand Down Expand Up @@ -76,6 +77,10 @@ We can follow `https://prometheus-operator.dev/docs/prologue/quick-start/` to in
kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases/download/{{< param "version" >}}/prometheus.yaml
```

### Add API Priority and Fairness configuration for the visibility API

See [Configure API Priority and Fairness](/docs/tasks/manage/monitor_pending_workloads/pending_workloads_on_demand/#configure-api-priority-and-fairness) for more details.

### Uninstall

To uninstall a released version of Kueue from your cluster, run the following command:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ Make sure the following conditions are met:
- The kubectl command-line tool has communication with your cluster.
- [Kueue is installed](/docs/installation) in version v0.6.0 or later.

### Configure API Priority and Fairness:

To install the [API Priority and Fairness](https://kubernetes.io/docs/concepts/cluster-administration/flow-control/) configuration for the visibility API apply manifests:

```shell
kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases/download/{{< param "version" >}}/visibility-apf.yaml
```

### Directly accessing the Visibility API

If you want to directly access the Visibility API with a http client like
Expand Down
25 changes: 0 additions & 25 deletions test/e2e/config/common/kustomization.yaml

This file was deleted.

26 changes: 25 additions & 1 deletion test/e2e/config/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,26 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../common
- ../../../../config/dev
- ../../../../config/visibility-apf

replicas:
- name: kueue-controller-manager
count: 2

patches:
- path: manager_e2e_patch.yaml
target:
group: apps
version: v1
kind: Deployment
name: kueue-controller-manager
namespace: kueue-system

configMapGenerator:
- behavior: merge
files:
- controller_manager_config.yaml
name: kueue-manager-config
namespace: kueue-system

0 comments on commit eee2e4c

Please sign in to comment.