Added new post and update some misc

This commit is contained in:
2024-04-11 03:51:19 +00:00
parent 477c178ca1
commit 4fc7f42ff4
17 changed files with 207 additions and 75 deletions
+68 -2
View File
@@ -1,5 +1,71 @@
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="4.2.2">Jekyll</generator><link href="https://blog.pengzhan.dev/feed.xml" rel="self" type="application/atom+xml" /><link href="https://blog.pengzhan.dev/" rel="alternate" type="text/html" hreflang="en" /><updated>2024-04-03T18:56:54-04:00</updated><id>https://blog.pengzhan.dev/feed.xml</id><title type="html">STSD</title><subtitle>My personal blog, with some boring research staff and some tricks I was fancy to. I'll try my best to make this blog fun and useful. Not just a place I complain about all happens in my Lab.
</subtitle><author><name>Pengzhan Hao</name><email>haopengzhan@gmail.com</email></author><entry><title type="html">Labs of CS350</title><link href="https://blog.pengzhan.dev/posts/cs350-labs" rel="alternate" type="text/html" title="Labs of CS350" /><published>2022-02-22T16:08:17-05:00</published><updated>2022-02-22T16:08:17-05:00</updated><id>https://blog.pengzhan.dev/posts/cs350-labs</id><content type="html" xml:base="https://blog.pengzhan.dev/posts/cs350-labs"><![CDATA[<p>This will be a series regarding lab I gave during the spring 2022 semester.</p>
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="4.2.2">Jekyll</generator><link href="https://blog.pengzhan.dev/feed.xml" rel="self" type="application/atom+xml" /><link href="https://blog.pengzhan.dev/" rel="alternate" type="text/html" hreflang="en" /><updated>2024-04-10T23:50:57-04:00</updated><id>https://blog.pengzhan.dev/feed.xml</id><title type="html">STSD: A Pretended Tech Blog</title><subtitle>My personal blog, some contents are useful, the others are not. Just like my mediocre life.
</subtitle><author><name>Pengzhan Hao</name><email>haopengzhan@gmail.com</email></author><entry><title type="html">Debug Kubelet</title><link href="https://blog.pengzhan.dev/posts/Debug-kubelet" rel="alternate" type="text/html" title="Debug Kubelet" /><published>2024-04-10T03:34:00-04:00</published><updated>2024-04-10T03:34:00-04:00</updated><id>https://blog.pengzhan.dev/posts/Debug-kubelet</id><content type="html" xml:base="https://blog.pengzhan.dev/posts/Debug-kubelet"><![CDATA[<h2 id="debug-logs">Debug logs</h2>
<p>Like all others programs debugging, the most straightforward way for newbies and the easiest way for advanced developer is relying on logs. Same to debug <code class="language-plaintext highlighter-rouge">kubelet</code>, bumping up verbosity to show more logs is the most intuitive approach when facing an issue. Like most component in Kubernetes, <code class="language-plaintext highlighter-rouge">kubelet</code> uses <code class="language-plaintext highlighter-rouge">klog</code> for logging and there are 10 verbosity levels(0-9).</p>
<p>TL;DR: Bumping up to level 5 would satisfy most debugging needs.</p>
<table>
<thead>
<tr>
<th>Level</th>
<th>Meaning</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>Always on (Warning, Error, Fatal)</td>
<td>https://github.com/kubernetes/kubernetes/blob/d9c54f69d4bb7ae1bb655e1a2a50297d615025b5/pkg/kubelet/kubelet.go#L757-L757</td>
</tr>
<tr>
<td>1</td>
<td>Default level logs when dont want any verbosity</td>
<td>https://github.com/kubernetes/kubernetes/blob/d9c54f69d4bb7ae1bb655e1a2a50297d615025b5/pkg/kubelet/kubelet.go#L2527</td>
</tr>
<tr>
<td>2</td>
<td>Most important logs when major operations happen, also the default verbosity level</td>
<td>https://github.com/kubernetes/kubernetes/blob/d9c54f69d4bb7ae1bb655e1a2a50297d615025b5/pkg/kubelet/kubelet.go#L483-L483</td>
</tr>
<tr>
<td>3</td>
<td>Extended information</td>
<td>https://github.com/kubernetes/kubernetes/blob/d9c54f69d4bb7ae1bb655e1a2a50297d615025b5/pkg/kubelet/kubelet.go#L2176</td>
</tr>
<tr>
<td>4</td>
<td>Debug level</td>
<td>https://github.com/kubernetes/kubernetes/blob/d9c54f69d4bb7ae1bb655e1a2a50297d615025b5/pkg/kubelet/kubelet.go#L1731</td>
</tr>
<tr>
<td>5</td>
<td>Trace level</td>
<td>https://github.com/kubernetes/kubernetes/blob/d9c54f69d4bb7ae1bb655e1a2a50297d615025b5/pkg/kubelet/kubelet.go#L2821-L2821</td>
</tr>
<tr>
<td>6</td>
<td>Display requested resources</td>
<td>https://github.com/kubernetes/kubernetes/blob/d9c54f69d4bb7ae1bb655e1a2a50297d615025b5/pkg/kubelet/cm/cgroup_manager_linux.go#L401</td>
</tr>
<tr>
<td>7</td>
<td>Display HTTP request headers</td>
<td>https://github.com/kubernetes/kubernetes/blob/d9c54f69d4bb7ae1bb655e1a2a50297d615025b5/pkg/kubelet/logs/container_log_manager.go#L299</td>
</tr>
<tr>
<td>8</td>
<td>Display HTTP request payload</td>
<td>https://github.com/kubernetes/kubernetes/blob/d9c54f69d4bb7ae1bb655e1a2a50297d615025b5/pkg/kubelet/prober/prober_manager.go#L192</td>
</tr>
</tbody>
</table>
<p>By the time, this note was written. In <code class="language-plaintext highlighter-rouge">kubelet</code> related code, level 8 was only used in <code class="language-plaintext highlighter-rouge">pkg/kubelet/prober/prober_manager.go</code> and level 7 was only used in <code class="language-plaintext highlighter-rouge">pkg/kubelet/logs/container_log_manager.go</code>. And there are 11 occurrences that level 6 was used, and all of them are not part of workload lifecycle related.</p>
<h2 id="further-readings">Further readings</h2>
<p>[Inotify watcher leaks in Kubelet]</p>]]></content><author><name>Pengzhan Hao</name></author><category term="Kubernetes" /><category term="Kubelet" /><category term="Debug" /><summary type="html"><![CDATA[Debug logs Like all others programs debugging, the most straightforward way for newbies and the easiest way for advanced developer is relying on logs. Same to debug kubelet, bumping up verbosity to show more logs is the most intuitive approach when facing an issue. Like most component in Kubernetes, kubelet uses klog for logging and there are 10 verbosity levels(0-9). TL;DR: Bumping up to level 5 would satisfy most debugging needs. Level Meaning Example 0 Always on (Warning, Error, Fatal) https://github.com/kubernetes/kubernetes/blob/d9c54f69d4bb7ae1bb655e1a2a50297d615025b5/pkg/kubelet/kubelet.go#L757-L757 1 Default level logs when dont want any verbosity https://github.com/kubernetes/kubernetes/blob/d9c54f69d4bb7ae1bb655e1a2a50297d615025b5/pkg/kubelet/kubelet.go#L2527 2 Most important logs when major operations happen, also the default verbosity level https://github.com/kubernetes/kubernetes/blob/d9c54f69d4bb7ae1bb655e1a2a50297d615025b5/pkg/kubelet/kubelet.go#L483-L483 3 Extended information https://github.com/kubernetes/kubernetes/blob/d9c54f69d4bb7ae1bb655e1a2a50297d615025b5/pkg/kubelet/kubelet.go#L2176 4 Debug level https://github.com/kubernetes/kubernetes/blob/d9c54f69d4bb7ae1bb655e1a2a50297d615025b5/pkg/kubelet/kubelet.go#L1731 5 Trace level https://github.com/kubernetes/kubernetes/blob/d9c54f69d4bb7ae1bb655e1a2a50297d615025b5/pkg/kubelet/kubelet.go#L2821-L2821 6 Display requested resources https://github.com/kubernetes/kubernetes/blob/d9c54f69d4bb7ae1bb655e1a2a50297d615025b5/pkg/kubelet/cm/cgroup_manager_linux.go#L401 7 Display HTTP request headers https://github.com/kubernetes/kubernetes/blob/d9c54f69d4bb7ae1bb655e1a2a50297d615025b5/pkg/kubelet/logs/container_log_manager.go#L299 8 Display HTTP request payload https://github.com/kubernetes/kubernetes/blob/d9c54f69d4bb7ae1bb655e1a2a50297d615025b5/pkg/kubelet/prober/prober_manager.go#L192 By the time, this note was written. In kubelet related code, level 8 was only used in pkg/kubelet/prober/prober_manager.go and level 7 was only used in pkg/kubelet/logs/container_log_manager.go. And there are 11 occurrences that level 6 was used, and all of them are not part of workload lifecycle related. Further readings [Inotify watcher leaks in Kubelet]]]></summary></entry><entry><title type="html">Labs of CS350</title><link href="https://blog.pengzhan.dev/posts/cs350-labs" rel="alternate" type="text/html" title="Labs of CS350" /><published>2022-02-22T16:08:17-05:00</published><updated>2022-02-22T16:08:17-05:00</updated><id>https://blog.pengzhan.dev/posts/cs350-labs</id><content type="html" xml:base="https://blog.pengzhan.dev/posts/cs350-labs"><![CDATA[<p>This will be a series regarding lab I gave during the spring 2022 semester.</p>
<p>The reason why I am writing this down is because it has been a week and no students ask for the solution of the last Lab.
I realise that learning gap between students are huge, especially when a non-profit university is admitting more and more students.