datopian / ckan-cloud-operator

CKAN Cloud operator manages, provisions and configures Ckan Cloud instances and related infrastructure.
MIT License
19 stars 14 forks source link

Upgrade to helm3 #139

Closed zelima closed 3 years ago

zelima commented 3 years ago

Helm 2 is currently in its last phase of active development and only receiving security patches from the open-source community. On 13 November 2020, Helm 2 will be completely unsupported, including all security patches and removal of all assets such as open-source charts and binaries which use Helm 2. Any Helm 2 usage will be impacted starting 13 November 2020 as both the Tiller image and the default chart repositories will be removed.

Although Helm v3.0 supports v1.16.x, as soon as it is no longer supported in our region (6 months, maybe?), we will need to upgrade to Helm v3.1.x or greater in order for use with K8s v1.17.x.

Our Kubernetes clusters are currently at 1.16.10 and no longer supported in our region. The oldest K8s that is supported in Azure is v1.16.13, Additionally there is a v1.16.15, v1.17.9 and v1.17.11 that are available and supported in our region.

Acceptance Criteria

Tasks

Analysis

I need an environment to work with and sbx is an ideal candidate for that I think. I've tried up there and deployed the application using helm2 making myself sure that I have a working code. It's a bit hard to track down where is the helm entry point in cco so I'm gonna bluntly change the helm version and trace it by fixing errors. The first error message is expected and quite promising. Hope the rest will be similar. For now, It simply complains about --tiller-namespace that is non-supported flag in helm3

2020-11-20 13:15 INFO Running helm upgrade --dry-run
Error: unknown flag: --tiller-namespace
helm.go:75: [debug] unknown flag: --tiller-namespace

OK, so simply removing --tiller-namespace from command did not help. Next error message looks scary

Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: [unknown object type "nil" in Secret.data.jwt-rs256.key, unknown object type "nil" in Secret.data.jwt-rs256.key.pub]
helm.go:75: [debug] error validating "": error validating data: [unknown object type "nil" in Secret.data.jwt-rs256.key, unknown object type "nil" in Secret.data.jwt-rs256.key.pub]
helm.sh/helm/v3/pkg/kube.scrubValidationError
    /home/circleci/helm.sh/helm/pkg/kube/client.go:542
helm.sh/helm/v3/pkg/kube.(*Client).Build
    /home/circleci/helm.sh/helm/pkg/kube/client.go:149
helm.sh/helm/v3/pkg/action.(*Install).Run
    /home/circleci/helm.sh/helm/pkg/action/install.go:245
main.runInstall
    /home/circleci/helm.sh/helm/cmd/helm/install.go:223
main.newUpgradeCmd.func1
    /home/circleci/helm.sh/helm/cmd/helm/upgrade.go:114
github.com/spf13/cobra.(*Command).execute
    /go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:826
github.com/spf13/cobra.(*Command).ExecuteC
    /go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:914
github.com/spf13/cobra.(*Command).Execute
    /go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:864
main.main
    /home/circleci/helm.sh/helm/cmd/helm/helm.go:74
runtime.main
    /usr/local/go/src/runtime/proc.go:203
runtime.goexit
    /usr/local/go/src/runtime/asm_amd64.s:1357
unable to build kubernetes objects from release manifest
helm.sh/helm/v3/pkg/action.(*Install).Run
    /home/circleci/helm.sh/helm/pkg/action/install.go:247
main.runInstall
    /home/circleci/helm.sh/helm/cmd/helm/install.go:223
main.newUpgradeCmd.func1
    /home/circleci/helm.sh/helm/cmd/helm/upgrade.go:114
github.com/spf13/cobra.(*Command).execute
    /go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:826
github.com/spf13/cobra.(*Command).ExecuteC
    /go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:914
github.com/spf13/cobra.(*Command).Execute
    /go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:864
main.main
    /home/circleci/helm.sh/helm/cmd/helm/helm.go:74
runtime.main
    /usr/local/go/src/runtime/proc.go:203
runtime.goexit
    /usr/local/go/src/runtime/asm_amd64.s:1357
zelima commented 3 years ago

FIXED