https://pulumi.com logo
#general
Title
# general
r

rhythmic-hair-33677

12/06/2019, 7:47 PM
What’s the best way to patch a kubernetes service account? I don’t really wish to manage it completely. i.e. to replace this shell command:
Copy code
kubectl patch serviceaccount default -p '{"imagePullSecrets": [{"name": "registry-pull-secret"}]}' -n openfaas-fn
g

gorgeous-egg-16927

12/06/2019, 8:06 PM
If you don’t want to import the resource and manage it with Pulumi, you could make the change in one of the following ways: 1. use the JS k8s client to make the API call from within your pulumi program 2. shell out to kubectl from the pulumi program We’ve got https://github.com/pulumi/pulumi-kubernetes/issues/264 open to track improving this workflow
m

mysterious-egg-7415

12/06/2019, 8:09 PM
Instead of patching the service account to contain the
imagePullSecrets
, why not make a
Secret
and configure the Pod to use it: <https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/>
👍 1
r

rhythmic-hair-33677

12/06/2019, 8:32 PM
Thank you these are good solutions.