Skip to content

Use a nicer command to tail pod logs #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

puneetsarna
Copy link
Contributor

@puneetsarna puneetsarna commented Feb 28, 2024

While what we have also works, labels is a nicer
way to select k8s objects.

nginx-loadbalancer-kubernetes $ kubectl -n nlk logs -f $(kubectl -n nlk get po -l "app=nlk" --no-headers -o custom-columns=":metadata.name")
time="2024-02-28T20:35:49Z" level=info msg="Settings::Initialize"
time="2024-02-28T20:35:49Z" level=info msg="Certificates::Initialize"
time="2024-02-28T20:35:49Z" level=info msg="Certificates::Run"
I0228 20:35:49.398213       1 shared_informer.go:273] Waiting for caches to sync for nlk-handler
I0228 20:35:49.500005       1 shared_informer.go:280] Caches are synced for nlk-handler

Proposed changes

Describe the use case and detail of the change. If this PR addresses an issue on GitHub, make sure to include a link to that issue using one of the supported keywords here in this description (not in the title of the PR).

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • I have updated any relevant documentation (README.md and CHANGELOG.md)

While what we have also works, labels is a nicer
way to select k8s objects.

```shell
nginx-loadbalancer-kubernetes $ kubectl -n nlk logs -f $(kubectl -n nlk get po -l "app=nlk" --no-headers -o custom-columns=":metadata.name")
time="2024-02-28T20:35:49Z" level=info msg="Settings::Initialize"
time="2024-02-28T20:35:49Z" level=info msg="Certificates::Initialize"
time="2024-02-28T20:35:49Z" level=info msg="Certificates::Run"
I0228 20:35:49.398213       1 shared_informer.go:273] Waiting for caches to sync for nlk-handler
I0228 20:35:49.500005       1 shared_informer.go:280] Caches are synced for nlk-handler
```
@puneetsarna
Copy link
Contributor Author

@ciroque @chrisakker

Copy link
Collaborator

@ciroque ciroque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the contribution!

@ciroque ciroque merged commit 3248f18 into nginxinc:main Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants