What’s the best way to patch a kubernetes service ...
# general
r
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
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
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
Thank you these are good solutions.