<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ArsN</title>
    <description>The latest articles on DEV Community by ArsN (@arsn).</description>
    <link>https://dev.to/arsn</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F665568%2F03aef13a-0af0-4d5f-814a-c52b77c06e65.jpg</url>
      <title>DEV Community: ArsN</title>
      <link>https://dev.to/arsn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/arsn"/>
    <language>en</language>
    <item>
      <title>Simplified Kubernetes Cluster Deployment: Accelerate Your Setup on Debian 10/11</title>
      <dc:creator>ArsN</dc:creator>
      <pubDate>Tue, 28 Jun 2022 21:53:51 +0000</pubDate>
      <link>https://dev.to/arsn/how-to-quickly-easily-deploy-a-kubernetes-cluster-on-debian-1011-4b7o</link>
      <guid>https://dev.to/arsn/how-to-quickly-easily-deploy-a-kubernetes-cluster-on-debian-1011-4b7o</guid>
      <description>&lt;p&gt;After a long absence, I'm back on the platform with a new tutorial about a kubernetes cluster deployment on X environments with a Master and X workers.&lt;/p&gt;

&lt;p&gt;This tutorial does not necessarily require a lot of knowledge in kubernetes or ansible. Since the script executes everything for you.&lt;/p&gt;

&lt;p&gt;You just have to fulfill the prerequisites for the proper functioning of the script.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;You can view / clone my work from my Github directory: &lt;a href="https://github.com/ArsNQ/deployKubernetes"&gt;https://github.com/ArsNQ/deployKubernetes&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OS : Debian 10 / 11.&lt;/li&gt;
&lt;li&gt;Have ansible installed on your computer.&lt;/li&gt;
&lt;li&gt;Have 4 machines (1 Master / 3 nodes) Can also run with 1 master &amp;amp; 1 node, etc...&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Changes to make to run the ansible script.
&lt;/h2&gt;

&lt;p&gt;First, if you haven't copy/paste your rsa.pub keys on the remote servers. You can use the &lt;strong&gt;join.sh&lt;/strong&gt; script, which allows through a pem or ppk key to deploy your rsa key.&lt;/p&gt;

&lt;p&gt;In a second step you must fill the &lt;strong&gt;hosts&lt;/strong&gt; file with the information between &amp;lt; ... &amp;gt;.&lt;/p&gt;

&lt;p&gt;And thirdly you have to fill in the &lt;strong&gt;--apiserver-cert-extra-sans=&lt;/strong&gt; at the following path &lt;strong&gt;"/setMaster/tasks/main.yml"&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Launch ansible script.
&lt;/h2&gt;

&lt;p&gt;You must go to the &lt;strong&gt;root&lt;/strong&gt; of this folder, and run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ansible-playbook &lt;span class="nt"&gt;-i&lt;/span&gt; hosts playbook.yml

&lt;span class="nb"&gt;.&lt;/span&gt; &amp;lt;&lt;span class="nt"&gt;--------------&lt;/span&gt; HERE &lt;span class="nt"&gt;--------------&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
├── README.md
├── hosts
├── installDocker
├── installKubernetes
├── join.sh
├── playbook.yml
├── setMaster
└── setWorkers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And if you had followed the steps that I indicated to you, you should have the following result !!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xLlHwSZk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/emudbamp8dyqqmnueqpe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xLlHwSZk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/emudbamp8dyqqmnueqpe.png" alt="Image description" width="800" height="156"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope this article will help you and see you soon!&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>docker</category>
      <category>ansible</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Effortless Monitoring: Simplifying Deployment of a Powerful Infrastructure Monitoring Tool</title>
      <dc:creator>ArsN</dc:creator>
      <pubDate>Wed, 24 Nov 2021 16:07:39 +0000</pubDate>
      <link>https://dev.to/arsn/how-to-quickly-easily-deploy-a-monitoring-tool-on-your-infrastructure-4ghf</link>
      <guid>https://dev.to/arsn/how-to-quickly-easily-deploy-a-monitoring-tool-on-your-infrastructure-4ghf</guid>
      <description>&lt;p&gt;Hello everyone, I am very happy to present my first article to you today. &lt;/p&gt;

&lt;p&gt;We will discuss the automation &amp;amp; deployment of a monitoring solution and all the tools necessary for its proper functioning. &lt;/p&gt;

&lt;p&gt;The solution we are deploying today is Grafana. This opensource tool allows us to set up monitoring of our production or test environments for free. &lt;/p&gt;

&lt;p&gt;All our services are dockerized. This approach to containerization of services is a personal choice. I find it very important to containerize the various services, so that we can act in a targeted manner on what we want to modify.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;You can view / clone my work from my Github directory: &lt;a href="https://github.com/ArsNQ/deployMonitoring" rel="noopener noreferrer"&gt;https://github.com/ArsNQ/deployMonitoring&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First, you need to use "&lt;code&gt;ssh-copy-id&lt;/code&gt;" to copy your SSH keys to the servers. Without this, &lt;strong&gt;ansible&lt;/strong&gt; will not be able to run. There are a &lt;strong&gt;few changes to the code&lt;/strong&gt; to make in order for it to run properly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hosts file
&lt;/h3&gt;

&lt;p&gt;The file "hosts" at the root of the folder is containing the list of servers you will want to monitor. You must add all the servers &lt;strong&gt;(their ip addresses, private or public)&lt;/strong&gt; under the &lt;strong&gt;[cluster]&lt;/strong&gt; line. And you must add below &lt;strong&gt;[GrafanaHost]&lt;/strong&gt; the ip address of the server which will host Grafana.&lt;/p&gt;

&lt;h3&gt;
  
  
  Email addresses
&lt;/h3&gt;

&lt;p&gt;In the folder roles/deployGrafana/files, you must change the &lt;strong&gt;alertmanager.yml&lt;/strong&gt; file at the following lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      - to: "**mailaddress**"
      from: "**mailaddress**"
      smarthost: "smtp.gmail.com:465"
      auth_username: "**mailaddress**"
      auth_identity: "**mailaddress**"
      auth_password: "password
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you have your own SMTP server, you can use it, but you need to change the smarthost line. If you don't have a private SMTP server, you can use Google like I do. It's very simple and many tutorials exist on the internet. After that, you just need to replace all the &lt;strong&gt;emailaddresses&lt;/strong&gt; with your own and you will receive the alerts on them. If you want to receive these alerts on another email address, you just have to change the &lt;strong&gt;"to"&lt;/strong&gt; line.&lt;/p&gt;

&lt;h3&gt;
  
  
  Monitoring file
&lt;/h3&gt;

&lt;p&gt;You must modify the following file: &lt;strong&gt;roles/deployGrafana/files/prometheus.yml&lt;/strong&gt;. Indeed, this file contains all the &lt;strong&gt;services listed to monitor&lt;/strong&gt; our &lt;strong&gt;environments&lt;/strong&gt;. It allows you to find out which server is running &lt;strong&gt;alertmanagers&lt;/strong&gt;, where the &lt;strong&gt;node-exporter&lt;/strong&gt; are &lt;strong&gt;located&lt;/strong&gt;, etc ...&lt;/p&gt;

&lt;p&gt;So we have to modify &lt;strong&gt;alertmanagers&lt;/strong&gt; (line 16), &amp;amp; &lt;strong&gt;prometheus&lt;/strong&gt; (line 20) they are running on the same server as Grafana. so you have to enter the exact ip address on these two fields.&lt;/p&gt;

&lt;p&gt;And for the &lt;strong&gt;node-exporter&lt;/strong&gt; (line 23-XX) &amp;amp; &lt;strong&gt;cadvisor&lt;/strong&gt;(line 29-XX) part you have to enter the ip address of the Grafana, and the environments you want to monitor.&lt;/p&gt;

&lt;p&gt;After that we have to go and modify the file roles /deployGrafana/files/provisioning/dashboards/datasource.yml &amp;amp; indicate the IP address of the server where &lt;strong&gt;Prometheus&lt;/strong&gt; is running. This is the file that tells &lt;strong&gt;Grafana&lt;/strong&gt; where is located the &lt;strong&gt;prometheus datasource&lt;/strong&gt;. As you can see just below, prometheus allows to link grafana and node-exporter/cadvisor, It has the role of an interval/syncronizer beween every services.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4ipfeckt4f0huf04eey2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4ipfeckt4f0huf04eey2.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And finally, you need to replace the &lt;strong&gt;password&lt;/strong&gt; in the &lt;strong&gt;/deployGrafana/files/provisioning/config.monitoring&lt;/strong&gt; file, which is the &lt;strong&gt;password&lt;/strong&gt; for your connection to &lt;strong&gt;Grafana&lt;/strong&gt; (you can change it on the platform after).&lt;/p&gt;

&lt;h2&gt;
  
  
  Explanation
&lt;/h2&gt;

&lt;p&gt;As we indicated at the beginning of this article, I decided to use docker to have &lt;strong&gt;better management of my services&lt;/strong&gt;. This is why each command executed while using &lt;strong&gt;ansible&lt;/strong&gt; is a &lt;code&gt;docker-compose up -d&lt;/code&gt; in order to launch the docker-compose.yml previously configured in the files folder of each role. They are deployed on the servers in order to launch the right containers.&lt;/p&gt;

&lt;p&gt;First, our script will connect to the different environments, and will execute the first role, &lt;strong&gt;deployNodeExporter&lt;/strong&gt;. It consists of a series of installation of packages &amp;amp; dependencies (like docker, apt-transport-https, etc...) so that the script can run properly afterwards.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyf6qwzl00gigeyrzdji6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyf6qwzl00gigeyrzdji6.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once all our environment is &lt;strong&gt;up to date&lt;/strong&gt; and it &lt;strong&gt;runs&lt;/strong&gt; our &lt;strong&gt;first node-exporter container&lt;/strong&gt; on all servers. We move on to the second role which is called &lt;strong&gt;deployCadvisor&lt;/strong&gt;, which will, as you can guess, deploy &lt;strong&gt;cadvisor&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvm92i4yjca367vp57mry.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvm92i4yjca367vp57mry.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the last role called &lt;strong&gt;deployGrafana&lt;/strong&gt; will take care of deploying the &lt;strong&gt;Prometheus&lt;/strong&gt;, &lt;strong&gt;Grafana&lt;/strong&gt;, and &lt;strong&gt;Alertmanager containers&lt;/strong&gt;. As well as the configuration files inside the services.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fowzr4e9jlfhbi3lud5t0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fowzr4e9jlfhbi3lud5t0.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And here is the result after the deployment of your services!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp0o52pwuc2uarlf9ur2h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp0o52pwuc2uarlf9ur2h.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Grafana&lt;/strong&gt; collects all the &lt;strong&gt;data&lt;/strong&gt; via &lt;strong&gt;prometheus&lt;/strong&gt; and allows you to &lt;strong&gt;display&lt;/strong&gt; it on your &lt;strong&gt;web interface&lt;/strong&gt;!&lt;br&gt;
I thought of importing you &lt;strong&gt;two tables to monitor your environments&lt;/strong&gt;, one called '&lt;strong&gt;Docker&lt;/strong&gt; &lt;strong&gt;Monitoring&lt;/strong&gt;' &amp;amp; the other '&lt;strong&gt;Infrastructure&lt;/strong&gt; &lt;strong&gt;Monitoring&lt;/strong&gt;'.&lt;br&gt;
If you want to access it, nothing could be simpler, click on&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqwfvwok0rn5pf9cfetij.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqwfvwok0rn5pf9cfetij.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And click on the dashboard that you want to display.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwbeoosit9gihpe6mhrdc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwbeoosit9gihpe6mhrdc.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;Here is a quick overview of the data that you will be able to recover and view.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi45tih5v8yn7nge80w13.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi45tih5v8yn7nge80w13.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiwx9te9tjbwxarkh9hr6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiwx9te9tjbwxarkh9hr6.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can very well imagine this kind of solution in a &lt;strong&gt;CI/CD&lt;/strong&gt; if you want to &lt;strong&gt;automate&lt;/strong&gt; the &lt;strong&gt;deployment&lt;/strong&gt; from a &lt;strong&gt;pipeline&lt;/strong&gt;. It can also be useful to you in a &lt;strong&gt;DRP&lt;/strong&gt; to deploy in an &lt;strong&gt;automated&lt;/strong&gt; way a &lt;strong&gt;simple&lt;/strong&gt; &lt;strong&gt;but effective supervision&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;br&gt;
I hope you enjoyed this tutorial and if you have any feedback for me, please do not hesitate!&lt;/p&gt;

</description>
      <category>ansible</category>
      <category>docker</category>
      <category>monitoring</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
