-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.xml
More file actions
271 lines (271 loc) · 41 KB
/
index.xml
File metadata and controls
271 lines (271 loc) · 41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Alan Zhan 部落格</title>
<link>https://alanzhan.dev/</link>
<description>Recent content on Alan Zhan 部落格</description>
<generator>Hugo</generator>
<language>zh-tw</language>
<lastBuildDate>Sun, 12 Mar 2023 18:04:41 +0800</lastBuildDate>
<atom:link href="https://alanzhan.dev/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>透過 Terraform 建立私有 GKE Cluster</title>
<link>https://alanzhan.dev/post/2023-03-12-terraform-private-gke/</link>
<pubDate>Sun, 12 Mar 2023 18:04:41 +0800</pubDate>
<guid>https://alanzhan.dev/post/2023-03-12-terraform-private-gke/</guid>
<description><p>讓我們一起來花個十分鐘,我會手把手地教你使用 Terraform ,建立私有的 GKE Cluster !</p>
<h2 id="設定-gcp">設定 GCP</h2>
<p>
 <img src="https://alanzhan.dev/2023-03-12-terraform-private-gke/create-service-account.jpg" alt="建立 Service Account 與 Key">

</p>
<h3 id="建立-service-account">建立 Service Account</h3>
<p>首先我們會需要先到 Google Cloud 的頁面上,建立一個 Service Account 給 Terraform 使用,位置可以參考上圖的第 1 2 3 步驟,如果你已經有 Service Account 的話,你可以跳過這個步驟。</p></description>
</item>
<item>
<title>終身成長</title>
<link>https://alanzhan.dev/post/2022-10-02-lifelong-growth/</link>
<pubDate>Sun, 02 Oct 2022 20:20:53 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-10-02-lifelong-growth/</guid>
<description><h2 id="思維模式">思維模式</h2>
<p>你今天去上了一門對你來說是很重要的課程,而且你非常喜歡這門課。你的教授公佈了期中考的考試成績,然而你考試的成績只獲得了 60 分。你非常的失望,等到晚上準備要回家的時候,你發現你錯過了最後一班捷運,導致你必須走回家。當你感到非常生氣的時候,打電話給你最好的朋友想要傾訴,然而卻沒有打通。</p></description>
</item>
<item>
<title>Kubernetes 核心介紹 Kubelet</title>
<link>https://alanzhan.dev/post/2022-08-30-kubernetes-kubelet/</link>
<pubDate>Tue, 30 Aug 2022 20:56:08 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-08-30-kubernetes-kubelet/</guid>
<description><h1 id="kubelet-架構">Kubelet 架構</h1>
<p>如下 kubelet 內部組件結構圖所示,Kubelet 由許多內部組件構成:</p>
<ul>
<li>Kubelet API,包括 10250 port 的認證 API、4194 port 的 cAdvisor API、10255 port 的只讀 API 以及 10248 port 的健康檢查 API 。</li>
<li>syncLoop:從 API 或者 manifest 目錄接收 Pod 更新,發送到 podWorkers 處理,大量使用 channel 處理來處理異步請求 。</li>
<li>輔助的 manager,如 cAdvisor、PLEG、Volume Manager 等,處理 syncLoop 以外的其他工作 。</li>
<li>CRI:容器執行引擎接口,負責與 container runtime shim 通信 。</li>
<li>容器執行引擎,如 dockershim、rkt 等 。</li>
<li>網絡插件,目前支持 CNI 和 kubenet 。</li>
</ul>
<p>
 <img src="https://alanzhan.dev/2022-08-30-kubernetes-kubelet/architecture.png" alt="kubelet 架構圖">

</p></description>
</item>
<item>
<title>白話解 Leetcode - 25 Reverse Nodes in k-Group</title>
<link>https://alanzhan.dev/post/2022-08-28-leetcode-25/</link>
<pubDate>Sun, 28 Aug 2022 14:22:55 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-08-28-leetcode-25/</guid>
<description><h1 id="25-reverse-nodes-in-k-group">25. Reverse Nodes in k-Group</h1>
<p><a href="https://leetcode.com/problems/reverse-nodes-in-k-group/">https://leetcode.com/problems/reverse-nodes-in-k-group/</a></p>
<h3>Hard</h3><hr><div><p>Given the <code>head</code> of a linked list, reverse the nodes of the list <code>k</code> at a time, and return <em>the modified list</em>.</p>
<p><code>k</code> is a positive integer and is less than or equal to the length of the linked list. If the number of nodes is not a multiple of <code>k</code> then left-out nodes, in the end, should remain as it is.</p>
<p>You may not alter the values in the list's nodes, only nodes themselves may be changed.</p></description>
</item>
<item>
<title>阿甘投資法</title>
<link>https://alanzhan.dev/post/2022-08-14-forrest-gump-invest/</link>
<pubDate>Sun, 14 Aug 2022 14:41:06 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-08-14-forrest-gump-invest/</guid>
<description><p>還記得我大概在三年前,當時的我是一位股市小白,我剛才了解完畢台灣股市之後,就隨即投入股市交易,當時買的第一張股票是 中信金 2891 ,這個代碼還記得清清楚楚,但是每天上上下下波動,每天都心驚膽跳,最後按耐不住性子就出場了,幸好最後出場有賺到一點點便當錢,不是賠錢,真的是不幸中的大幸,最後在因緣際會下,接觸到阿甘投資法這本書,就此展開了我的指數投資人生,今天就來跟大家好好介紹這本書。</p></description>
</item>
<item>
<title>Kubernetes 核心介紹 Controller Manager</title>
<link>https://alanzhan.dev/post/2022-07-30-kubenetes-controller-manager/</link>
<pubDate>Sat, 30 Jul 2022 20:07:01 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-07-30-kubenetes-controller-manager/</guid>
<description><p>Controller Manager 是 Kubernetes 集群的自動化控制中心,裡面包含了 3X 多個 Controller ,有管理 Pod 相關的、網路相關的、儲存相關的等等。大多數的 Controller 工作模式都差不多,每個 Controller 都是一個 control loop ,負責通過 api-server 監聽其相對應的資源,根據對象狀態來決定接下來的動作,使其達到預期的狀態。</p></description>
</item>
<item>
<title>白話解 Leetcode - 70 Climbing Stairs</title>
<link>https://alanzhan.dev/post/2022-07-13-leetcode-70/</link>
<pubDate>Wed, 13 Jul 2022 22:22:58 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-07-13-leetcode-70/</guid>
<description><h1 id="70-climbing-stairs">70. Climbing Stairs</h1>
<p><a href="https://leetcode.com/problems/climbing-stairs/">https://leetcode.com/problems/climbing-stairs/</a></p>
<h3>Easy</h3><hr><div><p>You are climbing a staircase. It takes <code>n</code> steps to reach the top.</p>
<p>Each time you can either climb <code>1</code> or <code>2</code> steps. In how many distinct ways can you climb to the top?</p>
<p>&nbsp;</p>
<p><strong>Example 1:</strong></p>
<pre><strong>Input:</strong> n = 2
<strong>Output:</strong> 2
<strong>Explanation:</strong> There are two ways to climb to the top.
1. 1 step + 1 step
2. 2 steps
</pre>
<p><strong>Example 2:</strong></p>
<pre><strong>Input:</strong> n = 3
<strong>Output:</strong> 3
<strong>Explanation:</strong> There are three ways to climb to the top.
1. 1 step + 1 step + 1 step
2. 1 step + 2 steps
3. 2 steps + 1 step
</pre>
<p>&nbsp;</p></description>
</item>
<item>
<title>Kubernetes - Node 維護 Pod 遷移</title>
<link>https://alanzhan.dev/post/2022-07-10-kubernetes-cordon-drain/</link>
<pubDate>Sun, 10 Jul 2022 18:19:11 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-07-10-kubernetes-cordon-drain/</guid>
<description><p>敝公司前陣子有發現有機器的資源使用率特別的低在 GKE 上,再怎麼說這些用不到的資源也是白花花的銀子啊,所以我們就新增資源更低更便宜的 Node Pool ,再搭配使用 Cordon + Drain 或者手動刪除 Pod ,讓 Pod 重新長在新的 Node Pool 上,當然在 GKE 上直接刪除舊的 Node Pool 也可以達到一樣的效果,只是我們選用了更安全的做法。</p></description>
</item>
<item>
<title>白話解 Leetcode - 69 Sqrt(x)</title>
<link>https://alanzhan.dev/post/2022-06-30-leetcode-69/</link>
<pubDate>Thu, 30 Jun 2022 23:37:48 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-06-30-leetcode-69/</guid>
<description><h1 id="69-sqrtx">69. Sqrt(x)</h1>
<p><a href="https://leetcode.com/problems/sqrtx/">https://leetcode.com/problems/sqrtx/</a></p>
<h3>Easy</h3><hr><div><p>Given a non-negative integer <code>x</code>,&nbsp;compute and return <em>the square root of</em> <code>x</code>.</p>
<p>Since the return type&nbsp;is an integer, the decimal digits are <strong>truncated</strong>, and only <strong>the integer part</strong> of the result&nbsp;is returned.</p>
<p><strong>Note:&nbsp;</strong>You are not allowed to use any built-in exponent function or operator, such as <code>pow(x, 0.5)</code> or&nbsp;<code>x ** 0.5</code>.</p>
<p>&nbsp;</p>
<p><strong>Example 1:</strong></p>
<pre><strong>Input:</strong> x = 4
<strong>Output:</strong> 2
</pre>
<p><strong>Example 2:</strong></p>
<pre><strong>Input:</strong> x = 8
<strong>Output:</strong> 2
<strong>Explanation:</strong> The square root of 8 is 2.82842..., and since the decimal part is truncated, 2 is returned.</pre>
<p>&nbsp;</p></description>
</item>
<item>
<title>白話解 Leetcode - 433 Minimum Genetic Mutation</title>
<link>https://alanzhan.dev/post/2022-06-28-leetcode-433/</link>
<pubDate>Tue, 28 Jun 2022 23:55:43 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-06-28-leetcode-433/</guid>
<description><h1 id="433-minimum-genetic-mutation">433. Minimum Genetic Mutation</h1>
<p><a href="https://leetcode.com/problems/minimum-genetic-mutation/">https://leetcode.com/problems/minimum-genetic-mutation/</a></p>
<h3>Medium</h3><hr><div><p>A gene string can be represented by an 8-character long string, with choices from <code>'A'</code>, <code>'C'</code>, <code>'G'</code>, and <code>'T'</code>.</p>
<p>Suppose we need to investigate a mutation from a gene string <code>start</code> to a gene string <code>end</code> where one mutation is defined as one single character changed in the gene string.</p>
<ul>
	<li>For example, <code>"AACCGGTT" --&gt; "AACCGGTA"</code> is one mutation.</li>
</ul>
<p>There is also a gene bank <code>bank</code> that records all the valid gene mutations. A gene must be in <code>bank</code> to make it a valid gene string.</p></description>
</item>
<item>
<title>白話解 Leetcode - 23 Merge k Sorted Lists</title>
<link>https://alanzhan.dev/post/2022-06-25-leetcode-23/</link>
<pubDate>Sat, 25 Jun 2022 23:29:46 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-06-25-leetcode-23/</guid>
<description><h1 id="23-merge-k-sorted-lists">23. Merge k Sorted Lists</h1>
<p><a href="https://leetcode.com/problems/merge-k-sorted-lists/">https://leetcode.com/problems/merge-k-sorted-lists/</a></p>
<h3>Hard</h3><hr><div><p>You are given an array of <code>k</code> linked-lists <code>lists</code>, each linked-list is sorted in ascending order.</p>
<p><em>Merge all the linked-lists into one sorted linked-list and return it.</em></p>
<p>&nbsp;</p>
<p><strong>Example 1:</strong></p>
<pre><strong>Input:</strong> lists = [[1,4,5],[1,3,4],[2,6]]
<strong>Output:</strong> [1,1,2,3,4,4,5,6]
<strong>Explanation:</strong> The linked-lists are:
[
 1-&gt;4-&gt;5,
 1-&gt;3-&gt;4,
 2-&gt;6
]
merging them into one sorted list:
1-&gt;1-&gt;2-&gt;3-&gt;4-&gt;4-&gt;5-&gt;6
</pre>
<p><strong>Example 2:</strong></p>
<pre><strong>Input:</strong> lists = []
<strong>Output:</strong> []
</pre>
<p><strong>Example 3:</strong></p>
<pre><strong>Input:</strong> lists = [[]]
<strong>Output:</strong> []
</pre>
<p>&nbsp;</p></description>
</item>
<item>
<title>白話解 Leetcode - 200 Number of Islands</title>
<link>https://alanzhan.dev/post/2022-06-23-leetcode-200/</link>
<pubDate>Thu, 23 Jun 2022 23:50:13 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-06-23-leetcode-200/</guid>
<description><h1 id="200-number-of-islands">200. Number of Islands</h1>
<p><a href="https://leetcode.com/problems/number-of-islands/">https://leetcode.com/problems/number-of-islands/</a></p>
<h3>Medium</h3><hr><div><p>Given an <code>m x n</code> 2D binary grid <code>grid</code> which represents a map of <code>'1'</code>s (land) and <code>'0'</code>s (water), return <em>the number of islands</em>.</p>
<p>An <strong>island</strong> is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.</p>
<p>&nbsp;</p>
<p><strong>Example 1:</strong></p>
<pre><strong>Input:</strong> grid = [
 ["1","1","1","1","0"],
 ["1","1","0","1","0"],
 ["1","1","0","0","0"],
 ["0","0","0","0","0"]
]
<strong>Output:</strong> 1
</pre>
<p><strong>Example 2:</strong></p></description>
</item>
<item>
<title>白話解 Leetcode - 78 Subsets</title>
<link>https://alanzhan.dev/post/2022-06-20-leetcode-78/</link>
<pubDate>Mon, 20 Jun 2022 18:00:00 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-06-20-leetcode-78/</guid>
<description><h1 id="78-subsets">78. Subsets</h1>
<p><a href="https://leetcode.com/problems/subsets/">https://leetcode.com/problems/subsets/</a></p>
<h3>Medium</h3><hr><div><p>Given an integer array <code>nums</code> of <strong>unique</strong> elements, return <em>all possible subsets (the power set)</em>.</p>
<p>The solution set <strong>must not</strong> contain duplicate subsets. Return the solution in <strong>any order</strong>.</p>
<p>&nbsp;</p>
<p><strong>Example 1:</strong></p>
<pre><strong>Input:</strong> nums = [1,2,3]
<strong>Output:</strong> [[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]]
</pre>
<p><strong>Example 2:</strong></p>
<pre><strong>Input:</strong> nums = [0]
<strong>Output:</strong> [[],[0]]
</pre>
<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>
<ul>
	<li><code>1 &lt;= nums.length &lt;= 10</code></li>
	<li><code>-10 &lt;= nums[i] &lt;= 10</code></li>
	<li>All the numbers of&nbsp;<code>nums</code> are <strong>unique</strong>.</li>
</ul>
</div>
<hr>
<h2 id="題意">題意</h2>
<p>傳入一個數值陣列,將元素與元素之間的所有有可能發生的組合回傳。</p></description>
</item>
<item>
<title>白話解 Leetcode - 111 Minimum Depth of Binary Tree</title>
<link>https://alanzhan.dev/post/2022-06-16-leetcode-111/</link>
<pubDate>Thu, 16 Jun 2022 18:00:00 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-06-16-leetcode-111/</guid>
<description><h1 id="111-minimum-depth-of-binary-tree">111. Minimum Depth of Binary Tree</h1>
<p><a href="https://leetcode.com/problems/minimum-depth-of-binary-tree/">https://leetcode.com/problems/minimum-depth-of-binary-tree/</a></p>
<h3>Easy</h3><hr><div><p>Given a binary tree, find its minimum depth.</p>
<p>The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.</p>
<p><strong>Note:</strong>&nbsp;A leaf is a node with no children.</p>
<p>&nbsp;</p>
<p><strong>Example 1:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2020/10/12/ex_depth.jpg" style="width: 432px; height: 302px;">
<pre><strong>Input:</strong> root = [3,9,20,null,null,15,7]
<strong>Output:</strong> 2
</pre>
<p><strong>Example 2:</strong></p>
<pre><strong>Input:</strong> root = [2,null,3,null,4,null,5,null,6]
<strong>Output:</strong> 5
</pre>
<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>
<ul>
	<li>The number of nodes in the tree is in the range <code>[0, 10<sup>5</sup>]</code>.</li>
	<li><code>-1000 &lt;= Node.val &lt;= 1000</code></li>
</ul>
</div>
<hr>
<h2 id="題意">題意</h2>
<p>尋找這棵樹最小的節點,他的深度為何?</p></description>
</item>
<item>
<title>白話解 Leetcode - 104 Maximum Depth of Binary Tree</title>
<link>https://alanzhan.dev/post/2022-06-14-leetcode-104/</link>
<pubDate>Tue, 14 Jun 2022 18:00:00 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-06-14-leetcode-104/</guid>
<description><h1 id="104-maximum-depth-of-binary-tree">104. Maximum Depth of Binary Tree</h1>
<p><a href="https://leetcode.com/problems/maximum-depth-of-binary-tree/">https://leetcode.com/problems/maximum-depth-of-binary-tree/</a></p>
<h3>Easy</h3><hr><div><p>Given the <code>root</code> of a binary tree, return <em>its maximum depth</em>.</p>
<p>A binary tree's <strong>maximum depth</strong>&nbsp;is the number of nodes along the longest path from the root node down to the farthest leaf node.</p>
<p>&nbsp;</p>
<p><strong>Example 1:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2020/11/26/tmp-tree.jpg" style="width: 400px; height: 277px;">
<pre><strong>Input:</strong> root = [3,9,20,null,null,15,7]
<strong>Output:</strong> 3
</pre>
<p><strong>Example 2:</strong></p>
<pre><strong>Input:</strong> root = [1,null,2]
<strong>Output:</strong> 2
</pre>
<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>
<ul>
	<li>The number of nodes in the tree is in the range <code>[0, 10<sup>4</sup>]</code>.</li>
	<li><code>-100 &lt;= Node.val &lt;= 100</code></li>
</ul>
</div>
<hr>
<h2 id="題意">題意</h2>
<p>尋找這棵樹最深的節點,他的深度為何?</p></description>
</item>
<item>
<title>如何在贏者全拿的職場中生存</title>
<link>https://alanzhan.dev/post/2022-06-13-winners-take-all/</link>
<pubDate>Mon, 13 Jun 2022 18:00:00 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-06-13-winners-take-all/</guid>
<description><p>贏者全拿,從字面上的大家應該就會懂了,在我們生活中也時常發生,舉一個最簡單的例子:在民主社會中,每幾年就會有一次總統大選,只有獲得最高票的那個人可以勝出擔任下一任的總統,第二名與第三名好像就沒那麼重要;在情場上,每位男生都可以去追求新垣結衣,然後最終勝出的就只為有一位,在運動場上,在公司,在任何地方,大部分的場景都是贏者全拿的。</p></description>
</item>
<item>
<title>白話解 Leetcode - 226 Invert Binary Tree</title>
<link>https://alanzhan.dev/post/2022-06-12-leetcode-226/</link>
<pubDate>Sun, 12 Jun 2022 13:01:44 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-06-12-leetcode-226/</guid>
<description><h1 id="226-invert-binary-tree">226. Invert Binary Tree</h1>
<p><a href="https://leetcode.com/problems/invert-binary-tree/">https://leetcode.com/problems/invert-binary-tree/</a></p>
<h3>Easy</h3><hr><div><p>Given the <code>root</code> of a binary tree, invert the tree, and return <em>its root</em>.</p>
<p>&nbsp;</p>
<p><strong>Example 1:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2021/03/14/invert1-tree.jpg" style="width: 500px; height: 165px;">
<pre><strong>Input:</strong> root = [4,2,7,1,3,6,9]
<strong>Output:</strong> [4,7,2,9,6,3,1]
</pre>
<p><strong>Example 2:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2021/03/14/invert2-tree.jpg" style="width: 500px; height: 120px;">
<pre><strong>Input:</strong> root = [2,1,3]
<strong>Output:</strong> [2,3,1]
</pre>
<p><strong>Example 3:</strong></p>
<pre><strong>Input:</strong> root = []
<strong>Output:</strong> []
</pre>
<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>
<ul>
	<li>The number of nodes in the tree is in the range <code>[0, 100]</code>.</li>
	<li><code>-100 &lt;= Node.val &lt;= 100</code></li>
</ul>
</div>
<hr>
<h2 id="題意">題意</h2>
<p>將整棵樹的所有左右節點互相對調。</p></description>
</item>
<item>
<title>Kubernetes 核心介紹 Scheduler</title>
<link>https://alanzhan.dev/post/2022-05-16-kubernetes-scheduler/</link>
<pubDate>Mon, 16 May 2022 22:40:48 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-05-16-kubernetes-scheduler/</guid>
<description><p>Scheduler 嚴格算起來,算是特殊的 Controller,工作原理與其他控制器無差別。</p>
<p>Scheduler 的特殊職責在於監控當前集群所有未調度的 Pod,並且獲取當前集群的所有節點健康狀況和資源使用情控,為待調度的 Pod 選擇最佳節點,完成調度。</p></description>
</item>
<item>
<title>Kubernetes 核心介紹 Api Server</title>
<link>https://alanzhan.dev/post/2022-04-24-kubernetes-api-server/</link>
<pubDate>Sun, 24 Apr 2022 19:07:12 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-04-24-kubernetes-api-server/</guid>
<description><h1 id="api-server">API Server</h1>
<p>kube-apiserver 是 Kubernetes 最重要的核心組件之一,主要提供以下功能:</p>
<ul>
<li>提供集群管理的 REST API ,包括認證、授權、數據檢驗以及集群狀態變更等
<ul>
<li>認證 Authentication</li>
<li>授權 Authorization</li>
<li>准入 Admission (Mutating &amp; Valiating)</li>
</ul>
</li>
<li>提供其他模組之間的數據交互和通訊的樞紐,其他模組只能通過 API Server 查詢或者修改數據,只有 API Server 才能直接操作 etcd。</li>
</ul>
<p>kube-apiserver 支持提供 https ( 預設 port 6443 ) 和 http API (默認監聽 127.0.0.1 的 8080 ),其中 http API 是非安全的 API,不做任何認證授權機制,不建議在 Production 環境開啟此功能。</p></description>
</item>
<item>
<title>Mongodb Index 最佳實踐</title>
<link>https://alanzhan.dev/post/2022-04-10-mongodb-index-best-practice/</link>
<pubDate>Sun, 10 Apr 2022 16:19:10 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-04-10-mongodb-index-best-practice/</guid>
<description><p>自上一篇在實際的 Porduction 發生了 sorted operation oom 的問題之後,才意識到自己對於 mongodb Index 的掌握度沒有那麼高,於是開始餵關鍵字給 google 查了好久才終於整理出一些重點,有一些重點在上一篇,可以到上一篇複習一下 <a href="https://alanzhan.dev/post/2022-03-20-mongodb-sorted-operation-oom/">MongoDB Sorted Operation OOM</a>。</p></description>
</item>
<item>
<title>MongoDB Sorted Operation OOM</title>
<link>https://alanzhan.dev/post/2022-03-20-mongodb-sorted-operation-oom/</link>
<pubDate>Sun, 20 Mar 2022 15:11:15 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-03-20-mongodb-sorted-operation-oom/</guid>
<description><p>這篇應該會是難得的從問題反推回去學習的歷程吧,我得好好記錄紀錄。最近我們的 production 發生了 MongoDB 的 sort 操作的限制,具體訊息如下:</p>
<p>MongoDB.Driver.MongoCommandException: Command find failed: Encountered non-retryable error during query :: caused by :: Executor error during find command :: caused by :: Sort operation used more than the maximum 33554432 bytes of RAM.</p></description>
</item>
<item>
<title>Kubernetes 核心介紹 Etcd</title>
<link>https://alanzhan.dev/post/2022-02-28-kubetnetes-etcd/</link>
<pubDate>Mon, 28 Feb 2022 15:58:47 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-02-28-kubetnetes-etcd/</guid>
<description><p>在任何一個系統中,甚麼東西會是最重要的東西呢?答案其實很簡單 : 資料,所以我就從 Kubernetes 的資料庫 etcd 開始學習起!</p>
<h1 id="什麼是-etcd-呢">什麼是 etcd 呢</h1>
<p>etcd 是 CoreOs 基於 Raft 算法開發的分散式 key-value 儲存,可用於服務發現、共享配置以及一致性保障 (如資料庫選主、分散式鎖等)。</p></description>
</item>
<item>
<title>安裝兩次的 Kubernetes Kubeadm</title>
<link>https://alanzhan.dev/post/2022-02-20-reinstall-kubernetes-kubeadm/</link>
<pubDate>Sun, 20 Feb 2022 15:04:19 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-02-20-reinstall-kubernetes-kubeadm/</guid>
<description><p>想要透過實戰來更了解 K8s ,所以想先自架 K8s cluster,但目前市面上自建 K8s 的方式越來越多種,可以透過 minikube 、 Kubeadm 等等,想說好吧那我就挑 Kubeadm 來裝看看,但是安裝的過程不是那麼順遂,這篇就分享一下我遇到的問題跟如何解決。</p></description>
</item>
<item>
<title>Kubernetes 基礎介紹</title>
<link>https://alanzhan.dev/post/2022-02-14-kubernetes-introduction/</link>
<pubDate>Mon, 14 Feb 2022 21:48:40 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-02-14-kubernetes-introduction/</guid>
<description><p>終於要來好好深入探討 Kubernetes ,因為 Kubernetes 是基於 golang 這門語言開發的,所以在稍早已經先針對 golang 深度研究了,不過對於 Docker 與 container 技術有經有深入研究過了,小弟就就不針對 Docker 技術展開了,如果也想看的話,歡迎敲碗,接下來就會好好的針對 Kubernetes 有一系列的文章介紹。</p></description>
</item>
<item>
<title>Golang 記憶體管理 GC 全面解析</title>
<link>https://alanzhan.dev/post/2022-02-13-golang-memory-management/</link>
<pubDate>Sun, 13 Feb 2022 14:42:09 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-02-13-golang-memory-management/</guid>
<description><p>新的一年又到來了,在這邊祝大家虎頭虎尾,所以這個年還沒過完,我得好好的繼續整理技術文章給大家了,這樣有好的開始!</p>
<p>上次分析完 <a href="https://alanzhan.dev/post/2022-01-24-golang-goroutine/">Golang Goroutine 與 GMP 原理全面分析</a> 之後,對 golang 這個語言有了更全面的了解,但是這些有了 GMP 的相關知識之後,是不是還缺少了記憶體管理這個面向呀?那麼今天就來好好的了解 golang 是如何管理他的記憶體吧。</p></description>
</item>
<item>
<title>Golang Goroutine 與 GMP 原理全面分析</title>
<link>https://alanzhan.dev/post/2022-01-24-golang-goroutine/</link>
<pubDate>Mon, 24 Jan 2022 20:24:58 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-01-24-golang-goroutine/</guid>
<description><p>最近在研讀 Kubernetes ,所以得好好地跟 golang 這個語言當朋友,看著看著看到了 goroutine ,但是始終不解 goroutine 是哪來幹嘛、為何而生的?所以我們在開始深入認識 goroutine 之前,我們可能要先來認識一下歷史,這樣我們才能更全面的認識 goroutine 的原理與設計思想。</p></description>
</item>
<item>
<title>10 個 Dockerfile 的最佳實踐</title>
<link>https://alanzhan.dev/post/2022-01-16-dockerfile-best-practices/</link>
<pubDate>Sun, 16 Jan 2022 16:55:15 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-01-16-dockerfile-best-practices/</guid>
<description><p>最近剛好在整理 docker 的技術給自己,剛好看到 dockerfile 的最佳實踐,想順手整理上來,不料看到官方已經有最佳實踐了,那我就順手做做翻譯的工作與添增自己的見解。</p>
<h1 id="容器應該是短暫的">容器應該是短暫的</h1>
<p>通過 <code>Dockerfile</code> 構建的鏡像所啟動的容器,應該盡可能的短暫,這邊的短暫意思是:很快速的啟動,並且很快速的終止。</p></description>
</item>
<item>
<title>Github Pages Custom Domain - Github Blog 自訂域名</title>
<link>https://alanzhan.dev/post/2022-01-09-github-pages-custom-domain/</link>
<pubDate>Sun, 09 Jan 2022 14:58:58 +0800</pubDate>
<guid>https://alanzhan.dev/post/2022-01-09-github-pages-custom-domain/</guid>
<description><p>最近剛好在更換域名,所以順手做一下筆記,也讓大家可以輕鬆上手,設定自己的 Github page 域名。</p>
<h1 id="第一步購買域名">第一步:購買域名</h1>
<p>先去購買自己想要的域名名稱:我是去 Google Domain 購買的,如果你有喜歡或者偏好的域名供應商,你也可以去你想要的供應商購買,本篇就以 Google Domain 為例。</p></description>
</item>
<item>
<title>Interpolation Search Algorithm - 插補搜尋法</title>
<link>https://alanzhan.dev/post/2021-07-13-interpolation-search-algorithm/</link>
<pubDate>Tue, 13 Jul 2021 21:51:30 +0800</pubDate>
<guid>https://alanzhan.dev/post/2021-07-13-interpolation-search-algorithm/</guid>
<description><p>繼續使用猜數字當範例, 1 ~ 100 的數字,但是這次你已經知道結果了,你如果還是繼續使用二元搜尋法,那麼效率不會那麼好,那我們該用甚麼方式解決呢?</p>
<h1 id="概念">概念</h1>
<p>插補搜尋法 (Interpolation Search):是一個基於二元搜尋法的演算法,<code>被搜尋的清單是需要事先先被排序過的</code>,而且資料的分布狀態最好是呈現<code>線性</code>的,如果不是呈現線性分布,那麼在搜尋的過程中,將有可能會得到 O(n) 的結果,可能會比二元搜尋法還更耗時。</p></description>
</item>
<item>
<title>Jump Search Algorithm - 跳躍搜尋法</title>
<link>https://alanzhan.dev/post/2021-07-11-jump-search-alogrithm/</link>
<pubDate>Sun, 11 Jul 2021 14:48:35 +0800</pubDate>
<guid>https://alanzhan.dev/post/2021-07-11-jump-search-alogrithm/</guid>
<description><p>延續猜數字遊戲,1 ~ 100 我們是不是可以換個猜法呢?</p>
<p>如果我們從一開始,只要每次沒猜中,我們就往後面 +10 繼續猜,直到最大值範圍值變成我們所猜的數值後,往回開始找值,這樣做,在數值較小的時候,將會更有效率。</p></description>
</item>
<item>
<title>Binary Search Algorithm - 二元搜尋法</title>
<link>https://alanzhan.dev/post/2021-07-10-binary-search-algorithm/</link>
<pubDate>Sat, 10 Jul 2021 22:57:37 +0800</pubDate>
<guid>https://alanzhan.dev/post/2021-07-10-binary-search-algorithm/</guid>
<description><p>我們來玩猜數字遊戲,1 ~ 100 中的整數,你必須猜中我腦海中的數字,而且我們必須在最少的布數內猜到答案,那麼你會怎麼猜呢?</p>
<p>答案很簡單,你一定會從 50 開始猜,如果沒猜中的話,太高你就會從 25 開始猜,太低你就會從 75 開始猜,以此類推,你每次操作的過程,你都會從中剖一半來猜測,其實你所使用的就是 Binary Search。</p></description>
</item>
<item>
<title>Linear Search Algorithm - 線性搜尋法</title>
<link>https://alanzhan.dev/post/2021-07-10-linear-search-algorithm/</link>
<pubDate>Sat, 10 Jul 2021 18:50:40 +0800</pubDate>
<guid>https://alanzhan.dev/post/2021-07-10-linear-search-algorithm/</guid>
<description><p>在查找一個元素是否存在的時候,我們最常使用的方式是甚麼呢?答案是 for 或者是 while 迴圈,恭喜你!已經學習完 Linear Search 了!</p>
<h1 id="概念">概念</h1>
<p>線性搜尋 (Linear Search):這個演算法會<code>訪問每個元素</code>,確認元素在陣列中的哪個位置,如果找不到元素則會回傳 -1。</p></description>
</item>
<item>
<title>Divide and Conquer - 分而治之</title>
<link>https://alanzhan.dev/post/2021-07-07-divide-and-conquer/</link>
<pubDate>Wed, 07 Jul 2021 23:56:34 +0800</pubDate>
<guid>https://alanzhan.dev/post/2021-07-07-divide-and-conquer/</guid>
<description><h1 id="分而治之">分而治之</h1>
<p>從字面上看起來,就是把一個複雜的問題分解成兩個或者很多個相同或者相似的問題,讓小問題可以被解決,再將最終結果合併求出問題的答案。</p>
<h2 id="優點">優點</h2>
<ol>
<li>解決問題的難度降低。</li>
<li>可以提升執行效率。</li>
<li>有些時候能夠平行處理,增進性能。</li>
</ol>
<h2 id="使用步驟">使用步驟</h2>
<ol>
<li>分解:將一個問題分解成若干個較小的問題,相對獨立,與原先問題形式相同的子問題。</li>
<li>解決:若子問題規模較小並且容易解決時,就直接解決。否則,就遞迴的方式解決子問題。</li>
<li>合併:將個子問題的解合併成為原問題的解。</li>
</ol>
<p>Resources:</p></description>
</item>
<item>
<title>Big O Notation - Big O 符號</title>
<link>https://alanzhan.dev/post/2021-07-06-big-o-notation/</link>
<pubDate>Tue, 06 Jul 2021 23:56:58 +0800</pubDate>
<guid>https://alanzhan.dev/post/2021-07-06-big-o-notation/</guid>
<description><h1 id="如何選擇演算法來解決問題">如何選擇演算法來解決問題</h1>
<p>同一個問題可以用不同的演算法來解決問題,但是選擇哪一個最好?有兩個指標可以評估一個算法的好壞:</p>
<ul>
<li>時間複雜度 (花的時間)</li>
<li>空間複雜度 (花的記憶體)</li>
</ul>
<p>所以花費的時間越少、花費的記憶體越少,通常就是越好的演算法,但是演算法的時間複雜度分析又可以細分為以下三種:</p></description>
</item>
<item>
<title>Emotional Blackmail - 情緒勒索</title>
<link>https://alanzhan.dev/post/2021-06-26-emotional-blackmail/</link>
<pubDate>Sat, 26 Jun 2021 18:46:52 +0800</pubDate>
<guid>https://alanzhan.dev/post/2021-06-26-emotional-blackmail/</guid>
<description><h1 id="什麼是情緒勒索">什麼是情緒勒索?</h1>
<p>在探討情緒勒索之前,我們得先搞清楚什麼是情緒勒索?</p>
<p>情緒勒索者可能在有意識或者無意識當中,使用要求、威脅、施壓、沉默等間接或直接的「<code>勒索</code>」手段,讓被勒索者產生各種負面情緒,譬如:挫折感、罪惡感、恐懼感等等,這些感受就會在被勒索者的心中發酵造成傷害。</p></description>
</item>
<item>
<title>Atomic Habits - 原子習慣</title>
<link>https://alanzhan.dev/post/2021-06-13-atomic-habits/</link>
<pubDate>Sun, 13 Jun 2021 23:45:21 +0800</pubDate>
<guid>https://alanzhan.dev/post/2021-06-13-atomic-habits/</guid>
<description><p>
 <img src="https://alanzhan.dev/2021-06-13-atomic-habits/2021-06-13-atomic-habits_01.png" alt="原子習慣">

</p>
<h1 id="複利">複利</h1>
<p>「複利」這個詞貫穿了整部本書,我們可以說它是世界第八大奇蹟,一點也不為過。</p>
<ul>
<li>你每天只進步 1% ,持續了之後一年 (1.01 ^ 365 = 37.78),你將進步 37 倍。</li>
<li>你每天持續退步了 1% ,持續了一年 (0.99 ^ 365 = 0.03) ,你將退步到趨近 0 。</li>
</ul>
<p>所以習慣就是自我改善這一件事情的複利威力。</p></description>
</item>
<item>
<title>關於我</title>
<link>https://alanzhan.dev/about/</link>
<pubDate>Thu, 13 May 1993 00:00:00 +0800</pubDate>
<guid>https://alanzhan.dev/about/</guid>
<description><p>擁有超過 10 年的全端開發、後端工程及可靠性工程經驗,我對持續學習充滿熱忱。我不斷探索新技術以磨練批判性思維、解決複雜挑戰,為團隊創造實質價值。我的終極目標是將這份熱情化為打造穩健、可擴展且深受用戶喜愛的產品。</p></description>
</item>
</channel>
</rss>