serving
serving copied to clipboard
Set k8s default container label
TIL I learned about kubectl.kubernetes.io/default-container
https://kubernetes.io/docs/reference/labels-annotations-taints/#kubectl-kubernetes-io-default-container
The value of the annotation is the container name that is default for this Pod. For example, kubectl logs or kubectl exec without -c or --container flag will use this default container.
We should make the main/serving container the 'default' container for these purposes. When we create the deployment we can add this as a label onto the pod.
/good-first-issue
@dprotaso: This request has been marked as suitable for new contributors.
Please ensure the request meets the requirements listed here.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.
In response to this:
TIL I learned about
kubectl.kubernetes.io/default-containerhttps://kubernetes.io/docs/reference/labels-annotations-taints/#kubectl-kubernetes-io-default-container
The value of the annotation is the container name that is default for this Pod. For example, kubectl logs or kubectl exec without -c or --container flag will use this default container.
We should make the main/serving container the 'default' container for these purposes
/good-first-issue
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
Happy to work on it
/assign @jasonsmithio
This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.
/remove-lifecycle stale
@jasonsmithio hi, are you still working on this one?
Howdy,
Apologies, I completely forgot. Let me work on this and get it done before EOM.
Hi , @jasonsmithio is this issue being worked on? If not, i would love to take this.
@KapilSareen Go for it. I have been a bit backlogged on stuff and haven't been able to look at it. A great first issue so recommend it!
/assign
Hey @dprotaso @skonto , sorry for the basic question, but could you clarify or provide an example command that should be run after the requested change?
I'm a bit confused about whether you want to achieve this:
kubectl logs -n my-namespaceto get logs from the controller container
Or:
kubectl logs -n mynamespace -p mycontainerpodnameto retrieve logs from a specific pod?
I assume you meant the first option, since the second one seems unnecessary given that most pods have a single container. Let me know if I'm wrong!
Hey @dprotaso , any updates?
Hey @KapilSareen, would you mind if I take this issue? I'd have a PR ready. Thanks!
@KapilSareen there are more details in this KEP about how the feature works in K8s https://github.com/kubernetes/enhancements/blob/master/keps/sig-cli/2227-kubectl-default-container/README.md
@konstfish please try to avoid duplicate work by not picking up issues others are working on. Pairing is fine if you reach out to @KapilSareen and work on it together
Right sorry, I thought this Issue had gone stale & it's something I encountered earlier today. My progress is at https://github.com/knative/serving/compare/main...konstfish:serving:main if you could take a quick look over @KapilSareen
@konstfish I've reviewed your progress, and I think you're ready to open a PR. My progress is minimal so far.
Awesome, thanks! I'll add you as a contributor on my fork as well, there's most likely still some work to do on the tests/gating this feature behind a config.
/assign
Awesome, thanks! I'll add you as a contributor on my fork as well, there's most likely still some work to do on the tests/gating this feature behind a config.
Sounds great! Let me know if there's anything I can do to help. Let's move this to Slack. Can you ping me there, and we can plan things out.