https://pulumi.com logo
h

helpful-advantage-49286

01/10/2019, 12:32 AM
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

creamy-potato-29402

01/10/2019, 12:35 AM
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

helpful-advantage-49286

01/10/2019, 12:37 AM
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

creamy-potato-29402

01/10/2019, 12:40 AM
hmmm.
I think I do not understand. 🙂
why not just declare the image you want inside the pulumi program?
h

helpful-advantage-49286

01/10/2019, 12:42 AM
Hrm, maybe I am missing something. So when I deploy, I tell it to use some image
c

creamy-potato-29402

01/10/2019, 12:42 AM
yep.
h

helpful-advantage-49286

01/10/2019, 12:42 AM
Then when CI runs again, it uploads a new image
And I need to tell it to use that one
c

creamy-potato-29402

01/10/2019, 12:43 AM
is this not just a PR that changes an image tag?
h

helpful-advantage-49286

01/10/2019, 12:44 AM
I want this to happen on every commit as part of merging to master
c

creamy-potato-29402

01/10/2019, 12:45 AM
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

helpful-advantage-49286

01/10/2019, 12:46 AM
yeah, I am using jib to create and push the builds (its a maven plugin), but the same idea applies
c

creamy-potato-29402

01/10/2019, 12:46 AM
Ah, I don’t know maven/jib, BUT
take a look at the following.
h

helpful-advantage-49286

01/10/2019, 12:47 AM
That part shouldn’t matter, I have the images going into gcr
c

creamy-potato-29402

01/10/2019, 12:47 AM
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

helpful-advantage-49286

01/10/2019, 12:50 AM
makes sense
thats what I figured