Skip to content

Commit

Permalink
fix(k8s): deploy util service if using kaniko (#1963)
Browse files Browse the repository at this point in the history
The util service was only being deployed if we were using an external registry. However kaniko works fine with an in-cluster registry, and kaniko requires the util service.

Fixes #1962
  • Loading branch information
ThisGuyCodes authored Jul 29, 2020
1 parent f4cd7e6 commit 42203bb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions garden-service/src/plugins/kubernetes/kubernetes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ export async function configureProvider({
if (config.buildMode === "cluster-docker" || config.buildMode === "kaniko") {
config._systemServices.push("build-sync")

if (!config.deploymentRegistry || config.deploymentRegistry.hostname === inClusterRegistryHostname) {
const usingInClusterRegistry =
!config.deploymentRegistry || config.deploymentRegistry.hostname === inClusterRegistryHostname

if (usingInClusterRegistry) {
// Deploy an in-cluster registry, unless otherwise specified.
// This is a special configuration, used in combination with the registry-proxy service,
// to make sure every node in the cluster can resolve the image from the registry we deploy in-cluster.
Expand All @@ -75,7 +78,10 @@ export async function configureProvider({
namespace: config.deploymentRegistry?.namespace || projectName,
}
config._systemServices.push("docker-registry", "registry-proxy")
} else {
}
if (!usingInClusterRegistry || config.buildMode === "kaniko") {
// If using an external registry we need the util service
// Also the kaniko buildMode needs the util service even if using an in-cluster registry
config._systemServices.push("util")
}

Expand Down

0 comments on commit 42203bb

Please sign in to comment.