<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Steven Leclerc on Medium]]></title>
        <description><![CDATA[Stories by Steven Leclerc on Medium]]></description>
        <link>https://medium.com/@lynxprojects.tech?source=rss-7d428f714a0e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*LndBQ_ZEEk2KcbeOuxENEg.jpeg</url>
            <title>Stories by Steven Leclerc on Medium</title>
            <link>https://medium.com/@lynxprojects.tech?source=rss-7d428f714a0e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 21:34:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lynxprojects.tech/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Kubernetes on bare-metal : Install Tools]]></title>
            <link>https://medium.com/@lynxprojects.tech/kubernetes-on-bare-metal-install-tools-88188ebcfda1?source=rss-7d428f714a0e------2</link>
            <guid isPermaLink="false">https://medium.com/p/88188ebcfda1</guid>
            <category><![CDATA[fun]]></category>
            <category><![CDATA[diy]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Steven Leclerc]]></dc:creator>
            <pubDate>Tue, 24 Mar 2020 16:43:26 GMT</pubDate>
            <atom:updated>2020-03-24T16:43:53.189Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HtVKGQHilYpje6TrcTzw3w.png" /></figure><h3>Kubernetes on bare-metal : Install Tools</h3><p>If you didn’t saw the first part of this article, you should take a glance <a href="https://medium.com/@lynxprojects.tech/kubernetes-on-bare-metal-introduction-ba1dfa594e65">par là les gars</a></p><h3>Install a secured ETCD Cluster</h3><p>An ETCD server must run on the following minimal configuration :</p><ul><li>2 CPUs</li><li>8 Go RAM</li><li>SSD or IOPS sup than 50 (7200 RPM) or 500 IOPS with SSD Pro</li><li>. . . Use <a href="https://github.com/ongardie/diskbenchmark">diskbench</a> or <a href="https://github.com/axboe/fio">fio</a> to benchmark it</li><li>. . . Pimp your conf : ionice -c2 -n0 -p pgrep etcd &lt;= significate : best-effort and priority 0 to process etcd</li><li>1G bandwidth minimum, you can prioritize the peer traffic against the client traffic.</li></ul><h3>Install and Start within Centos</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RamG3CY2EWUpJGX5hd4I7Q.png" /></figure><h3>Set up a cluster</h3><p>Two ways :</p><ul><li>The secured one</li><li>The insecure one</li></ul><p>(You see everything is quite simple !)</p><p>We choose the secured one ;)</p><ul><li>Certification part from: <a href="https://medium.com/u/fa3428cc9215">Pradeep Pandey</a></li></ul><p>There are many articles about how using the CFFS generator, but it’s not necessary, and it’s better for your brain to do it yourself!</p><p>We have three ETCD endpoints. So basically, we need 3 certificates, and one unique Certificate Authority (CA). The CA is used to sign the 3 certificates generated on each server. WHY? Because.</p><p>So this is the way to achieve our… ok ok, the CA is useful for two mains reasons :</p><ul><li>Authenticate the certificate, to be sure to know the requester (avoid MITM)</li><li>Unstress our tools, curl, wget, etcdctl (…). As a matter of fact, our certificate is auto-signed, none of the public CA signed them, so you will be rejected (unless you add the — insecure option )</li></ul><p>Let’s have a look on this simple script :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2dee4fe8637fd91521528337ad4e3cc5/href">https://medium.com/media/2dee4fe8637fd91521528337ad4e3cc5/href</a></iframe><p>In this script, we talk about a <em>resources</em> folder with a <em>etcd.conf</em> and an <em>openssl.conf</em></p><p>You have to create these files using the template below on each server :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9f3bf02ba746c406f8130ab1e2bcd27e/href">https://medium.com/media/9f3bf02ba746c406f8130ab1e2bcd27e/href</a></iframe><p>Tips: If you create the certificate manually, be sure to generate each of them in the server.</p><p><strong>Secure your etcd file data</strong> :</p><ul><li>chown etcd:etcd /var/lib/etcd</li><li>chmod 700 /var/lib/etcd</li><li>After the creation of this bulk of c…ertificates, restart the service :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0uHW-pQNVJxj1FH-HhBH6g.png" /></figure><p>The certificate rotation process will be reviewed in Part 5</p><h3>Test the cluster</h3><p>Now, that the service is running (I hope for you, but let’s drop a comment if you have a problem ;)</p><p>Try it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-rlijnAaOfKg475tYNaWQw.png" /></figure><p>The --ca-file is used to authenticate the requester. (Generated from the script above)</p><p>If a member is unhealthy, you have to :</p><ul><li>Stop the service on the unhealthy server</li><li>rm -rf /var/lib/etcd (local etcd data directory)</li><li>Go to a healthy member then run etcdctl --endpoints {ownIP or a healthy etcd member ip}:2379 --ca-file /opt/etcd-certs/ca.pem member remove {ID from member list}</li><li>Change the name of the new member on his etcd.conf file and set ETCD_INITIAL_CLUSTER_STATE=existing instead of new</li><li>Relaunch the service</li></ul><h3>Remove the cluster</h3><ul><li>Stop the service on each node</li><li>yum autoremove etcd -y &amp;&amp; rm -rf /var/lib/etcd/</li></ul><h3>Backup it !</h3><ul><li>It’s essential to have a steady backup running :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q6iICdpfKy-o3OoMzrqKLA.png" /></figure><p>In the beginning, crontab it, but maybe find a better solution.</p><h3>Update it!</h3><p>Use the official distribution package. It’s faster than manual installation…</p><p>or :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/10a349446c589f558c6abb3069beb319/href">https://medium.com/media/10a349446c589f558c6abb3069beb319/href</a></iframe><p>Relaunch with your configuration file used by the service (if you used the distribution package at the beginning)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WBEp-HVUot7T0NjkL_QTyw.png" /></figure><h3>Install Docker (With Kubernetes recommendations)</h3><p>Be reassured. This part will be easier than the previous one.</p><p>Okay just follow the step by step below :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fd0f69aec6ad58aa80c6153fae41474f/href">https://medium.com/media/fd0f69aec6ad58aa80c6153fae41474f/href</a></iframe><p>Before using Docker, make sure to use the right cgroup manager (root resource manager). There are some cases where have two differents cgroup managers can lead to a lake of stability. So systemd will handle everything.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a51680864ce06938f41fc758ffaa105d/href">https://medium.com/media/a51680864ce06938f41fc758ffaa105d/href</a></iframe><p>Simply as “let’s go through the last section !”</p><h3>Install kubeadm, kubelet, kubectl</h3><p>Source : <a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/">kubeadm</a></p><ul><li>Step by Step</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/66326de72601d56bdb22e91f5c949267/href">https://medium.com/media/66326de72601d56bdb22e91f5c949267/href</a></iframe><p>A short recap of this step by step :</p><ul><li>On recent distributions, iptables framework is replaced by nftables, and we can’t switch to the previous iptables (legacy mode), so you cannot use Kubernetes (maybe there are ways, I honestly have no ideas)</li><li>Shutting Down SELinux, it’s not the Kubernetes’ Friend… (what ? SELinux has no friends ? …)</li><li>Enabling bridge between VM to iptables (<a href="https://wiki.libvirt.org/page/Net.bridge.bridge-nf-call_and_sysctl.conf">some info</a>)</li></ul><p>Okay, now everything is settled, go through the Part 3: Install Kubernetes Cluster (Soon !)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88188ebcfda1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes on bare-metal : Introduction]]></title>
            <link>https://medium.com/@lynxprojects.tech/kubernetes-on-bare-metal-introduction-ba1dfa594e65?source=rss-7d428f714a0e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba1dfa594e65</guid>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[diy]]></category>
            <dc:creator><![CDATA[Steven Leclerc]]></dc:creator>
            <pubDate>Sat, 21 Mar 2020 17:49:52 GMT</pubDate>
            <atom:updated>2020-03-24T19:15:04.441Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*pGrrR3ZzXNMyBMvtwI2YRw.png" /></figure><h3>Kubernetes on bare-metal : Introduction</h3><p>Kubernetes is the new black. It’s the leading technology for handling containers on multiple nodes. But there is a problem. It’s not very easy to install in a vast scope on your own, especially without having cold feet about the security layer. I will not speak about container security, only how Kubernetes can add some proper structure for them.</p><p>Interested in container security? check: ce truc, <a href="https://cloud.google.com/blog/products/gcp/exploring-container-security-isolation-at-different-layers-of-the-Kubernetes-stack">ce machin</a>, <a href="https://www.youtube.com/watch?v=pPsREQbf3PA">ici</a> <a href="https://jpetazzo.github.io/2014/06/23/docker-ssh-considered-evil/">et là</a></p><p>This complexity explains why many cloud providers are in place, like AWS, Google, etc…</p><p>Generally speaking, it’s pretty easy to create a simple tainted control-plane (a tainted control plane can host pods as well as workers). Lots of documentation will help you achieve this goal. But when we want to step up to a more substantial architecture, some trouble can appear.</p><p>The primary purpose of this article is to give you the proper way to install a secured and stable Kubernetes cluster, on your server, without using any black-boxed tools. I don’t say these tools are wrong, but in a world where we used to click somewhere to have something, it can be useful to break this habitude and try to understand what we are doing. (especially when something goes wrong)</p><p>This article will give you the direction to follow to understand a Kubernetes installation and the proper way. In the last part, we will use the CNCF guideline to improve our installation step by step (part 5), There are, obviously, other ways but I present you, in all humility, mine.</p><p>Sources used for part 4–5 :</p><p>#<a href="https://www.weave.works/blog/what-does-production-ready-really-mean-for-a-Kubernetes-cluster">clic!</a></p><p>#<a href="https://kubernetes-security.info/#securing-the-cluster">boom 500!</a></p><p>By the way, I’m open to comment, “improve oriented,” do not hesitate to poke <a href="/service/mailto:stevenleclerc@lynxprojects.tech">ma boite aux lettres</a> ;)</p><p>Yes, hyperlinks link looks strange, be reassured, it’s the only French part of this article… not to mention my poor English synthase! So, to be clear, I split the article into 5 “short” parts :</p><ul><li><strong>Part 1 — Context :</strong></li><li>Short explanations</li><li>Targeted Architecture</li><li>Pre-requirements</li><li><strong>Part 2 — Tools :</strong></li><li>External Secured ETCD</li><li>Install Docker</li><li>Install Kube*</li><li><strong>Part 3 — Install/configure Kubernetes :</strong></li><li>Install First Control-Plane</li><li>Main url</li><li>ETCD conf</li><li>Calico CNI</li><li>Install second Control-Plane</li><li>Install Node</li><li><strong>Part 4 — Basic Security :</strong></li><li>SECURITY: Encrypt Secrets</li><li>SECURITY: Admission Control</li><li>SECURITY: Default ServiceAccount</li><li>SECURITY: RBAC</li><li><strong>Part 5 — Installation Conformities: CNCF/CIS :</strong></li><li>Sonobuoy</li><li>Installing</li><li>Launch tests</li><li>Fetch Results</li><li>Benchmark — CIS Conformities</li><li>1 — — 1.2.6 Ensure that the — kubelet-certificate-authority</li><li>2 — — 1.2.14 Ensure that the admission control plugin ServiceAccount is set</li><li>3 — — 1.2.16 Ensure that the admission control plugin PodSecurityPolicy is set (Scored)</li><li>4 — — 1.2.21 to 1.2.25 Audit-Profiling Issues</li><li>5 — — 1.3.1 Ensure that the — terminated-pod-gc-threshold argument is set as appropriate (Scored)</li><li>6 — — 1.3.6 Ensure that the RotateKubeletServerCertificate argument is set to true (Scored)</li><li>7 — — 1.3.2 Ensure that the — profiling argument is set to false (Scored)**</li><li>Maintenance</li></ul><h3>Part 1 — Context</h3><ul><li>Short explanations</li></ul><p>In terms of infrastructure, Kubernetes is divided in 3 mains parts (highly summarised):</p><ul><li>ETCD (high performances key/value database) (<a href="https://github.com/etcd-io/etcd">Par là</a>)</li><li>Control-Plane, It’s the master “Node,” it includes the kube-api, Scheduler, network management…</li><li>Nodes/Workers, where your containers will be install/running</li></ul><p>Tips: Your control-plane can be configured to run your containers as well. In our architecture, it will be the case.</p><p>In order to improve your stack availability, the Control-Plane (CP) can be clustered as well ;)</p><p>Targeted Architecture</p><p>Okay, let’s have a look at our schema :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*250wqCu_ctBgSBvwqma-GA.png" /></figure><p>As you can see, I’ve tried to keep the things <em>simple</em>.</p><p>We have two Control-Pane, Loadbalanced by DNS (Use a real load balancer if you can (HAProxy, cloud LB…)), attached to these CPs an External ETCD Cluster. Finally, we add one k8s node.</p><p>Pre-requirements</p><ul><li>Servers</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7d2b7c3f4d33d30a4ad91c418af5c1d2/href">https://medium.com/media/7d2b7c3f4d33d30a4ad91c418af5c1d2/href</a></iframe><p>They respect the k8s requirements (found <a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/">here</a>)</p><p>In order to use your container efficiently, switch off your swap ;)</p><p>swappoff -a</p><ul><li>Ports !</li></ul><p>For the good of your cluster, and your nerves, some ports must be open.</p><p>I use Iptables, but even if you use another firewall, it’s essential to use the correct <em>broad used strategy: Limiting the Attack Surface</em>. You have to drop everything, then open the selected port. Moreover, theses selected ports must be open just for some well-known IPs.</p><p>Example :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c2e0b2fddd3366dd17dbeedbf979bad1/href">https://medium.com/media/c2e0b2fddd3366dd17dbeedbf979bad1/href</a></iframe><p><em>It’s an example ! open you ssh and some mandatory ports as weel :D</em></p><p><strong>Recap needed ports :</strong></p><p>Master server (Control-plane node(s))</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5fd47cdefeb6105bec80d2ad30b12b69/href">https://medium.com/media/5fd47cdefeb6105bec80d2ad30b12b69/href</a></iframe><p>Worker Node(s)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5fd47cdefeb6105bec80d2ad30b12b69/href">https://medium.com/media/5fd47cdefeb6105bec80d2ad30b12b69/href</a></iframe><p>Okay, we have the decors, let’s put some actors in it! let’s go through the<a href="https://medium.com/@lynxprojects.tech/kubernetes-on-bare-metal-install-tools-88188ebcfda1"> Part 2 : Installing Tools</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba1dfa594e65" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>