Skip to content

Commit

Permalink
AUT-2125: Remove tiller usage
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcblanc committed Feb 21, 2024
1 parent 7da6976 commit 4e8c70c
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 26 deletions.
25 changes: 25 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Migration

## Helm v2 to v3

- [ ] Backup Helm2 releases for rollback
- [ ] Get list of releases `helm tiller run -- helm list`
- [ ] For each release, backup Chart + values

> Do we actually need backups???
> It seems that we could simply redeploy (rollback) with helm2 container
> Rollback would mean, cleaning up Helm v3 configs/secrets/deploys?
### Local cluster upgrade

- [ ] Install Helm3
- Update `/sv/scripts/install_helm.sh` to use Helm version `v3.14.0`
- Run `bash /sv/scripts/install_helm.sh`
- [ ] Install [helm-2to3](https://github.com/helm/helm-2to3) plugin
- `helm plugin install https://github.com/helm/helm-2to3.git`
- [ ] Migrate Helm2 to Helm3
- [ ] `helm 2to3 move config`
- [ ] `helm 2to3 convert sv-kube-proxy`
- [ ] `helm 2to3 convert sv-graphql`
- [ ] `helm 2to3 convert sv-geo`
- [ ] `helm 2to3 cleanup`
4 changes: 0 additions & 4 deletions internal/setupClusterHelm.sh

This file was deleted.

7 changes: 3 additions & 4 deletions scripts/install_helm.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
. /sv/scripts/errorHandler.sh
. /sv/scripts/variables.sh

helm_version=$(helm version --client --short 2> /dev/null || true)
helm_version_expected="Client: v2.17.0+ga690bad"
helm_version_current=$(helm version --client --short 2> /dev/null || true)

if [ "$helm_version" != "$helm_version_expected" ]; then
if ! [[ "$helm_version_current" =~ $helm_version ]]; then
apt-get update
apt-get install -y curl

cd /tmp
curl -Lo helm.tar.gz https://get.helm.sh/helm-v2.17.0-linux-${PLATFORM}.tar.gz
curl -Lo helm.tar.gz https://get.helm.sh/helm-${helm_version}-linux-${PLATFORM}.tar.gz
tar -zxvf helm.tar.gz
rm helm.tar.gz
mv linux-${PLATFORM}/helm /usr/bin/helm
Expand Down
17 changes: 0 additions & 17 deletions scripts/start_helm.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
. /sv/scripts/errorHandler.sh

helm_plugins=$(helm plugin list | grep tiller || true)

if [ -z "$helm_plugins" ]; then
helm init --tiller-image=jessestuart/tiller --upgrade --history-max=3

# install tiller for context switching [AUT-313]
helm plugin install https://github.com/rimusz/helm-tiller || true
fi

# install the binary necessary to run helm tiller run -- commands
if [ ! -f /root/.helm/plugins/helm-tiller/bin/tiller ]; then
docker create --name tiller jessestuart/tiller:v2.17.0 /bin/sh
mkdir -p /root/.helm/plugins/helm-tiller/bin
docker cp tiller:/tiller /root/.helm/plugins/helm-tiller/bin/
docker rm -fv tiller
fi

# ensure we're on the right repo
helm repo rm stable || true
helm repo add stable https://charts.helm.sh/stable
1 change: 1 addition & 0 deletions scripts/variables.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ docker_version="20.10.22"
docker_build_hash="3a2c30b"
docker_compose_version="2.5.0"
node_version="v16.20.2"
helm_version="v3.14.0"

# allocate the platform for the installers
. /sv/scripts/platform_lookup.sh
2 changes: 1 addition & 1 deletion sv/sv.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ scripts.stop = function(args) {

var applicationName = args.argv[0];

exec(`helm delete ${applicationName} --purge`);
exec(`helm uninstall ${applicationName}`);
}

scripts.logs = function(args) {
Expand Down

0 comments on commit 4e8c70c

Please sign in to comment.