Skip to content

Commit 2e426c3

Browse files
authored
[artifacts] Add helm package (#956)
* [manifests] Fix format Keep the same format used by `kustomize` and `yq` to avoid marking the tree as dirty after `kustomize edit` and similar tasks. * [makefile] Package the charts in artifacts
1 parent 07fa280 commit 2e426c3

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ DOCKER_BUILDX_CMD ?= docker buildx
3535
IMAGE_BUILD_CMD ?= $(DOCKER_BUILDX_CMD) build
3636
IMAGE_BUILD_EXTRA_OPTS ?=
3737
# TODO(#52): Add kueue to k8s gcr registry
38-
IMAGE_REGISTRY ?= gcr.io/k8s-staging-kueue
38+
STAGING_IMAGE_REGISTRY := gcr.io/k8s-staging-kueue
39+
IMAGE_REGISTRY ?= $(STAGING_IMAGE_REGISTRY)
3940
IMAGE_NAME := kueue
4041
IMAGE_REPO ?= $(IMAGE_REGISTRY)/$(IMAGE_NAME)
4142
IMAGE_TAG ?= $(IMAGE_REPO):$(GIT_TAG)
@@ -258,7 +259,12 @@ artifacts: kustomize
258259
$(KUSTOMIZE) build config/dev -o artifacts/manifests-dev.yaml
259260
$(KUSTOMIZE) build config/prometheus -o artifacts/prometheus.yaml
260261
@$(call clean-manifests)
261-
cp -r charts artifacts/charts
262+
# Update the image tag and policy
263+
yq e '.controllerManager.manager.image.repository = "$(IMAGE_REPO)" | .controllerManager.manager.image.tag = "$(GIT_TAG)" | .controllerManager.manager.image.pullPolicy = "IfNotPresent"' -i charts/kueue/values.yaml
264+
# create the package. TODO: consider signing it
265+
helm package --version $(GIT_TAG) --app-version $(GIT_TAG) charts/kueue -d artifacts/
266+
# Revert the image changes
267+
yq e '.controllerManager.manager.image.repository = "$(STAGING_IMAGE_REGISTRY)/$(IMAGE_NAME)" | .controllerManager.manager.image.tag = "main" | .controllerManager.manager.image.pullPolicy = "Always"' -i charts/kueue/values.yaml
262268

263269
##@ Tools
264270
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))

charts/kueue/values.yaml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@
33
# Declare variables to be passed into your templates.
44
nameOverride: ""
55
fullnameOverride: ""
6-
76
# Enable each function, like kustomize https://github.com/kubernetes-sigs/kueue/blob/main/config/default/kustomization.yaml
87
enablePrometheus: false
9-
108
# Enable x509 automated certificate management using cert-manager (cert-manager.io)
119
enableCertManager: false
12-
1310
# Customize controlerManager
1411
controllerManager:
1512
kubeRbacProxy:
16-
image:
13+
image:
1714
repository: gcr.io/kubebuilder/kube-rbac-proxy
1815
# tag
1916
tag: v0.8.0
@@ -39,9 +36,7 @@ controllerManager:
3936
allowPrivilegeEscalation: false
4037
replicas: 1
4138
imagePullSecrets: []
42-
4339
kubernetesClusterDomain: cluster.local
44-
4540
# controller_manager_config.yaml. controllerManager utilizes this yaml via manager-config Configmap.
4641
managerConfig:
4742
controllerManagerConfigYaml: |-
@@ -78,18 +73,17 @@ managerConfig:
7873
- "batch/job"
7974
- "kubeflow.org/mpijob"
8075
- "ray.io/rayjob"
81-
8276
# ports definition for metricsService and webhookService.
8377
metricsService:
8478
ports:
85-
- name: https
86-
port: 8443
87-
protocol: TCP
88-
targetPort: https
79+
- name: https
80+
port: 8443
81+
protocol: TCP
82+
targetPort: https
8983
type: ClusterIP
9084
webhookService:
9185
ports:
92-
- port: 443
93-
protocol: TCP
94-
targetPort: 9443
86+
- port: 443
87+
protocol: TCP
88+
targetPort: 9443
9589
type: ClusterIP

config/components/manager/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
# Comment the "auth_proxy_service.yaml" entry if you want to disable the service
2+
# for auth proxy (https://github.com/brancz/kube-rbac-proxy)
13
resources:
24
- manager.yaml
3-
# Comment this line if you want to disable the service for auth proxy (https://github.com/brancz/kube-rbac-proxy)
4-
# which protects your /metrics endpoint.
55
- auth_proxy_service.yaml
66

77
generatorOptions:

0 commit comments

Comments
 (0)