#helm (2019-09)

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

2019-09-03

rms1000watt avatar
rms1000watt

tricky question

rms1000watt avatar
rms1000watt

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

rms1000watt avatar
rms1000watt

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

rms1000watt avatar
rms1000watt

but I want to import them into helm state

rms1000watt avatar
rms1000watt

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

rms1000watt avatar
rms1000watt

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

rms1000watt avatar
rms1000watt

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

rms1000watt avatar
rms1000watt

i mean.. if I have to, I will

rms1000watt avatar
rms1000watt

.. but just trying to make a seamless transition

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

use raw chart?

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
  • helmfile
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

rms1000watt avatar
rms1000watt

rms1000watt avatar
rms1000watt

lemme see what raw does

rms1000watt avatar
rms1000watt

lol

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

We have a bunch of examples here

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
cloudposse/helmfiles

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

rms1000watt avatar
rms1000watt

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

rms1000watt avatar
rms1000watt

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

rms1000watt avatar
rms1000watt

raw chart is super interesting though

rms1000watt avatar
rms1000watt

still looking at it

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

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

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

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

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

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

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
  1. exporting resources with kubectl get - easy
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
  1. stripping metadata like namespace - easy
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
  1. using the raw chart with helmfile - easy
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

ohhh

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

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

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

sounds like you want to parameterize the Deployment name too

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

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) avatar
Erik Osterman (Cloud Posse)

hopefully deploying to multiple namespaces is sufficiently parametetrized

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

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

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

have you seen the monochart?

rms1000watt avatar
rms1000watt

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

rms1000watt avatar
rms1000watt
How to upgrade from a helm-less system to a helm controlled system · Issue #1999 · helm/helm

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…

rms1000watt avatar
rms1000watt

this is more a long the lines of my concern

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Aha ya, guess that part may be messy

rms1000watt avatar
rms1000watt

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

rms1000watt avatar
rms1000watt

heh, no worries

rms1000watt avatar
rms1000watt

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

rms1000watt avatar
rms1000watt

ruan.arcega avatar
ruan.arcega
ruan.arcega avatar
ruan.arcega

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

rms1000watt avatar
rms1000watt

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…

helm/helm

The Kubernetes Package Manager. Contribute to helm/helm development by creating an account on GitHub.

rms1000watt avatar
rms1000watt
Helm: stuck in “pending_update” and how to fix it

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

rms1000watt avatar
rms1000watt

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

1
rms1000watt avatar
rms1000watt

sweet.. helmfile apply works fine now

s2504s avatar

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

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

wow, you went deep down that rabbit hole

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

3
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

that’s a cool trick

    keyboard_arrow_up