-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(k8s): play nice with Helm 2 (Tiller) when users still need it
Users may need Tiller for non-Garden related reasons. We now no longer automatically remove Tiller from project namespaces (but we do for garden-system), and instead provide a command to do the cleanup and a prompt for the user to run it. NOTE: We need to update the 0.11 release notes to reflect this!
- Loading branch information
Showing
15 changed files
with
263 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
garden-service/src/plugins/kubernetes/commands/remove-tiller.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (C) 2018 Garden Technologies, Inc. <[email protected]> | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
import { PluginCommand } from "../../../types/plugin/command" | ||
import chalk from "chalk" | ||
import { KubernetesPluginContext } from "../config" | ||
import { getAppNamespace } from "../namespace" | ||
import { KubeApi } from "../api" | ||
import { removeTiller } from "../helm/tiller" | ||
|
||
export const removeTillerCmd: PluginCommand = { | ||
name: "remove-tiller", | ||
description: "Remove Tiller from project namespace.", | ||
|
||
title: () => { | ||
return `Removing Tiller from project namespace` | ||
}, | ||
|
||
handler: async ({ ctx, log }) => { | ||
const k8sCtx = <KubernetesPluginContext>ctx | ||
const api = await KubeApi.factory(log, k8sCtx.provider) | ||
const namespace = await getAppNamespace(ctx, log, k8sCtx.provider) | ||
|
||
await removeTiller(k8sCtx, api, namespace, log) | ||
|
||
log.info(chalk.green("\nDone!")) | ||
|
||
return { result: {} } | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.