Skip to content

Commit 275f1e4

Browse files
committed
Update blog post Scaling a Kubernetes Selenium Grid with KEDA
[deploy site] Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com> 27ee322
1 parent 9713159 commit 275f1e4

File tree

38 files changed

+245
-230
lines changed

38 files changed

+245
-230
lines changed

blog/2022/_print/index.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@
248248
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#204a87;font-weight:700>metadata</span><span style=color:#000;font-weight:700>:</span><span style=color:#f8f8f8;text-decoration:underline>
249249
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#204a87;font-weight:700>url</span><span style=color:#000;font-weight:700>:</span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#4e9a06>&#39;http://selenium-grid-url-or-ip:4444/graphql&#39;</span><span style=color:#f8f8f8;text-decoration:underline>
250250
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#204a87;font-weight:700>browserName</span><span style=color:#000;font-weight:700>:</span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#4e9a06>&#39;chrome&#39;</span><span style=color:#f8f8f8;text-decoration:underline>
251+
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#204a87;font-weight:700>platformName</span><span style=color:#000;font-weight:700>:</span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#4e9a06>&#39;Linux&#39;</span><span style=color:#f8f8f8;text-decoration:underline>
251252
</span></span></span></code></pre></div><p>All of this gets saved as a Scaled-Object like so:</p><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-yml data-lang=yml><span style=display:flex><span><span style=color:#204a87;font-weight:700>apiVersion</span><span style=color:#000;font-weight:700>:</span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#000>keda.sh/v1alpha1</span><span style=color:#f8f8f8;text-decoration:underline>
252253
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline></span><span style=color:#204a87;font-weight:700>kind</span><span style=color:#000;font-weight:700>:</span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#000>ScaledObject</span><span style=color:#f8f8f8;text-decoration:underline>
253254
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline></span><span style=color:#204a87;font-weight:700>metadata</span><span style=color:#000;font-weight:700>:</span><span style=color:#f8f8f8;text-decoration:underline>
@@ -263,9 +264,13 @@
263264
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#204a87;font-weight:700>triggers</span><span style=color:#000;font-weight:700>:</span><span style=color:#f8f8f8;text-decoration:underline>
264265
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline> </span>- <span style=color:#204a87;font-weight:700>type</span><span style=color:#000;font-weight:700>:</span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#000>selenium-grid</span><span style=color:#f8f8f8;text-decoration:underline>
265266
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#204a87;font-weight:700>metadata</span><span style=color:#000;font-weight:700>:</span><span style=color:#f8f8f8;text-decoration:underline>
266-
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#204a87;font-weight:700>url</span><span style=color:#000;font-weight:700>:</span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#4e9a06>&#39;https://selenium-grid-url-or-ip:4444/graphql&#39;</span><span style=color:#f8f8f8;text-decoration:underline>
267+
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#204a87;font-weight:700>url</span><span style=color:#000;font-weight:700>:</span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#4e9a06>&#39;http://selenium-grid-url-or-ip:4444/graphql&#39;</span><span style=color:#f8f8f8;text-decoration:underline>
267268
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#204a87;font-weight:700>browserName</span><span style=color:#000;font-weight:700>:</span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#4e9a06>&#39;chrome&#39;</span><span style=color:#f8f8f8;text-decoration:underline>
268-
</span></span></span></code></pre></div><p>As an added bonus KEDA allows us to scale our deployments down to
269+
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#204a87;font-weight:700>platformName</span><span style=color:#000;font-weight:700>:</span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#4e9a06>&#39;Linux&#39;</span><span style=color:#f8f8f8;text-decoration:underline>
270+
</span></span></span></code></pre></div><p>Send the request to Grid, for example in Python client:</p><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-python data-lang=python><span style=display:flex><span><span style=color:#000>options</span> <span style=color:#ce5c00;font-weight:700>=</span> <span style=color:#000>ChromeOptions</span><span style=color:#000;font-weight:700>()</span>
271+
</span></span><span style=display:flex><span><span style=color:#000>options</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>set_capability</span><span style=color:#000;font-weight:700>(</span><span style=color:#4e9a06>&#39;platformName&#39;</span><span style=color:#000;font-weight:700>,</span> <span style=color:#4e9a06>&#39;Linux&#39;</span><span style=color:#000;font-weight:700>)</span>
272+
</span></span><span style=display:flex><span><span style=color:#000>driver</span> <span style=color:#ce5c00;font-weight:700>=</span> <span style=color:#000>webdriver</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>Remote</span><span style=color:#000;font-weight:700>(</span><span style=color:#000>options</span><span style=color:#ce5c00;font-weight:700>=</span><span style=color:#000>options</span><span style=color:#000;font-weight:700>,</span> <span style=color:#000>command_executor</span><span style=color:#ce5c00;font-weight:700>=</span><span style=color:#4e9a06>&#39;http://selenium-grid-url-or-ip:4444/wd/hub&#39;</span><span style=color:#000;font-weight:700>)</span>
273+
</span></span></code></pre></div><p>As an added bonus KEDA allows us to scale our deployments down to
269274
0 when there is no use, something the normal out-of-the-box HPA
270275
does not allow.</p><p>Check more details at <a href=https://keda.sh/docs/latest/concepts/scaling-deployments/>the documentation for Scaled-Object in KEDA</a>.</p><p>A full example of how to implement this is further down in the article
271276
but KEDA solves one of our two issues. Now we can properly scale up and

0 commit comments

Comments
 (0)