Does defaultTarget work with Helm?
# 🌱|help-and-getting-started
i
I've set a defaultTarget to one of my pods in my helm chart deployment but for some reason Garden insists on syncing with the other pod. The two pods and container names in those pods are
rails
and
sidekiq
, respectively. The pods have the label
app.kubernetes.io/component
set with those same strings, as well. I have tried two defaultTarget configurations, one with the kind/name/containerName specified like so:
Copy code
defaultTarget:
    kind: Deployment
    name: rwgps-rails
    containerName: rails
And another one with a `podSelector`:
Copy code
defaultTarget:
    podSelector: #
      app.kubernetes.io/component: rails
      app.kubernetes.io/instance: rwgps
      app.kubernetes.io/name: rwgps
But in both circumstances, Garden seems to match the sidekiq pod and then try to connect to the rails container inside of it, which doesn't make sense. Any tips on this would be appreciated. Thanks!
c
Hi @important-raincoat-21572 thanks for reporting this. That shouldn't be the case, let me try to reproduce it.
i
Thanks! If there is anything that you would like me to try, I have some time today.
I think I fixed it! For some reason, reducing the podselector down to just the
component
, which is unique and adding a
containerName
it seems to be selecting the pod, although it isn't deploying in "sync mode"
Copy code
defaultTarget:
    podSelector:
      app.kubernetes.io/component: rails
    containerName: rails
So perhaps I was misunderstanding what the
podSelector
was actually doing
Hm, when I use the podSelector, the sync daemon setup doesn't seem to happen, when I use kind/name, it doesn't connect to the right pod.
After switching my action from being a remote source to local and pulling my helm chart from an OCI registry instead of leaving it to the spec.chart.path, things seem to be working. 🎉
It leads me to suspect there is something strange about how remote sources/actions work with helm that breaks sync.
hey sorry, got pulled into other things. I tried both kind/name/containerName and podSelector/containerName and they both had their own issues. The deployments are unique and have their own pods, correct.
I pivoted to using Skaffold and its code sync worked with no issues
unfortunately, it is a private bespoke Helm chart and I don't think my company would want to share it at this time
c
Makes sense. Well, happy you find a way to solve your issue. 🙂 Let us know if we can help with Garden in the future!
2 Views