#helm - September 2019

helmArchived
50 messages

Archive: https://archive.sweetops.com/helm/

September 2019
Ryan Smith
Ryan Smithabout 7 years ago
tricky question
Ryan Smith
Ryan Smithabout 7 years ago
but I'm sure you peeps have an answer already...
Ryan Smith
Ryan Smithabout 7 years ago
what if I have legacy k8s artifacts.. (deployments, services, cronjobs)
Ryan Smith
Ryan Smithabout 7 years ago
but I want to import them into helm state
Ryan Smith
Ryan Smithabout 7 years ago
use case: migrate old circle-ci workflow -> new ci/cd tool using helm/helmfile
Ryan Smith
Ryan Smithabout 7 years ago
(old circle-ci workflow would just update docker image in place for all the artifacts)
Ryan Smith
Ryan Smithabout 7 years ago
i'm trying not to create new deployments/services since that would create new ALBs/Route53
Ryan Smith
Ryan Smithabout 7 years ago
i mean.. if I have to, I will
Ryan Smith
Ryan Smithabout 7 years ago
.. but just trying to make a seamless transition
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
use raw chart?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
+ helmfile
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
😃
Ryan Smith
Ryan Smithabout 7 years ago
🤷‍♂️
Ryan Smith
Ryan Smithabout 7 years ago
lemme see what raw does
Ryan Smith
Ryan Smithabout 7 years ago
lol 😅
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
We have a bunch of examples here
Ryan Smith
Ryan Smithabout 7 years ago
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
Ryan Smith
Ryan Smithabout 7 years ago
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
Ryan Smith
Ryan Smithabout 7 years ago
raw chart is super interesting though
Ryan Smith
Ryan Smithabout 7 years ago(edited)
still looking at it
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago(edited)
use yq or jq to strip the namespace from the kubectl get export
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
you'll also want to strip a few other things when exporting the resources
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
i guess i'm struggling with seeing the part you're concerned about 😃
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago(edited)
1. exporting resources with kubectl get - easy
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
2. stripping metadata like namespace - easy
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
3. using the raw chart with helmfile - easy
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
ohhh
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
sounds like you want to do more than just import the existing state
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
sounds like you want to parameterize the Deployment name too
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
that's a slippery slope. at that point, you're not really "importing" the existing state which the raw chart would help you do.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
hopefully deploying to multiple namespaces is sufficiently parametetrized
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
if you need to do more than that, i would either (a) write a helm chart (b) use the monochart
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
have you seen the monochart?
Ryan Smith
Ryan Smithabout 7 years ago
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
Ryan Smith
Ryan Smithabout 7 years ago
Ryan Smith
Ryan Smithabout 7 years ago
this is more a long the lines of my concern
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
Aha ya, guess that part may be messy
Ryan Smith
Ryan Smithabout 7 years ago
I see there are proposals for import like terraform import, but yeah
Ryan Smith
Ryan Smithabout 7 years ago
heh, no worries
Ryan Smith
Ryan Smithabout 7 years ago
curious if I can just rebuild the state and pop in the ConfigMap.. and register it somehow.. then have it detected by helm ls
Ryan Smith
Ryan Smithabout 7 years ago
🤔
Ruan Arcega
Ruan Arcegaabout 7 years ago
Ryan Smith
Ryan Smithabout 7 years ago
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...
Ryan Smith
Ryan Smithabout 7 years ago
https://gist.github.com/rms1000watt/3d76eb2f3c64a87b92acb97ebdbd9c66 helm dark arts.. helm ls now says DEPLOYED.. lets see if I can deploy again without failure
Ryan Smith
Ryan Smithabout 7 years ago
sweet.. helmfile apply works fine now
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
wow, you went deep down that rabbit hole
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
🐰
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
that's a cool trick