From f02633715bceba1f3aaef5275ba887a6311c5a18 Mon Sep 17 00:00:00 2001 From: Jon Edvald Date: Fri, 27 Sep 2019 18:43:53 +0200 Subject: [PATCH] fix(k8s): don't install NFS provisioner when sync storage class is set --- garden-service/src/plugins/kubernetes/init.ts | 15 ++++++++++++++- .../kubernetes/system/build-sync/garden.yml | 6 ++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/garden-service/src/plugins/kubernetes/init.ts b/garden-service/src/plugins/kubernetes/init.ts index 1fba40b838..c883fa93cb 100644 --- a/garden-service/src/plugins/kubernetes/init.ts +++ b/garden-service/src/plugins/kubernetes/init.ts @@ -201,6 +201,19 @@ export async function prepareSystem( await installTiller({ ctx: sysCtx, provider: sysCtx.provider, log, force }) + // We need to install the NFS provisioner separately, so that we can optionally install it + // FIXME: when we've added an `enabled` field, we should get rid of this special case + if (systemServiceNames.includes("nfs-provisioner")) { + await prepareSystemServices({ + log, + sysGarden, + namespace: systemNamespace, + force, + ctx: k8sCtx, + serviceNames: ["nfs-provisioner"], + }) + } + // Install system services await prepareSystemServices({ log, @@ -208,7 +221,7 @@ export async function prepareSystem( namespace: systemNamespace, force, ctx: k8sCtx, - serviceNames: systemServiceNames, + serviceNames: systemServiceNames.filter(name => name !== "nfs-provisioner"), }) sysGarden.log.setSuccess() diff --git a/garden-service/static/kubernetes/system/build-sync/garden.yml b/garden-service/static/kubernetes/system/build-sync/garden.yml index adddef091a..b87d9cadd5 100644 --- a/garden-service/static/kubernetes/system/build-sync/garden.yml +++ b/garden-service/static/kubernetes/system/build-sync/garden.yml @@ -3,8 +3,10 @@ type: helm name: build-sync description: Sync service for receiving build context ahead of in-cluster builds releaseName: garden-build-sync -dependencies: - - nfs-provisioner +# Note: We special-case this dependency in the cluster-init procedure, +# to be fixed when the `enabled` field is implemented +# dependencies: +# - nfs-provisioner values: resources: limits: