From 2e426c349139538079c4b77c402313d6c4d36aed Mon Sep 17 00:00:00 2001 From: Traian Schiau Date: Fri, 7 Jul 2023 16:27:04 +0300 Subject: [PATCH] [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 --- Makefile | 10 +++++++-- charts/kueue/values.yaml | 22 +++++++------------- config/components/manager/kustomization.yaml | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 969504660f..8a86df559d 100644 --- a/Makefile +++ b/Makefile @@ -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) @@ -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)))) diff --git a/charts/kueue/values.yaml b/charts/kueue/values.yaml index 3a1f5e54da..48731518c4 100644 --- a/charts/kueue/values.yaml +++ b/charts/kueue/values.yaml @@ -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 @@ -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: |- @@ -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 diff --git a/config/components/manager/kustomization.yaml b/config/components/manager/kustomization.yaml index 0a4156f213..b7b7487da3 100644 --- a/config/components/manager/kustomization.yaml +++ b/config/components/manager/kustomization.yaml @@ -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: