Anyone using pulumi and kube to do CD, are you set...
# general
h
Anyone using pulumi and kube to do CD, are you setting the image inside pulumi and then running pulumi up from CI or are you using kubectl directly?
c
It would be hard to run
kubectl
directly, because we don’t generate YAML? Unless I’m missing something?
Because resources can have dependencies, so, we need to order them.
e.g., you must create a
Service
before you create a
StatefulSet
.
h
oh, I would use pulumi to set it up initially (outside of CI) and then use kubectl to change the image of the deployment
But it sounds like I should instead pipe the image sha in via config and have CI run a pulumi up?
c
hmmm.
I think I do not understand. 🙂
why not just declare the image you want inside the pulumi program?
h
Hrm, maybe I am missing something. So when I deploy, I tell it to use some image
c
yep.
h
Then when CI runs again, it uploads a new image
And I need to tell it to use that one
c
is this not just a PR that changes an image tag?
h
I want this to happen on every commit as part of merging to master
c
Hmm, so the app code is in the same directory as the pulumi code?
And you’re saying you’re doing a
docker build -t tberman/whatever:v0.3.0 ... && docker push ...
and you also want pulumi to update using that new tag
right?
h
yeah, I am using jib to create and push the builds (its a maven plugin), but the same idea applies
c
Ah, I don’t know maven/jib, BUT
take a look at the following.
h
That part shouldn’t matter, I have the images going into gcr
c
right ok
so whatever tag your using, as part of your build target, just run a
pulumi set config appImageTag $TAG
or something
and it should “just work”
h
makes sense
thats what I figured