Skip to content

Commit

Permalink
[artifacts] Add helm package (#956)
Browse files Browse the repository at this point in the history
* [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
  • Loading branch information
trasc authored Jul 7, 2023
1 parent 07fa280 commit 2e426c3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ DOCKER_BUILDX_CMD ?= docker buildx
IMAGE_BUILD_CMD ?= $(DOCKER_BUILDX_CMD) build
IMAGE_BUILD_EXTRA_OPTS ?=
# TODO(#52): Add kueue to k8s gcr registry
IMAGE_REGISTRY ?= gcr.io/k8s-staging-kueue
STAGING_IMAGE_REGISTRY := gcr.io/k8s-staging-kueue
IMAGE_REGISTRY ?= $(STAGING_IMAGE_REGISTRY)
IMAGE_NAME := kueue
IMAGE_REPO ?= $(IMAGE_REGISTRY)/$(IMAGE_NAME)
IMAGE_TAG ?= $(IMAGE_REPO):$(GIT_TAG)
Expand Down Expand Up @@ -258,7 +259,12 @@ artifacts: kustomize
$(KUSTOMIZE) build config/dev -o artifacts/manifests-dev.yaml
$(KUSTOMIZE) build config/prometheus -o artifacts/prometheus.yaml
@$(call clean-manifests)
cp -r charts artifacts/charts
# 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
# create the package. TODO: consider signing it
helm package --version $(GIT_TAG) --app-version $(GIT_TAG) charts/kueue -d artifacts/
# Revert the image changes
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

##@ Tools
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
Expand Down
22 changes: 8 additions & 14 deletions charts/kueue/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
# Declare variables to be passed into your templates.
nameOverride: ""
fullnameOverride: ""

# Enable each function, like kustomize https://github.com/kubernetes-sigs/kueue/blob/main/config/default/kustomization.yaml
enablePrometheus: false

# Enable x509 automated certificate management using cert-manager (cert-manager.io)
enableCertManager: false

# Customize controlerManager
controllerManager:
kubeRbacProxy:
image:
image:
repository: gcr.io/kubebuilder/kube-rbac-proxy
# tag
tag: v0.8.0
Expand All @@ -39,9 +36,7 @@ controllerManager:
allowPrivilegeEscalation: false
replicas: 1
imagePullSecrets: []

kubernetesClusterDomain: cluster.local

# controller_manager_config.yaml. controllerManager utilizes this yaml via manager-config Configmap.
managerConfig:
controllerManagerConfigYaml: |-
Expand Down Expand Up @@ -78,18 +73,17 @@ managerConfig:
- "batch/job"
- "kubeflow.org/mpijob"
- "ray.io/rayjob"
# ports definition for metricsService and webhookService.
metricsService:
ports:
- name: https
port: 8443
protocol: TCP
targetPort: https
- name: https
port: 8443
protocol: TCP
targetPort: https
type: ClusterIP
webhookService:
ports:
- port: 443
protocol: TCP
targetPort: 9443
- port: 443
protocol: TCP
targetPort: 9443
type: ClusterIP
4 changes: 2 additions & 2 deletions config/components/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Comment the "auth_proxy_service.yaml" entry if you want to disable the service
# for auth proxy (https://github.com/brancz/kube-rbac-proxy)
resources:
- manager.yaml
# Comment this line if you want to disable the service for auth proxy (https://github.com/brancz/kube-rbac-proxy)
# which protects your /metrics endpoint.
- auth_proxy_service.yaml

generatorOptions:
Expand Down

0 comments on commit 2e426c3

Please sign in to comment.