#helm (2019-09)
Archive: https://archive.sweetops.com/helm/
2019-09-03

tricky question

but I’m sure you peeps have an answer already…

what if I have legacy k8s artifacts.. (deployments, services, cronjobs)

but I want to import them into helm state

use case: migrate old circle-ci workflow -> new ci/cd tool using helm/helmfile

(old circle-ci workflow would just update docker image in place for all the artifacts)

i’m trying not to create new deployments/services since that would create new ALBs/Route53

i mean.. if I have to, I will

.. but just trying to make a seamless transition

use raw
chart?

helmfile



lemme see what raw
does

lol

We have a bunch of examples here

Comprehensive Distribution of Helmfiles. Works with helmfile.d
- cloudposse/helmfiles

Hmm, I mean, i’m less concerned about making the helm charts/helmfiles. I just kubectl get deployment blah -o yaml
and created charts for everything

it’s just if I do a helmfile apply
and the deployment name of blah
is already taken, helm won’t deploy it.. and not keep track of it in helm state

raw chart is super interesting though

still looking at it

use yq
or jq
to strip the namespace from the kubectl get
export

you’ll also want to strip a few other things when exporting the resources

i guess i’m struggling with seeing the part you’re concerned about

- exporting resources with
kubectl get
- easy

- stripping metadata like
namespace
- easy

- using the
raw
chart withhelmfile
- easy

ohhh

sounds like you want to do more than just import the existing state

sounds like you want to parameterize the Deployment
name too

that’s a slippery slope. at that point, you’re not really “importing” the existing state which the raw
chart would help you do.

hopefully deploying to multiple namespaces is sufficiently parametetrized

if you need to do more than that, i would either (a) write a helm chart (b) use the monochart

have you seen the monochart
?

Yeah, monochart
is awesome. But yeah, I’m totally not worried about creating helm charts or helmfiles.
It’s just when I run helmfile apply
it fails because it says deployment hello-world-dev
already exists

Hi Helm experts, We're running a system which is using Ansible to do Kubernetes resource deployment, and we want to run an upgrade to change the Kubernetes resources deployment to be under helm…

this is more a long the lines of my concern

Aha ya, guess that part may be messy

I see there are proposals for import like terraform import
, but yeah

heh, no worries

curious if I can just rebuild the state and pop in the ConfigMap.. and register it somehow.. then have it detected by helm ls



i guess, running tiller in localhost not have issue with security any suggestions about it?

https://github.com/helm/helm/blob/master/_proto/hapi/release/status.proto#L31 hhmmmm
kubectl -n kube-system get cm hello-world.v1 -o yaml | grep release | cut -d' ' -f4 | base64 -D | gunzip
I think the first section is protobuf.. just gotta flip the right byte…
The Kubernetes Package Manager. Contribute to helm/helm development by creating an account on GitHub.

There’s a known/fixed bug with helm. Sometimes it might get stuck in PENDING_UPDATE causing further helm upgrades to fail

https://gist.github.com/rms1000watt/3d76eb2f3c64a87b92acb97ebdbd9c66 helm dark arts.. helm ls
now says DEPLOYED
.. lets see if I can deploy again without failure

sweet.. helmfile apply works fine now

Yeah! That was amazing I’ve forked your gist, thanks

wow, you went deep down that rabbit hole


that’s a cool trick