<?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"><channel><title><![CDATA[AlexRJS blogs]]></title><description><![CDATA[I'm in I.T. since 1984 when I started my education to become an I.T. engineer. So I've seen many things in I.T. and did my share in bringing I.T. forward.]]></description><link>https://blog.arjs.net</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1636294639477/ESy9WM1VC.png</url><title>AlexRJS blogs</title><link>https://blog.arjs.net</link></image><generator>RSS for Node</generator><lastBuildDate>Sun, 08 Nov 2026 11:11:44 GMT</lastBuildDate><atom:link href="https://blog.arjs.net/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Review Top 5 2022 and Look ahead to next Top 5]]></title><description><![CDATA[Revisiting my Top 5 project ideas from May 2022 and my next Top 5 before Summer hiatus]]></description><link>https://blog.arjs.net/review-top-5-2022-and-look-ahead-to-next-top-5</link><guid isPermaLink="true">https://blog.arjs.net/review-top-5-2022-and-look-ahead-to-next-top-5</guid><category><![CDATA[Top]]></category><category><![CDATA[ideas]]></category><category><![CDATA[Status]]></category><dc:creator><![CDATA[Alex Schiessl]]></dc:creator><pubDate>Sun, 28 May 2023 08:00:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1685170526986/95ca5b0a-f38c-4139-bfd0-3cbff9700cb4.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Last year I shared my Top 5 project <a target="_blank" href="https://blog.arjs.net/my-top-5-ideas-for-the-next-12-month">ideas</a>. And I thought it would be time to revisit them and tell you what happened with them. And since my summer hiatus, from June to August, is coming up, this will be my last blog for some time. So it is fair to give you some input for the next time.</p>
<p><strong>Status Idea 1</strong>: <em>Jira Dashboard with Python and Node-Red Rest API</em></p>
<p>Initially, I was thrilled about the prospect of building a Jira dashboard using Python and the Node-RED REST API. The combination of Python's versatility and Node-RED's automation capabilities seemed like the perfect fit. However, as circumstances would have it, my priorities took an unexpected turn. It turned out that a colleague had already created a similar solution using Power BI and Excel. This revelation made me reconsider the immediate implementation of my "Jira Dashboard in Python with Node-RED REST API" idea, as it seemed redundant in light of my colleague's existing solution.</p>
<p>We had to go through a bit of trial and error to meet my specific requirements, but my colleague was able to accommodate the changes I requested. The process now involves accessing Jira, executing the desired filter, exporting the data into an Excel file, and then utilizing Power BI to create the dashboard. However, after watching some informative videos on Microsoft's Power Platform, I'm intrigued by the possibility of converting the dashboard into a Power App in the future. This idea has quickly become one of my top five priorities for the next 12 months, as it holds the potential to further enhance the functionality and accessibility of my Jira dashboard.</p>
<p><strong>Status Idea 2:</strong> <em>Python Sequence Chart/Flow Chart</em></p>
<p>Don't need to say much. Already done by someone else. No need to reimplement the wheel. Ok, not exactly what I wanted, but close enough to take the fun out of my journey. Have a look at <a target="_blank" href="https://github.com/PyWorkflowApp/visual-programming">PyWorkflow</a>, <a target="_blank" href="https://github.com/wonderworks-software/PyFlow">PyFlow</a>, <a target="_blank" href="https://github.com/cdfmlr/pyflowchart">PyFlowchart</a> or similar projects.</p>
<p><strong>Status Idea 3:</strong> <em>Concept Map in Python with</em> <a target="_blank" href="https://python.igraph.org/en/latest/index.html"><em>iGraph</em></a></p>
<p>Well, not done anything, yet. So still a valid option for my next Top 5.</p>
<p><strong>Status Idea 4:</strong> <em>Robot Football Simulator Game</em></p>
<p>Currently, the Robot Football Simulator Game idea is in a bit of a limbo state. While I have completed the Streaming Football Scoreboard component and made it available on <a target="_blank" href="http://projects.arjs.net">projects.arjs.net</a>, the actual development of the simulator game itself remains confined to my imagination. However, despite its current state, this idea holds a significant place in my top five priorities, as I am determined to bring it to life and transform it from a mere concept into a tangible and exciting project.</p>
<p><strong>Status Idea 5:</strong> <em>Flutter Desktop for macOS/linux</em></p>
<p>No news here. I've started with it, but after doing the initial Tutorial and I got the Desktop running on my MacOS Mac Mini. I lost interest more or less, since I didn't want to learn a new programming language, again.</p>
<p>I've learned so many programming languages during my career, so I decided to settle on Python, Javascript and once in a while C# or Java (the last two, because I've got a ton of old code I've written in those languages). And lately, I figured out how tkinter and <a target="_blank" href="https://github.com/TomSchimansky/CustomTkinter">customtkinter</a> work, and there are great <a target="_blank" href="https://www.youtube.com/watch?v=yQSEXcf6s2I&amp;list=PLCC34OHNcOtoC6GglhF3ncJ5rLwQrLGnV">videos on Youtube</a>. So this solution is good enough for my use cases. Don't need all the Android and iPhone/iPad stuff. Desktop on MacOS, Linux and luckily on Windows (WSL/Ubuntu) is enough.</p>
<h3 id="heading-whats-next">What's next</h3>
<p>I am constantly seeking new projects and ideas to challenge myself and expand my skill set. I have curated a list of my next top five ideas that I am eager to dive into. Ok, so here are my next Top 5 ideas I want to work on for next year.</p>
<p><strong>Idea 1:</strong> <em>Robot Football Simulator Game</em></p>
<p>One of my most captivating ideas involves bringing to life a Robot Football Simulator Game. Inspired by my love for both robotics and football, this project aims to create a virtual environment where robots engage in thrilling American football matches. From programming their movements and tactics to designing the game's interface, I am excited to transform this concept into an engaging and immersive experience. (Thank you ChatGPT ;-)). Not much to add. Simply bring the idea in my head alive.</p>
<p><strong>Idea 2:</strong> <em>(Special X-Mas Project) Convert my K3s cluster to a Docker Swarm cluster</em></p>
<p>To optimize the efficiency and maintenance of my home lab setup, I plan to convert my existing K3s cluster into a Docker Swarm cluster. While the K3s cluster has served me well, the growing demands (on my job, family and health) and time constraints call for a change. By embracing Docker Swarm and its scalability, I hope to streamline operations and enhance the overall performance of my projects. Furthermore, I intend to explore the trend of utilizing smaller hardware and possibly venture into the world of Proxmox in the future, with a used May Mini M1, which I plan to pick up from eBay. So another side project to work on.</p>
<p><strong>Idea 3:</strong> <em>Write a Power App for my Jira Dashboard with the Microsoft Power Platform</em></p>
<p>To enhance the functionality and automation of my Jira Dashboard, I aim to develop a Power App using the Microsoft Power Platform. While my existing Power BI Dashboard provides valuable insights, there is still room for improvement. By leveraging the Power Platform's capabilities, I can create a seamless and user-friendly application that further streamlines my project management processes, offering increased efficiency and productivity.</p>
<p><strong>Idea 4:</strong> <em>(Special Summer Project) Upgrade my daily driver hardware</em></p>
<p>As technology advances, it is crucial to stay up to date with the latest hardware to maximize productivity. Currently relying on a Mac Mini from late 2014, I have decided to embark on an upgrade journey. Over the summer, I plan to update it to Ventura using the <a target="_blank" href="https://github.com/dortania/OpenCore-Legacy-Patcher">OpenCore Legacy Patcher</a>, breathing new life into my trusted companion. Furthermore, depending on the announcements made at WWDC 2023, I may consider upgrading to a newer Mac Mini or exploring other options such as refurbished models or discounted MacBook Pro M2 Pro models, to replace my late 2013 MacBook Pro, running Ventra (with the help of OpenCore Legacy Patcher).</p>
<p><strong>Idea 5:</strong> <em>Bullet Point Journal with a Low-Code Platform</em></p>
<p>Reviving a past project, I am eager to revisit the concept of a Bullet Point Journal using a Low-Code Platform like AppSheet, BudiBase, or Power App. By transforming this idea into a web-based app with a simple data structure, I aim to create an efficient and personalized journaling experience. Leveraging the power of low-code development, I can quickly build the necessary functionalities while maintaining flexibility for future customization.</p>
<p><strong>Bonus Idea:</strong> <em>Concept Map in Python with iGraph</em></p>
<p>In addition to my top five ideas, I have a bonus concept that I am excited to explore if time permits. This idea involves creating a concept map using Python and iGraph library, building upon my recent knowledge acquisition in Python's tkinter and <a target="_blank" href="https://github.com/TomSchimansky/CustomTkinter">customtkinter</a>.</p>
<h3 id="heading-conclusion">Conclusion</h3>
<p>With my summer pause on the horizon, I am filled with anticipation and enthusiasm for the next tech ventures I have planned. So there's a lot to do from creating a captivating Robot Football Simulator Game to upgrading my hardware and enhancing my project management tools, each idea holds its promise and potential. So let's see what can I accomplish in the next 12 months.</p>
<p>As always apply this rule: "Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."</p>
<p>Have a good one. Alex</p>
<p>FYI: The article was relegated and partly (re-)written by ChatGPT. The original ideas and the raw concept of the blog article were done by me, a human. ;-)<br />The title image was created by bing.com/create after a prompt developed by me.<br />So other rights and reserves may apply to the text and the title image. My advice, view only, do not copy or re-use any of it. ;-)</p>
]]></content:encoded></item><item><title><![CDATA[My k8s journey continues... The Aftermath]]></title><description><![CDATA[Over my last three posts, I have shared some of my k8s anecdotes, detailing my experiences surviving since last Christmas. In this concluding entry of my…]]></description><link>https://blog.arjs.net/my-k8s-journey-continues-the-aftermath</link><guid isPermaLink="true">https://blog.arjs.net/my-k8s-journey-continues-the-aftermath</guid><category><![CDATA[k3s]]></category><category><![CDATA[Problem Solving]]></category><category><![CDATA[Kubernetes]]></category><dc:creator><![CDATA[Alex Schiessl]]></dc:creator><pubDate>Sun, 30 Apr 2023 08:00:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1682838045516/afe8be2e-4f74-45c5-b3fd-a97d07ff26e5.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Over my last three posts, I have shared some of my k8s anecdotes, detailing my experiences surviving since last Christmas. In this concluding entry of my adventure series, I aim to bring closure to this chapter of my k8s journey.</p>
<p>Within this blog post, I will delve into topics such as hardware, k8s workload, resolving storage dilemmas, and k8s maintenance, providing a comprehensive overview of my journey with this technology.</p>
<p>But let's start...</p>
<h3 id="heading-hardware-issue">Hardware Issue</h3>
<p>As I discussed in my previous blog post detailing the construction of my k8s cluster, I arranged my five Raspberry Pi 4B+ devices in a stack. However, it soon came to my attention that one of the Pis was experiencing issues. The problem manifested in the form of intermittent reboots, which occurred unpredictably. Sometimes, the Pi would reboot after just one day, and at other times, it would run for over a week before restarting. There were even days when it would reboot twice.</p>
<p>Initially, I suspected that overheating might be the cause of the problem, so I adjusted the cooling fan that cools the Pis. However, this proved futile. I also checked if any script was causing the reboots, but my efforts yielded no results. I tried to narrow down the issue by monitoring the system log using the command <code>journalctl -f -p 3</code>, but this too failed to provide any useful information. Switching from Ram-based logging to disk-based logging was also to no avail.</p>
<p>I even attempted to swap out the USB-C cable and tried changing where the cable was plugged into the power supply. Additionally, I updated the DietPi OS and the Raspberry Pi firmware regularly, replaced the network cable, and performed several other troubleshooting steps. However, none of these measures resolved the problem.</p>
<p>There are only three options that I have yet to try:</p>
<ul>
<li><p>Swapping out the USB stick from which the OS runs. However, doing this would require reconfiguring k8s and would entail several steps to bring it back to the same OS/k8s state it is currently in.</p>
</li>
<li><p>Switching to RaspbianOS instead of DietPi. This would be a time-consuming task and would require a lot of configuration work, similar to the previous option.</p>
</li>
<li><p>Changing the problematic Pi's position in the cluster stack. Unfortunately, this is the most challenging option as the faulty Pi is in the middle of the stack. It would necessitate disassembling the entire Pi cluster stack and reassembling it with a different Pi in the middle. It would take at least a day or two to confirm whether the Pi is still rebooting after making this change. Therefore, I have yet to attempt this.</p>
</li>
</ul>
<p>Despite knowing that I must ultimately address this problem, I am choosing to view it positively. I now have a Chaos Monkey in my k8s cluster, which enables me to check if the cluster remains stable even when one server is rebooting. Unfortunately, the unexpected reboots have had an unintended side effect, which I will describe in a section below.</p>
<h3 id="heading-k3s-maintenance">K3s Maintenance</h3>
<p>Just like with old steam and fuel engines, it's important to regularly check and maintain the oil, coolant, filters, and fuel/water levels of machines running k8s.</p>
<p>In my case, this means taking care of the OS, k3s, and the apps running on it.</p>
<p><strong>DietPi Update</strong></p>
<p>Let's start with the OS. Since I installed DietPi, I've decided to do updates every three months. First, to avoid too much disruption to a smoothly running system, and secondly, because it's time-consuming to update five Raspberry Pis.</p>
<p>Updating DietPi is straightforward. Use <code>dietpi-update</code> and follow the steps.</p>
<p>Tip: Before you do this, make sure you have disabled the "Headless" mode. I didn't do that, and I had to troubleshoot one of the Pis that got a different IP, and I could no longer reach it via SSH. I had to attach a keyboard and monitor to log in locally and fix the problem.</p>
<p>Other than that, DietPi is easy to update. The other Pis had no problem doing it this way. Also, make sure to read all the prompts during the update to avoid other surprises.</p>
<p><strong>K3s Update</strong></p>
<p>Updating K3s is also very easy but time-consuming. First, you need to drain the node you want to update. That's easily done with the Lens k8s management software. Also, set the node in suspend mode, which can also be done with the Lens app. After that, you can easily update the k3s server software. Just update <a target="_blank" href="https://k3sup.dev">k3sup (k3sup.dev)</a> to the newest version, which usually updates the version of k3s. Then run the install/join commands I used when I installed the original version. That's it. Rinse and repeat for all other Pis, and normally, this is a smooth operation.</p>
<p><strong>Image Update</strong></p>
<p>The image update is one of the more problematic updates. First, there is the problem of getting the information that there is a new image available. I haven't found a good solution for that yet. But when you become aware of a new image, then you have to dig through the documentation to see if and why you should update.</p>
<p>If you decide to update, there are two ways to do it. The first way is to update the image version in the k3s deployment config via the <code>Lens.app</code>, which is easily done, and Lens takes care of the update and the redeployment. Usually, it runs smoothly, but as I described already, in one case, it forced me to move the CouchDB instance back to a Docker host. This is time-consuming because of the research and decision-making. The actual doing is very easy in my opinion.</p>
<p>The second way to do it is to update the helm charts, which I will describe now.</p>
<p><strong>Updating Helm Charts</strong></p>
<p>Updating the Helm charts is theoretically very easy: download the newest version and redeploy. However, most of the time, Helm charts are not up to date. They don't use the latest image versions, or maintenance is abandoned. So you have to manually update the image in the Helm configs, with the danger that something goes wrong. And you have to figure out what Helm chart version to set.</p>
<p>In my case, I took the first route, but with that route, I lost compatibility with the original Helm charts. But I was willing to take that risk.</p>
<p>All in all, everything is manageable, but you need to plan time for troubleshooting and for the actual work.</p>
<h3 id="heading-gitea-problems">Gitea Problems</h3>
<p>Gitea is a great self-hosted Git service, but it is not immune to problems. In my case, a reboot, or if that matters, any reboot of one of the nodes or the NFS server, causes Gitea to stop working. It turned out that the NFS mount, which was used to store the Git repositories, was not being reused after the reboot. This causes Gitea to not be able to find the repositories and settings, and thus, not function properly.</p>
<p>To solve this issue, we needed to make sure that the NFS mount was being reused after the reboot. This was done by modifying the <code>fstab</code> file to include the "auto" option, which tells the system to automatically mount the NFS share at boot time. Once this was done, Gitea was able to access the repositories again but that wasn't all I had to fix.</p>
<p>However, we also encountered another problem. The Git repositories were being archived by k8s, even though I had set the NFS share to "Retain" mode. This was a serious issue, as I did not want to lose any repositories due to this error.</p>
<p>To solve this problem, I found on this k8s <a target="_blank" href="https://kubernetes.io/docs/tasks/administer-cluster/change-pv-reclaim-policy/">document page</a>, I needed to patch the Gitea PV configuration, with this command</p>
<pre><code class="lang-bash">kubectl patch pv &lt;your-pv-name&gt; -p <span class="hljs-string">'{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}'</span>
</code></pre>
<p>This command switches the default "ReclaimPolicy" from "Delete" to "Retain". This ensures that the repository is retained on the NFS share, even if the NFS or the k3s servers are rebooted. After making this change, I tested the system and found that the repositories were no longer being lost.</p>
<p>In the end, I was able to solve both the NFS mount reuse problem and the repository retention problem, and Gitea was once again functioning properly. However, it was a reminder that even the best self-hosted services can run into problems, and it is important to have a solid understanding of the system and its components to be able to troubleshoot and solve any issues that arise.</p>
<h3 id="heading-conclusion">Conclusion</h3>
<p>Yes, Kubernetes (k8s) is indeed powerful and versatile, but it can also be complex and requires patience to master its concepts and configurations. It took me some time to understand its deep complexities, and I still have more to learn. While I can manage to do some basic tasks, for more complex problems, I often rely on Google to find solutions. Although this approach may not be suitable for professional admins managing large k8s clusters, it works for me.</p>
<p>Would I use k8s again? No, I wouldn't. Most of the fancy features, such as rolling updates and zero downtime, are not necessary for me. My Docker host on my old Mac Mini ran without issues for years, and when I needed to update the OS or an image, it was easy and fast. In contrast, managing my five Raspberry Pi's with k8s requires significant time and effort, and I never know if I'll run into the same problems I've described earlier.</p>
<p>In the future, I plan to stick to my Linux server solution with Linux servers as Docker hosts. I'm interested in trying Docker Swarm this time, which only requires two Docker hosts. Although I have five k8s (4 k8s Pi's and one docker service host) Raspberry Pi's in service, I prefer to stick to two Pis and use the other three for other projects.</p>
<p>However, I have to say that I learned a lot about k8s, and I now have a better understanding of it, which is helpful when colleagues discuss it at the office. For that reason, I'm glad I took on this k8s adventure.</p>
<p>Well, let's see what the rest of the year brings in terms of k8s adventures.</p>
<p>As always apply this rule: "Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."</p>
<p>Have a good one. Alex</p>
]]></content:encoded></item><item><title><![CDATA[My k8s journey continues... Part III]]></title><description><![CDATA[True, my hate/love relationship with k8s is still going on, but I've to say, that all in all you can learn a lot, even if you don't use the know-how daily…]]></description><link>https://blog.arjs.net/my-k8s-journey-continues-part-iii</link><guid isPermaLink="true">https://blog.arjs.net/my-k8s-journey-continues-part-iii</guid><category><![CDATA[Kubernetes]]></category><category><![CDATA[Docker]]></category><category><![CDATA[knowledge sharing]]></category><dc:creator><![CDATA[Alex Schiessl]]></dc:creator><pubDate>Sun, 26 Mar 2023 08:00:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1679754891570/5026be3c-76eb-453f-9281-636538a8ae4b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-introduction">Introduction</h3>
<p>True, my hate/love relationship with k8s is still going on, but I've to say, that all in all you can learn a lot, even if you don't use the know-how daily at work. For me, it gives me an understanding of what my developers and ops people talk about when they prepare new environments and deployments.</p>
<p>So deploying standard applications to a k8s cluster is usually a mostly painless experience if you understood how it works. And if you are willing to dig into the actual yaml files or the helm charts on <a target="_blank" href="https://github.com">github.com</a>.</p>
<p>Basically, it is how to match the values.yaml file to the templates stored in the helm chart templates folder or if you use the k8s configuration files directly, where to enter what.</p>
<p>So I won't describe here how I installed my standard applications, like Node-Red, Grafana, Uptime-Kuma, CouchDB and other Standard applications you can run at home for your pleasure, needs or convenience.</p>
<p>Today, I want to describe how I figured out to deploy my own little very simple CMDB application to k8s. The CMDB app is a very simple adoption of Typicode's json-server, which can be found <a target="_blank" href="https://github.com/typicode/json-server">here</a>.</p>
<p>My CMDB server which ran for years on Docker now has to move to k8s, since my Mac Mini 2007 has moved back into its original packaging and is no longer available for hosting it.</p>
<p>So let us start.</p>
<h3 id="heading-preparation">Preparation</h3>
<p>The CMDB server ran on Docker with a compose file. Here it is:</p>
<pre><code class="lang-yaml"><span class="hljs-attr">version:</span> <span class="hljs-string">'3.7'</span>

<span class="hljs-attr">volumes:</span>
  <span class="hljs-attr">cmdbfs:</span>
    <span class="hljs-attr">driver:</span> <span class="hljs-string">local</span>
    <span class="hljs-attr">driver_opts:</span>
      <span class="hljs-attr">o:</span> <span class="hljs-string">bind</span>
      <span class="hljs-attr">type:</span> <span class="hljs-string">none</span>
      <span class="hljs-attr">device:</span> <span class="hljs-string">/data/cmdb</span>

<span class="hljs-attr">networks:</span>
  <span class="hljs-attr">default:</span>
    <span class="hljs-attr">name:</span> <span class="hljs-string">dhcp</span>
    <span class="hljs-attr">external:</span> <span class="hljs-literal">true</span>

<span class="hljs-attr">services:</span>
  <span class="hljs-attr">cmdb:</span>
    <span class="hljs-attr">build:</span> <span class="hljs-string">.</span>
    <span class="hljs-attr">container_name:</span> <span class="hljs-string">cmdb</span>
    <span class="hljs-attr">image:</span> <span class="hljs-string">'arjsnet/jsondb/cmdb:latest'</span>
    <span class="hljs-attr">hostname:</span> <span class="hljs-string">cmdb.arjs.net</span>
    <span class="hljs-attr">ports:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-number">80</span><span class="hljs-string">:80</span>
    <span class="hljs-attr">volumes:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">cmdbfs:/usr/database</span>
    <span class="hljs-attr">restart:</span> <span class="hljs-string">always</span>
    <span class="hljs-attr">networks:</span>
      <span class="hljs-attr">default:</span>
        <span class="hljs-attr">ipv4_address:</span> <span class="hljs-number">192.168</span><span class="hljs-number">.1</span><span class="hljs-number">.192</span>
    <span class="hljs-attr">dns:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-number">192.168</span><span class="hljs-number">.1</span><span class="hljs-number">.234</span>
      <span class="hljs-bullet">-</span> <span class="hljs-number">192.168</span><span class="hljs-number">.1</span><span class="hljs-number">.1</span>
    <span class="hljs-attr">dns_search:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">fritz.box</span>
</code></pre>
<p>To easily transform this docker-compose file to a helm chart, there is a neat little tool, called "kompose" which can be found <a target="_blank" href="https://kompose.io/">here</a>.</p>
<p>After installing it, follow the "User Guide" to convert your docker-compose.yaml to a basic helm chart.</p>
<p>Tip: Rename your docker-compose.yaml first to the desired chart name. So in my case, I renamed it to cmdb.yaml, so the result was generated in a folder named "cmdb". Or use the option "--chart-name cmdb".</p>
<p>In the newly created folder, you find the following files:</p>
<ul>
<li><p>Chart.yaml</p>
</li>
<li><p>README.md</p>
</li>
<li><p>templates folder, with cmdb-deployment.yaml, cmdb-service.yaml and cmdbfs-persistentvolumeclaim.yaml</p>
</li>
</ul>
<p>Of course, if you try to deploy this basic helm chart, you will fail. Some files were missing.</p>
<p>I had to add a logo file "cmdb.png" (simply a generic logo created by a tool), empty "values.yaml" file - I know kinda lazy of me, to change the values directly in the templates files - and a "cmdb-ingress.yaml" file, so I could have a nice domain name to access it.</p>
<p>The domain name with a static load balancer IP was added already in Pi-Hole DNS, so there was no delay testing it.</p>
<h3 id="heading-1st-deployment">1st Deployment</h3>
<p>Of course, it went wrong. Spelling errors, indention errors and wrong syntax. So make sure you use the checking tool of your choosing to avoid those.</p>
<p>After that the real troubleshooting process.</p>
<p>Problems I encountered following the 1st deployment:</p>
<ol>
<li><p>Settings in the docker-compose.yaml file that didn't translate to a helm chart</p>
</li>
<li><p>How to add an insecure registry to Kubernetes</p>
</li>
<li><p>Tag problems of the actual container to deploy</p>
</li>
<li><p>Push not working (spoiler: Of course a DNS problem)</p>
</li>
<li><p>The pull not working (another spoiler: DNS, again)</p>
</li>
<li><p>Again, build problems</p>
</li>
</ol>
<h3 id="heading-setting-fixes">Setting fixes</h3>
<p>The first conversion to a Chart was painless, cause kompose can handle docker-compose.yaml files very well. But what I recognized after the first deployment, some settings in the original docker-compose file were not needed so I fixed them:</p>
<ol>
<li><p>Remove network settings:</p>
<pre><code class="lang-yaml">
 <span class="hljs-attr">networks:</span>
   <span class="hljs-attr">default:</span>
     <span class="hljs-attr">name:</span> <span class="hljs-string">dhcp</span>
     <span class="hljs-attr">external:</span> <span class="hljs-literal">true</span>

 <span class="hljs-string">...</span>

     <span class="hljs-attr">networks:</span>
       <span class="hljs-attr">default:</span>
         <span class="hljs-attr">ipv4_address:</span> <span class="hljs-number">192.168</span><span class="hljs-number">.1</span><span class="hljs-number">.192</span>
</code></pre>
</li>
<li><p>DNS removal</p>
<pre><code class="lang-yaml">     <span class="hljs-attr">dns:</span>
       <span class="hljs-bullet">-</span> <span class="hljs-number">192.168</span><span class="hljs-number">.1</span><span class="hljs-number">.234</span>
       <span class="hljs-bullet">-</span> <span class="hljs-number">192.168</span><span class="hljs-number">.1</span><span class="hljs-number">.1</span>
     <span class="hljs-attr">dns_search:</span>
       <span class="hljs-bullet">-</span> <span class="hljs-string">fritz.box</span>
</code></pre>
</li>
</ol>
<h3 id="heading-insecure-registry-fixes">Insecure registry fixes</h3>
<p>"k3s" uses by default the docker images for the initial container image download. So usually you would upload your image to docker hub and k3s would load it from there.</p>
<p>I decided against it. I want to avoid putting stuff on docker hub which is just for my purposes. So I looked for a way to add my own image registry to the k3s cluster.</p>
<p>Some googling brought me to the blog of Luis Enrique Limon - "Soo broken" with an article that explains exactly that. Link <a target="_blank" href="https://llimon.github.io/post/k3s-registry/">here</a>.</p>
<p>Additionally, I consulted the official documentation of "k3s". Link <a target="_blank" href="https://docs.k3s.io/installation/private-registry">here</a>.</p>
<p>So I created the initial "registries.yaml" with this content:</p>
<pre><code class="lang-yaml"><span class="hljs-attr">mirrors:</span>
  <span class="hljs-attr">"registry.fritz.box":</span>
    <span class="hljs-attr">endpoint:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">"http://registry.fritz.box"</span>
<span class="hljs-attr">configs:</span>
  <span class="hljs-attr">tls:</span>
    <span class="hljs-attr">insecure_skip_verify:</span> <span class="hljs-literal">true</span>
</code></pre>
<p>The "tls" option I found is needed, if you, like me, have no SSL certificates in place.</p>
<p>This file needs to be distributed to all k3s servers and agents. So they can download the container image.</p>
<h3 id="heading-tag-fixes">Tag fixes</h3>
<p>The experienced and observant reader would have noticed that I have used a big "NO NO" in my docker-compose file. Yes, it ist the "latest" tag at the container image. The best practice is to use an explicit version tag. Consequently, I had to tag my image.</p>
<pre><code class="lang-bash"> docker tag 0e5574283393 arjsnet/jsondb/cmdb:v1.0.0
</code></pre>
<p>Since I've not used a tag before, besides the "latest", which was given by docker by default, I had now two images listed in the local registry information.</p>
<p>So another fix was needed, this time in the docker-compose file and also in the generated Chart file cmdb-deployment.yaml:</p>
<pre><code class="lang-yaml"><span class="hljs-comment"># docker-compose</span>
<span class="hljs-attr">image:</span> <span class="hljs-string">'arjsnet/jsondb/cmdb:v1.0.0'</span>

<span class="hljs-comment"># cmdb-deployment.yaml</span>
<span class="hljs-attr">image:</span> <span class="hljs-string">registry.fritz.box/arjsnet/jsondb/cmdb:v1.0.0</span>
</code></pre>
<h3 id="heading-push-and-pull-fixes">Push and pull fixes</h3>
<p>Of course, if you don't push the image to the remote registry, it doesn't work. I found it out the hard way because I got errors when I installed the helm chart to my k3s cluster. I forgot to push the local image</p>
<pre><code class="lang-bash">docker push registry.fritz.box/arjsnet/jsondb/cmdb:v1.0.0
</code></pre>
<p>With that fix, I could finally pull the image on the "k3s" container image, when I used the helm command to install my little cmdb:</p>
<pre><code class="lang-bash">helm upgrade --install cmdb cmdb --values cmdb/values.yaml
</code></pre>
<h3 id="heading-the-final-build-problem-fixed">The final build problem fixed</h3>
<p>Again, the experienced and observant reader would have noticed another problem, I found out at last. As I wrote in earlier blogs, my former docker host was an Intel Mac Mini from 2007 with a Ubuntu distribution. So my cmdb image was built on an Intel machine. This image was tagged and pushed to my registry, which now ran on an Arm-based Raspberry Pi.</p>
<p>No problem here, but the container was built as an Intel machine, but my k3s cluster is running on arm-based Raspberry Pi's. And of course, that produced errors on the k3s cluster.</p>
<p>So I had to find a way to build the image for my cmdb on an arm processor. After weighing all options, I decided to take out one k3s agent and convert it to an old-fashioned docker host.</p>
<p>It was not only the build system for arm alone. After using my k3s cluster for a while I noticed that the Raspberry Pi Zero 2W was not powerful enough.</p>
<p>I spare you the steps what to do to downgrade k3s (gladly there is a comfortable uninstall "/usr/local/bin/k3s-uninstall.sh" available) and install and prepare docker.</p>
<p>After that extra work, I was finally able to build my Dockerfile on an arm-based processor.</p>
<pre><code class="lang-bash">FROM node:current-alpine

WORKDIR /usr/database

RUN npm install -g json-server
HEALTHCHECK --interval=120s --timeout=15s --start-period=30s CMD wget -S --spider http://localhost/

EXPOSE 80

ENTRYPOINT [<span class="hljs-string">"json-server"</span>]
CMD [<span class="hljs-string">"--host"</span>, <span class="hljs-string">"0.0.0.0"</span>, <span class="hljs-string">"--port"</span>, <span class="hljs-string">"80"</span>, <span class="hljs-string">"--watch"</span>, <span class="hljs-string">"db.json"</span>]
</code></pre>
<p>Well, the rest is business as usual: Build, Tag, Push, Install</p>
<p>And here is the result, my cmdb server, based on json-server running in my k3s cluster:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1679754528268/3c91e108-c2fb-4397-96c0-8ecfec12c772.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-conclusion">Conclusion</h3>
<p>All in all, I learned a lot in this move from my docker-based setup to a k3s cluster-based setup.</p>
<p>Yes, there were pitfalls and a lot of frustration, a lot of researching the internet, reading a lot, understanding concepts and of course a good amount of trial and error.</p>
<p>But as Joda said once: "Failure a great teacher he is", my way was plastered with failures and I learned a lot in that way.</p>
<p>As always apply this rule: "Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."</p>
<p>Have a good one. Alex</p>
]]></content:encoded></item><item><title><![CDATA[My k8s journey continues... Part II]]></title><description><![CDATA[... In the last part, you could read about the beginning of my k8s journey. The rescue of my Monitor Raspberry Pi, and the build of my 5 Raspberry Pi k8s…]]></description><link>https://blog.arjs.net/my-k8s-journey-continues-part-ii</link><guid isPermaLink="true">https://blog.arjs.net/my-k8s-journey-continues-part-ii</guid><category><![CDATA[Kubernetes]]></category><category><![CDATA[Problems]]></category><category><![CDATA[solutions]]></category><dc:creator><![CDATA[Alex Schiessl]]></dc:creator><pubDate>Sun, 26 Feb 2023 09:00:44 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1676658565598/751882a4-7193-4130-926a-8021749f5b02.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>... In the last part, you could read about the beginning of my k8s journey. The rescue of my Monitor Raspberry Pi, and the build of my 5 Raspberry Pi k8s cluster. Also the basic setup with DietPi OS.</p>
<p>In part II, I want to show how I did the k8s setup and solved a problem on the way.</p>
<h2 id="heading-the-k8s-setup">The k8s setup</h2>
<p>Since I'm a fan of <a target="_blank" href="https://k3sup.dev">k3sup</a> (spoken like ketchup), which was written by <a target="_blank" href="https://github.com/alexellis">Alex Ellis</a> and I used it for the setup of my previous k3s cluster I used for almost a year. So it was an easy choice to use k3sup again for the new cluster.</p>
<p>The Pi's had an OS (<a target="_blank" href="https://dietpi.com/">DietPi</a>), an NFS mount (done with dietpi-drive_manager) and a custom node_exporter (<a target="_blank" href="https://github.com/cavaliercoder/rpi_export">rpi_exporter</a> by <a target="_blank" href="https://github.com/cavaliercoder/">Ryan Amstrong</a>) for prometheus data collection.</p>
<p>As IP's I used the static 192.168.0.50 and up. I used this range since I configured the DHCP to end dynamic IP's at x.x.x.49. And so I could match the IP's to the numbers of the PI's. So x.x.x.51 would be k3s01, aso.</p>
<p>So here are the six easy commands for my k3s setup:</p>
<pre><code class="lang-bash">k3sup install --ip 192.168.0.51 --user dietpi --cluster --k3s-extra-args <span class="hljs-string">'--write-kubeconfig-mode=644'</span>
k3sup join --ip 192.168.0.52 --user dietpi --server --server-ip 192.168.0.51 --server-user dietpi --k3s-extra-args <span class="hljs-string">'--write-kubeconfig-mode=644'</span>
k3sup join --ip 192.168.0.53 --user dietpi --server --server-ip 192.168.0.51 --server-user dietpi --k3s-extra-args <span class="hljs-string">'--write-kubeconfig-mode=644'</span>
k3sup join --ip 192.168.0.54 --user dietpi --server-ip 192.168.0.51
k3sup join --ip 192.168.0.55 --user dietpi --server-ip 192.168.0.51
k3sup ready --context default
</code></pre>
<p>I downloaded the k3sup on my mac mini (late 2014 model), which I also equipped with helm and kubectl. But before I could execute the commands I had to do some preparations.</p>
<p>As you might have spotted I used the default non-root user "dietpi". And since I use k3sup on mac, I have to configure all 5 Pi's for remote access via ssh. So I used the trusty old command "ssh-copy-id", again.</p>
<pre><code class="lang-bash">ssh-copy-id -i ~/.ssh/id_rsa.pub dietpi@192.168.0.51
ssh-copy-id -i ~/.ssh/id_rsa.pub dietpi@192.168.0.52
ssh-copy-id -i ~/.ssh/id_rsa.pub dietpi@192.168.0.53
ssh-copy-id -i ~/.ssh/id_rsa.pub dietpi@192.168.0.54
ssh-copy-id -i ~/.ssh/id_rsa.pub dietpi@192.168.0.55
</code></pre>
<p>After verification that the command "ssh dietpi@&lt;k3sMachineIp&gt;" worked, I could execute the k3sup commands. And after copy/paste adjust I had a running k3s cluster. Very easy and simple.</p>
<p>Ok, so what do the k3sup commands do?</p>
<p>So for the servers .51-.53 are control plane nodes, .54 and .55 are worker nodes. To start a new cluster you have to use these k3sup arguments:</p>
<ul>
<li><p>install --&gt; For installation of the new cluster</p>
</li>
<li><p>--ip x.x.x.x --&gt; The IP of the 1st control-plane node</p>
</li>
<li><p>--cluster --&gt; To signal you will add more control-plane nodes</p>
</li>
<li><p>--user dietpi --&gt; What user to use for remoting into the server</p>
</li>
<li><p>--k3s-extra-args '--write-kubeconfig-mode=644' --&gt; With this you can change the access mode for the generated "kubeconfig"; I'm not sure if the problem I had last year, with access problems, still exists, but this solved it and I thought it couldn't hurt.</p>
</li>
</ul>
<p>For the other control-plan nodes you have to use these arguments:</p>
<ul>
<li><p>join --&gt; Signals that you join an existing cluster</p>
</li>
<li><p>--ip 192.168.0.xx --&gt; What server to join</p>
</li>
<li><p>--user dietpi --&gt; What user to use for remoting</p>
</li>
<li><p>--server --&gt; The role the new server should use</p>
</li>
<li><p>--server-ip --&gt; The IP of the first control-plane node</p>
</li>
<li><p>--server-user --&gt; The user to use for remote into the server</p>
</li>
<li><p>----k3s-extra-args '--write-kubeconfig-mode=644' --&gt; With this you can change the access mode for the generated "kubeconfig"; I'm not sure if this is needed for additional control-plane nodes, but I left it there.</p>
</li>
</ul>
<p>And at last, to join some simple worker nodes, you have to use these arguments:</p>
<ul>
<li><p>join --&gt; Signals that you join an existing cluster</p>
</li>
<li><p>--ip 192.168.0.xx --&gt; What server to join</p>
</li>
<li><p>--user dietpi --&gt; What user to use for remoting</p>
</li>
<li><p>--server-ip --&gt; The IP of the first control-plane node</p>
</li>
</ul>
<p>And with the final command "k3sup ready --context default" you can extract the kubeconfig for the local ~/.kube/config.</p>
<p>After adding the new config to the .kube/config on my main mac, and switching the context to the new k3s cluster, the kubectl should work. But of course it didn't. Ja, you are right, usually, you get a kubeconfig with 127.0.0.1. So moving a kubeconfig to a machine would not work without adapting the ip.</p>
<p>But since I now have 3 k3s servers, what IP to pick? After I did an hour's research I figured out, I need a load balancer. But my FritzBox does not have a load-balancing setting. Nor does the pi-hole software. It has DNS, but no load balancing. So I did the next best thing I know. Using nginx. I installed it quickly on my monitorpi, googled how to do a load balancing config for nginx.</p>
<pre><code class="lang-bash">user  nginx;
worker_processes  auto;

error_log  /var/<span class="hljs-built_in">log</span>/nginx/error.log notice;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}

stream {
    upstream k3s {
        server 192.168.0.51:6443;
        server 192.168.0.52:6443;
        server 192.168.0.53:6443;
    }

    server {
        listen 6443;
        proxy_pass k3s;
    }

    upstream k3s_ssh {
        server 192.168.0.51:22;
        server 192.168.0.52:22;
        server 192.168.0.53:22;
    }

    server {
        listen 22;
        proxy_pass k3s_ssh;
    }
}
</code></pre>
<p>As you see, I had not only to load balance the usual 6443 port for the k8s api, also port 22 needed to be load balanced. I'm not sure why, but it was suggested in one of the load balancing articles.</p>
<p>So quickly added a kubernetes.local setting to pi-hole dns, with the IP from monitorpi. And now I was ready to fix the .kube/config on my main mac to that IP and voila, kubectl was working. And helm worked to.</p>
<pre><code class="lang-bash">kubectl get nodes -o wide
NAME    STATUS   ROLES                       AGE   VERSION        INTERNAL-IP    EXTERNAL-IP   OS-IMAGE                         KERNEL-VERSION   CONTAINER-RUNTIME
k3s01   Ready    control-plane,etcd,master   33d   v1.25.5+k3s2   192.168.0.51   &lt;none&gt;        Debian GNU/Linux 11 (bullseye)   5.15.84-v8+      containerd://1.6.14-k3s1
k3s02   Ready    control-plane,etcd,master   33d   v1.25.5+k3s2   192.168.0.52   &lt;none&gt;        Debian GNU/Linux 11 (bullseye)   5.15.84-v8+      containerd://1.6.14-k3s1
k3s03   Ready    control-plane,etcd,master   33d   v1.25.5+k3s2   192.168.0.53   &lt;none&gt;        Debian GNU/Linux 11 (bullseye)   5.15.84-v8+      containerd://1.6.14-k3s1
k3s04   Ready    &lt;none&gt;                      33d   v1.25.5+k3s2   192.168.0.54   &lt;none&gt;        Debian GNU/Linux 11 (bullseye)   5.15.84-v8+      containerd://1.6.14-k3s1
k3s05   Ready    &lt;none&gt;                      33d   v1.25.5+k3s2   192.168.0.55   &lt;none&gt;        Debian GNU/Linux 11 (bullseye)   5.15.84-v8+      containerd://1.6.14-k3s1
</code></pre>
<p>So as a final step, to prepare my k3s cluster for starting to get workloads, was to configure <a target="_blank" href="https://k8slens.dev/">lens.app</a>. Add it was a breeze. Simply download it, run it and select the cluster (.kube/config is used) you want to open and you're done.</p>
<p>I only had to enable the Lens Metrics and wait for a few minutes and lens was ready to help me transfer my applications.</p>
<p><img src alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1677324761306/1483c17c-0ed8-4923-a207-ebbcc09b22dd.png" alt class="image--center mx-auto" /></p>
<p>But that's a story for the next blog...</p>
<p>As always apply this rule: "Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."</p>
<p>Have a good one. Alex</p>
]]></content:encoded></item><item><title><![CDATA[My k8s journey continues... Part I...]]></title><description><![CDATA[So, a new year, and a lot of time to continue some adventures over the Xmas holiday break. After the usual visit to my family's place, I came home and was…]]></description><link>https://blog.arjs.net/my-k8s-journey-continues-part-i</link><guid isPermaLink="true">https://blog.arjs.net/my-k8s-journey-continues-part-i</guid><category><![CDATA[k8s]]></category><category><![CDATA[Raspberry Pi]]></category><category><![CDATA[hardware]]></category><dc:creator><![CDATA[Alex Schiessl]]></dc:creator><pubDate>Sun, 29 Jan 2023 09:00:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1673202929857/d950d29f-fa2e-4ab6-a134-f79d12c97fb5.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>So, a new year, and a lot of time to continue some adventures over the Xmas holiday break. After the usual visit to my family's place, I came home and was surprised with a broken k8s cluster. So I thought. But after some investigation, I found out, that both of my Raspberry Zeros had problems. So the k8s cluster was not broken, only the supporting Zeros.</p>
<p>My Raspi Zero WH, which runs as my primary Pi Hole/DNS and collects data from my weather sensors, had Storage card problems. Somehow during the last few weeks, the SD card got a filesystem error which resulted in memory errors and system crashes. So first system reconstruction.</p>
<p>Then my second Raspi Zero 2W, which runs a desktop raspberry os, ran out of memory, cause the Chromium browser used up all the memory and since this Raspi was also configured as my secondary Pi Hole/DNS, via keepalived and gravity sync, it had to jump in since the primary Pi Hole service was no longer stable, it started crashing, too. So the second system needs a new setup.</p>
<p>My brother got me a used Raspi Pi 4B 8GB from a friend of his, as Xmas present, but I don't care these days where a Raspi Pi falls in my hands, so I wanted to set up my k8s cluster Raspi's, too. Another 5 systems waiting for a setup, configuration and installation.</p>
<h2 id="heading-repair-of-weather-pi">Repair of Weather Pi</h2>
<p>Originally I wanted to use <a target="_blank" href="https://dietpi.org">DietPi OS</a> whenever I had time to install this Raspi. But unfortunately, I couldn't get it to work. I tried DietPi OS for armv6, armv7 and armv8, but I always got a boot error, with a kernel panic. Don't know why and how to fix it, but after 5 or 6 tries I gave up and went back to the 32-bit Raspberry OS lite.</p>
<p>This installation was painless. I installed only nginx as only additional software. With ansible, I installed my python program for serving a simple web page with the current weather data via uwsgi (as a service) and nginx.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1673282691306/e83a00f9-1a4c-4b98-a4a5-1d75b5559511.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1673282936843/53442b89-4e1a-4625-95b9-efbae1caff3a.png" alt class="image--center mx-auto" /></p>
<p>The second program, I installed, also via ansible, was the service, also a python program, that pushes the sensor data every ten minutes to a CouchDB. I described this software in a blog last year.</p>
<p>Since I'm not sure how stable the SD card is, I decided not to install Pi-Hole/DNS anymore. I will move my primary Pi-Hole/DNS to one of the Raspi Pi 4B's.</p>
<h2 id="heading-the-monitor-raspi">The Monitor Raspi</h2>
<p>So one down, 6 to go. The Monitor Raspi Pi was easy to fix. I stopped the Chromium browser for now. So now Monitor at the moment. And it currently is not needed, since it shows Uptime-Kuma and the Weather Dashboard (via Node-Red) and those services only run, when the k8s run. And since I'm going to set up this cluster, no need for a Monitor. For the moment this Raspi will be the primary Pi-Hole/DNS service. "keepalived" is disabled for now, too.</p>
<p>As soon as my new k8s cluster is running again, I configure this Raspi as a secondary (fallback) Pi-Hole/DNS, again. I use "keepalived" and "Gravity Sync". Have a lock at this video and the <a target="_blank" href="https://docs.technotim.live/posts/keepalived-ha-loadbalancer/">documentation</a> from Techno Tim.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=IFVYe3riDRA">https://www.youtube.com/watch?v=IFVYe3riDRA</a></div>
<p> </p>
<p>And of course, I enable the Chromium browser for displaying the Dashboards again, too. But this will take some time.</p>
<h2 id="heading-plans-for-the-new-k8s-cluster">Plans for the new k8s cluster</h2>
<p>Ok, after collecting Raspberry Pi's for 1,5 years, now, I have 5 of them. 2 x 4B's with 8 GB and 3 x 4B with 4 GB. Have a look at the Infrastructure Architecture.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1674838050244/2cdc4ada-f6f1-45e3-b84c-d7ae466200d3.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-hardware-i-want-to-use">Hardware I want to use:</h3>
<ul>
<li><p>5 Raspi Pi's 4B (2x8GB, 3x4GB)</p>
</li>
<li><p>1 used 250 GB Crucial SSD</p>
</li>
<li><p>4 Inteso 32 GB USB Sticks</p>
</li>
<li><p>2 new 1TB M2 SSDs for storage as a replacement for my disk share on my old Mac Mini from 2007, which soon will go into retirement</p>
</li>
<li><p>1 Raspi Pi Power Adapters</p>
</li>
<li><p>1 USB 60W 4-Port (2 USB-C, 2 USB-A) UGREEN Power Brick</p>
</li>
<li><p>1 Noctua 120mm Premium Fans, 5V versions, with USB Adapter</p>
</li>
<li><p>1 6-time stackable Pi Mounting rack</p>
</li>
<li><p>1 Netgear 8 Port 1GB Switch</p>
</li>
<li><p>5 0,25m Cat 6 Network cables</p>
</li>
<li><p>1 USB Fan Speed Regulator</p>
</li>
<li><p>1 Ikea Alu Box</p>
</li>
</ul>
<h3 id="heading-software-i-want-to-use">Software I want to use:</h3>
<ul>
<li><p><a target="_blank" href="https://dietpi.org">DietPi OS 8.13.2</a></p>
</li>
<li><p><a target="_blank" href="https://k3sup.dev/">k3sup</a> for k8s setup</p>
</li>
<li><p><a target="_blank" href="https://www.docker.com">Docker</a> for Load Balancing (nginx), Prometheus and Portainer</p>
</li>
<li><p>NFS (DietPi) as NFS Server and Backup Server</p>
</li>
<li><p><a target="_blank" href="https://pi-hole.net/">Pi-Hole/DNS</a></p>
</li>
<li><p><a target="_blank" href="https://github.com/acassen/keepalived">Keepalived</a> for Pi-Hole/DNS</p>
</li>
<li><p><a target="_blank" href="https://hub.docker.com/_/nginx">nginx</a> as Load Balancer for the k8s cluster</p>
</li>
<li><p><a target="_blank" href="https://hub.docker.com/r/portainer/portainer">Portainer</a></p>
</li>
<li><p>Prometheus</p>
</li>
<li><p>Grafana</p>
</li>
<li><p>Uptime-Kuma</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1674838819585/23ab1453-0658-4cfc-a550-0fc037994b0a.jpeg" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1674838778790/a25ba740-67d8-4418-b008-886b387a95b9.jpeg" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1674838746859/1b16d4fe-e797-4161-8012-a54e9742646e.jpeg" alt class="image--center mx-auto" /></p>
<p>So I built the cluster over the last few weeks and now it is up and running.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1674838951628/72502751-45e9-4bd0-9378-1dc87bd2d6a5.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1674838970385/7bad4402-2e52-479e-b4a0-f1842362885c.png" alt class="image--center mx-auto" /></p>
<p>Next steps are to fill the cluster with life... Grafana... Uptime... Heimdall... Databases... Node-Red... Portainer... Gitea... Drone...</p>
<p>And of course when all the services are moved from my old 2007 Mac Mini (Ha... 12 Years in Service, since 2011, when I bought it used, beat that M2 Mac Mini ;-) ), I can eventually retire him. I pack him in his original package, yes still have it, and put the box in a safe place. Who knows, if I don't need this old fellow in the future, again.</p>
<p>So my k8s cluster adventures continue...</p>
<p>As always apply this rule: "Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."</p>
<p>Have a good one. Alex</p>
]]></content:encoded></item><item><title><![CDATA[(ChatGPT) AI helped me write my short story...]]></title><description><![CDATA[... and other stuff, too]]></description><link>https://blog.arjs.net/chatgpt-ai-helped-me-write-my-short-story</link><guid isPermaLink="true">https://blog.arjs.net/chatgpt-ai-helped-me-write-my-short-story</guid><category><![CDATA[Python 3]]></category><category><![CDATA[chatgpt]]></category><category><![CDATA[Story]]></category><dc:creator><![CDATA[Alex Schiessl]]></dc:creator><pubDate>Sun, 18 Dec 2022 09:00:42 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1671010018264/7WiNeFuQh.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Merry X-Mas to everyone... I'm a little early, I know, but since next weekend I do not want to spend my time writing a blog, it's X-Mas you know ;-), I use a little time window to tell you about my little <a target="_blank" href="https://chat.openai.com/chat">ChatGPT</a> adventure.</p>
<p>When I first heard about the ChatGPT from OpenAI on the <a target="_blank" href="https://www.youtube.com/watch?v=Luz82RG5PqA">Wan Show</a> a few days ago, I was a little skeptical, why Luke was so enthusiastic about it. But when I tried it out, I was impressed, too.</p>
<p>Of course I tried the samples, I tried out some crazy stuff, like <a target="_blank" href="https://www.reddit.com/r/ChatGPT/comments/zljine/chatgpt_can_emulate_windows_command_prompt_and/">Windows Console Window</a>, but rather fast I turned to programming. Python3 programming that is.</p>
<p>So for quite some time I wanted a small little tool, that could identify duplicate files in my huge python folder. Ja, I know, I copy over a lot of code, and I should use modules for that, but sometimes idea to result, needs to be fast for me, hence cutting corners.</p>
<p>Anyway, so I wrote a prompt, like this:</p>
<blockquote>
<p>Write me a short python3 tool, which compares recursively all python files from a given folder, against a sqlite database, if the file is a duplicate of another file.  </p>
</blockquote>
<p>And it came up with this:</p>
<pre><code><span class="hljs-keyword">import</span> os
<span class="hljs-keyword">import</span> hashlib
<span class="hljs-keyword">import</span> sqlite3

def is_python_file(file_name):
    <span class="hljs-keyword">return</span> file_name.endswith(<span class="hljs-string">".py"</span>)

def get_file_hash(file_path):
    <span class="hljs-keyword">with</span> open(file_path, <span class="hljs-string">"rb"</span>) <span class="hljs-keyword">as</span> f:
        <span class="hljs-keyword">return</span> hashlib.sha256(f.read()).hexdigest()

def check_for_duplicates(folder_path, db_path):
    # Connect to the SQLite database
    conn = sqlite3.connect(db_path)
    c = conn.cursor()

    # Create the table <span class="hljs-keyword">if</span> it doesnt already exist
    c.execute(<span class="hljs-string">"CREATE TABLE IF NOT EXISTS hashes (file_hash TEXT PRIMARY KEY, file_path TEXT)"</span>)

    # Walk through the folder recursively and check <span class="hljs-keyword">for</span> duplicates
    <span class="hljs-keyword">for</span> root, dirs, files <span class="hljs-keyword">in</span> os.walk(folder_path):
        <span class="hljs-keyword">for</span> file_name <span class="hljs-keyword">in</span> files:
            <span class="hljs-keyword">if</span> is_python_file(file_name):
                file_path = os.path.join(root, file_name)
                file_hash = get_file_hash(file_path)

                # Check <span class="hljs-keyword">if</span> <span class="hljs-built_in">this</span> file has already been processed
                c.execute(<span class="hljs-string">"SELECT * FROM hashes WHERE file_hash=?"</span>, (file_hash,))
                <span class="hljs-keyword">if</span> c.fetchone() is not None:
                    print(<span class="hljs-string">"Found duplicate: {}"</span>.format(file_path))
                <span class="hljs-attr">else</span>:
                    # Add <span class="hljs-built_in">this</span> file to the database
                    c.execute(<span class="hljs-string">"INSERT INTO hashes VALUES (?, ?)"</span>, (file_hash, file_path))
                    conn.commit()

    # Close the database connection
    conn.close()

# Use the tool like <span class="hljs-built_in">this</span>:
check_for_duplicates(<span class="hljs-string">"/path/to/folder"</span>, <span class="hljs-string">"python_files.db"</span>)
</code></pre><p>Impressive, isn't it. I would needed at least 15-30 min to write this code. But ChatGPT spit it out in under a minute. Of course there are missing parts, like the real path or what to do with duplicate files, beside printing the path to it. But it worked.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1671009886123/JxxvEt-Ls.jpg" alt="output.jpg" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1671009902614/8o2q820SP.jpg" alt="database.jpg" /></p>
<p>Now, I have a a sqlite database with python files, without duplicates. Well, it is only the first step for what I want to do, but it is a start and I got there in under 5min. So I will continue to improve and see how ChatGPT can help me with that.</p>
<h3 id="heading-my-short-story">My Short Story</h3>
<p>Anyhow, after playing around with Python, I thought, what else could I try. I had an idea spinning in my head for a short story for quite some time now, so I thought, well, let's see if ChatGPT can help me write my short story.</p>
<p>I fed this plot into the prompt:</p>
<blockquote>
<p>Write me a short story about a young man, who works on a cargo space ship and dreams of becoming a space trucker, himself.</p>
</blockquote>
<p>And it came up with this:</p>
<blockquote>
<p>There once was a young man named Jack who worked on a cargo space ship. He had always dreamed of becoming a space trucker, just like his father before him.</p>
<p>Despite the long hours and hard work that came with the job, Jack loved every minute of it. He was captivated by the vastness of space and the endless possibilities that it held.</p>
<p>But life on a cargo space ship was not without its challenges. The work was grueling and the conditions were often cramped and uncomfortable. And yet, Jack never lost sight of his dream.</p>
<p>One day, while the ship was docked at a space station, Jack heard about a trucking company that was looking for new drivers. Excited at the opportunity, he applied and was soon hired as a trainee.</p>
<p>For the next few months, Jack worked hard to learn everything he could about the business. He studied the latest technologies, practiced his driving skills, and even worked on his social skills to make sure he would be a good fit for the company.</p>
<p>Finally, the day arrived when Jack was ready to take the wheel of his very own space truck. He was nervous, but also filled with a sense of pride and excitement.</p>
<p>As he navigated the ship through the vast expanse of space, Jack felt like he was truly living his dream. And with each successful cargo delivery, he grew more confident in his abilities and more determined to make a name for himself in the world of space trucking.</p>
<p>In the end, Jack's hard work and dedication paid off, and he became one of the most respected and successful space truckers in the galaxy. He was proud to be following in his father's footsteps, and he knew that the sky was the limit for his future in this exciting and adventurous industry.</p>
</blockquote>
<p>Not exactly what I had in mind. So I played around, restarted many times, cause, since more and more people where using ChatGPT, it got more errors, like these below, every so often.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1671010550394/6v5sqQQlx.jpg" alt="error.jpg" /></p>
<p>But after a few hours my short story was finished. It is rough, not polished, it definitely needs, grammar and logical checks, remember I'm not a Englisch native speaker. And also some sentence should be revised to make it more attractive, but overall I was very pleased. And might I say, that's a movie I would watch. (You get the full story at the end)</p>
<p>Anyhow, very impressive. Of course what I tried is quite conventional. Other tried to find hacks to bring ChatGPT to find way to do illegal stuff, like bomb or weapon building, aso.. Others tried legal stuff, see this <a target="_blank" href="https://www.reuters.com/legal/transactional/will-chatgpt-make-lawyers-obsolete-hint-be-afraid-2022-12-09/">article</a>.
Or what I tried:</p>
<blockquote>
<p>Write me a legal disclaimer, that my published blog entries are my opinion only and are not intended to harm people or destroy or damage property. It is for entertainment only and should be used with reader discression. Write it in the style of a Harvard lawyer.</p>
</blockquote>
<p>And here is the result:</p>
<blockquote>
<p>The opinions expressed in the published blog entries on this site are solely those of the author and are not intended to harm any individual or entity. The content of the blog is for entertainment purposes only and should be used at the reader's discretion. The author and the publisher of this site cannot be held responsible for any damages or harm resulting from the use of the information contained in the blog. The reader assumes all risks and liabilities associated with the use of the information provided.</p>
</blockquote>
<p>Or another try:</p>
<blockquote>
<p>The opinions expressed in the published blog entries of this author are solely those of the author and do not necessarily reflect the views of any other individual or entity. The content of these blog entries is intended for entertainment purposes only and should not be taken as legal, financial, or other professional advice.</p>
<p>The author of these blog entries does not endorse or condone any actions that may result in harm to individuals or damage to property. The reader is solely responsible for their own actions and decisions, and should exercise discretion in the use of any information contained in these blog entries.</p>
<p>The author of these blog entries will not be held liable for any damages or harm that may result from the use of the information contained within them. By reading these blog entries, the reader agrees to hold the author harmless and indemnify them from any claims or damages arising from the use of the information contained within.</p>
<p>This disclaimer applies to all published blog entries of this author and supersedes any previous disclaimer.</p>
</blockquote>
<p>Again, I was blown away. So what we can learn from it all. We as humans, should be very cautious when it comes to AI. As the ChatGPT shows, it is very good. Not perfect, by no means. But every prompt, every text, every idea, every program it reads or get fed to it, makes it better and better. And when more and more people use it, it will be more and more diverse. And that could be sooner or later a danger too many good paid jobs. Cause who needs a programmer, if you could work with an AI that spits out code. Maybe full apps. Why do you need a doctor, if an AI can ask you questions about your symptoms to get a diagnosis. Who needs a lawyer for advice, if you just can ask an AI.</p>
<p>As GitHubs Copilot AI should us, how AI improves and speeds up the coding progress. But you still need some programming know how. But ChatGPT, only needs a good prompt. And with the ability to remember the context, it is a hard competitor. Even Google Search, should be scared. Since when ChatGPT or similar AI's get the ability to use website, currently not possible, it will be the better search engine, for sure.</p>
<p>ChatGPT is not without flaws. As mentioned when it get overburdened with request, it simply breaks up and the content is gone. Also like I found out, later, also the programs are sometimes very flawed. But if you help it and point to the error, it most likely is correcting it.</p>
<p>So we as society and as companies should be careful, where and when we let AI into our life's. They can be beneficial, but also very harmful. And as in prior times, when humans become obsolete as work force, it could hold the potential of social uproar. </p>
<p>Ok to end with a positive note. At the end you'll find the final result of my short story as a small X-Mas pleasure, to read in the quite time around new year. Enjoy and have fun.</p>
<p>As always apply this rule: "Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."</p>
<p>Have a good one. Alex  </p>
<h3 id="heading-and-here-it-is">And here it is:</h3>
<blockquote>
<p>Jack's dream</p>
<p>As the sun rose over the red dunes of Mars, a young man named Jack stood on the balcony of his small apartment, looking out at the vast expanse of the Martian landscape. 
Despite the desolate beauty of the planet, Jack felt restless and unfulfilled. He had always dreamed of exploring the stars, and now, at the age of 22, 
he was determined to make that dream a reality.</p>
<p>Jack is working as a deckhand on a small cargo ship that plied the space lanes between Mars and Earth, but he knew that he was meant for more than just hauling boxes from one planet to another. 
He was determined to become a certified navigator, but the cost of the training was prohibitively expensive. As a certified navigator he could start his own space trucking business.
The next step to fulfill his dream. </p>
<p>To operate a space ship, the SVOSA, the Space Vehicle Operation and Security Agency, regulated that you need to have a certified navigator on board of the Small Ship Category Class (SSCC). 
Beside various requirements concerning the security of the ship and the save operation of the later. In the Small Ship Category Class, you do not need a commander or an engine engineer or other personell.
But of course it makes life easier if you do have them. But Jack decided to find a SSCC ship and start as a lone shark and when the oportunity arises he planned to hire some help.</p>
<p>A certified navigator was a year-long training, if you have the proper basic education. Jack was a good learner and he was that kind of learner, which got the topics very quick.
So Jack had the College Degree from the Community College at New Baltimore on Mars. So all he needed was the money to finiance the navigator education and the living cost for a year.</p>
<p>Problem was, the only school he could afford was on the Earth Moon. A Community Navigator School operated by the Commercial Moon Business Agency and the Moon Council of the 7th Sector. 
All other Navigator Schools where on Earth and cost twice as much and in the case of the best School, five times as much as the School on the Moon. And since the Moon was not so popular as Earth or Mars,
the living cost where much higher. Since Moon almost produced nothing beside Water, Air, basic building materials and basic food. Everything else had to be brought to the Moon. 
Hence everything was expensive.</p>
<p>Undeterred, Jack began working extra shifts on the cargo ship 'CS-26-016', owned and operated by the UET Co (Universal Earth Transportation Company). 
He was saving every credit he earned in the hopes of one day being able to afford the training he needed.
He also began scouring the junkyards and scrap yards of Mars, looking for a ship that he could restore and use to earn his navigator's license.</p>
<p>After months of searching, Jack finally found a battered and broken shipwreck, call sign 'UNSS-05-153', that he was sure he could restore. 
The beaten ship was once operated by the Space Navy as Versatile Transport Space Vehicle between Space and Ground. 
It had a lot of distance on the meter and had seen some abusage in her days in service.</p>
<p>Afterwards it was used as a junker, transporting salvage materials from space scrapyards to the Mars. The owners of the junkyard didn't take good care of it, so when it eventually broke down,
they left the old ship for dead on their junkyard. And there Jack found it. The ship was old and worn, but it had good bones, and with some hard work and a lot of elbow grease, 
Jack was confident that he could make it spaceworthy again.</p>
<p>The brothers who owned the junkyard, didn't thought long, when this young man came and offered 15% above the scrap value. They handed Jack the title and the code for the ship and gave him one earth month to remove it from the junkyard.</p>
<p>With the help of some friends from the UET Co Shipyard and a fellow space enthusiasts, he had meet during his search, Jack began the month long and laborious process of bringing the ship alive. 
It was a slow and difficult process, but Jack was determined to see it through. When the month was almost up, he got the 'Rustbucket', thats the name he gave her, was able to start the hover engines and lift off.
He brought her to a nearby not so trustworthy space port, where he and his friends could work without time limit. It was the only choice he could afford. </p>
<p>It was a cheap space port, nevertheless it wasn't free. And he needed credits for parts, inspections and licensing, too. Not to forget his Navigator training. He worked long hours, both on the cargo ship and on his own ship, 
and slowly but surely, the old ship began to take shape. He also quit his appartment, and lived on his Rustbucket, to save the rent and invest it in restoring the ship.</p>
<p>One day, while browsing the spaceport marketplaces for affordable used parts, Jack met an older man named Sam. Sam was a weathered space veteran who had been working in the space industry for decades. 
Sam had fought in the early Mars wars, and he had served alongside the famous Admiral Ru Maldon. Despite his gruff exterior, Sam took a liking to Jack, and he agreed to help him.
With him Jack found all the parts he needed to repair the Rustbucket. Sam opened Jack doors, only a man with connections could open.</p>
<p>Finally, after almost a year of hard work, the ship was ready for its maiden voyage. Jack was nervous, but he was also excited, and as he sat in the cockpit and powered up the engines, he felt a rush of exhilaration.
The ship lifted off smoothly, and as it soared into the blackness of space, Jack felt like he was finally living his dream. After he landed back on the spaceport, he felt so full of joy and motivation.
Now, he had the ship, now he needed the Navigator certifcate. And of course the business license. But he was sure, he could find a way to get it.</p>
<p>At his 25th birthday, he did two things. First he handed in his notice at UET Co and second he ordered supplies for the Rustbucket. A few weeks earlier he had gotten the confirmation, 
that his application on the Navigator School on the Moon was accepted and he got a place on the next course. </p>
<p>When Jack left Mars, he looked back with sadness, but also with happiness. A new chapter had begun. </p>
<p>Despite his years of experience working on the cargo ship, Jack struggled to pass his navigator exam. The tests were rigorous and demanding, and Jack found himself, more than once, feeling overwhelmed and frustrated. 
He had worked so hard to get to this point, and now it seemed like all his efforts were for nothing. Just when Jack was about to give up, the weathered old space trucker Sam showed up and offered his help, again. </p>
<p>Under Sam's guidance, Jack began to study harder than he ever had before. He spent long hours poring over his textbooks, memorizing the complex equations and formulas that were required to pass the exam. 
He also spent time in the simulator, practicing his navigation skills and learning how to handle different scenarios. And Sam stood on his side.</p>
<p>Thanks to Sam's help, after a year, with hard trainings, long learning sessions and many tests, he was successfull. Jack was able to pass his navigator exam on his second attempt. He was elated, 
and he knew that he owed a debt of gratitude to the old space trucker who had helped him along the way. He was a certified navigator, and he was flying his own ship, making his own way in the universe. </p>
<p>Almost, the one thing he now needed was a business license. Since almost all money was gone, he couldn't simply buy in into an exisisting business and operate his ship under that umbrella. 
But luckily for him, Sam had a business license. Sam took an interest in Jack's business idea and offered to help him, yet again, to get the business license he needed. </p>
<p>Jack had of course to pay Sam for it, but Sam wanted only a monthly installment. Nevertheless, he needed Sams help to navigate the baeurecracy, so the license could be handed to him. After that hurdle was taken.</p>
<p>With his navigator's and business license in hand, Jack was finally ready to take the reins of his own ship and begin his journey into the stars. He was determined to make the most of his new career, 
and he was excited to see what the future held for him.</p>
<p>Sam also helped Jack to get his first transporting jobs. He showed him how the business was handeled. He even showed him, how to deal with taxes and customs. It almost looked like Sam had took Jack as a son,
showing him the ropes of the trade as his successor.</p>
<p>As he navigated the ship between the planets, transporting cargo and passengers from one world to another, Jack knew that he had found a calling. He was a space trucker, 
and he was living the life he had dreamed of for a long time.</p>
<p>After helping Jack pass his navigator exam and getting on his feet, Sam continued to drift trough the planets, but his health began to decline. It was clear that he was not long for this world, 
and he spent his final days in a small clinic on Mars, surrounded by a few friends, including Jack.</p>
<p>As he lay on his deathbed, Sam confided in Jack that he had always dreamed of being scattered among the stars. He asked Jack to fulfill this final wish, and Jack promised that he would.</p>
<p>When Sam passed away, Jack gathered his ashes and took them aboard his ship. He flew to a remote corner of the solar system, where the stars shone brightly and the vastness of space stretched out before him.</p>
<p>With tears in his eyes, Jack released the ashes into the void, watching as they drifted away into the endless expanse of the universe. It was a fitting final resting place for a man who had lived and breathed space travel, 
and as Jack watched the ashes disappear from sight, he knew that he had fulfilled his promise to his old friend.</p>
<p>As he flew back to Mars, Jack couldn't help but feel grateful for the time he had spent with Sam. The old space trucker had taught him so much, and he would never forget the debt he owed him. 
He knew that wherever his journey took him, he would always carry the memory of Sam with him, and he would always be grateful for the help and guidance the old space trucker had given him.</p>
<p>After fulfilling Sam's final wish, Jack returned to Mars, feeling both sad and grateful. He spent the next few days going through the old space trucker's belongings, 
sorting through the various trinkets and mementos that he had collected over the years.</p>
<p>As he was going through Sam's space chest, Jack stumbled upon a small storage device hidden among the clutter. He recognized it as an old-fashioned data chip, and he couldn't resist the urge to see what was on it.</p>
<p>To Jack's amazement, the chip contained a wealth of information about the early days of space travel. It had detailed maps of the solar system, 
as well as extensive records of the various ships and spacecraft that had been used in the first Mars wars.</p>
<p>But the most intriguing thing on the chip was a series of recorded conversations between Sam and Admiral Ru Maldon. In the recordings, the two old friends reminisced about their time in the war, 
and they discussed the challenges and triumphs of their early spacefaring careers.</p>
<p>Jack was mesmerized by the recordings, and he spent hours listening to them, soaking up the wisdom and experience of the two old spacefaring veterans. He knew that he had stumbled upon a treasure trove of knowledge, 
and he was determined to make the most of it.</p>
<p>With the help of the information on the chip, Jack was able to further hone his skills as a spacefaring adventurer. He used the maps and records to plan his routes and navigate the stars, 
and he was able to avoid many of the pitfalls and dangers that had faced the early space explorers.</p>
<p>As Jack continued to listen to the recordings and reading the documents on the data chip, on day he discovered something even more exciting: a map to a prototype space exploring ship. 
It was a scan of a hand drawn map. The map was old and faded, but it was still legible, and it showed the location of that ship, that had been hidden away during the early Mars wars.</p>
<p>Jack was immediately captivated by the idea of finding the prototype space ship, and he spent the next few days pouring over the map, trying to decipher its secrets. 
He knew that it would be a challenging and dangerous undertaking, but he was determined to find the treasure, no matter what.</p>
<p>With the help of his friends and a shady friend of Sam, found the key and he knew were to search. Jack set out on a quest to find the hidden treasure. He traveled to the far reaches of the solar system, 
braving the dangers of deep space and the hostile environments of distant space regions.</p>
<p>After weeks of searching, Jack discovered the hidden treasure. The prototype space ship. It was dusty and dirty, but still in working order, and with some love and care, Jack was able to bring the ship back to life.</p>
<p>With his new prototype space ship, Jack was able to travel even further into the reaches of space. He explored distant planets and moons, discovering new and fascinating worlds along the way.</p>
<p>And as he continued to explore the stars, Jack knew that he was living the life he had always dreamed of. It was not to be a space trucker. He wanted to be a spacefaring adventurer, and now, eventually,
he was fulfilling his destiny among the stars.</p>
<p>End</p>
</blockquote>
]]></content:encoded></item><item><title><![CDATA[Event Storming, Domain Story Telling, Concept Maps, Simple System Description and My IMHO...]]></title><description><![CDATA[So another month past by so fast and the holiday season is approaching in big steps, and we, in Germany, specific Munich that is, have the 1st Advent…]]></description><link>https://blog.arjs.net/event-storming-domain-story-telling-concept-maps-simple-system-description-and-my-imho</link><guid isPermaLink="true">https://blog.arjs.net/event-storming-domain-story-telling-concept-maps-simple-system-description-and-my-imho</guid><category><![CDATA[Event Storming]]></category><category><![CDATA[#Domain-Driven-Design]]></category><category><![CDATA[#conceptmaps]]></category><dc:creator><![CDATA[Alex Schiessl]]></dc:creator><pubDate>Sun, 27 Nov 2022 09:23:37 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1669537703910/wwMGW3KYu.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>So another month past by so fast and the holiday season is approaching in big steps, and we, in Germany, specific <a target="_blank" href="https://webtv.feratel.com/webtv/?design=v4&amp;cam=3017&amp;lg=de">Munich</a> that is, have the 1st Advent weekend with the first round of <a target="_blank" href="https://webtv.feratel.com/webtv/?cam=3017&amp;t=1&amp;design=v4&amp;c0=0&amp;c2=1&amp;c39=0&amp;c40=0&amp;lg=de&amp;s=0">Christkindel</a> markets and Glühwein. ;-) Four more weeks and als those Black Friday presents can be unwrapped.</p>
<p>Anyway, to my topic. Since I've left my project I had a little extra time at hand, so I thought, I experiment with some agile domain driven techniques I've heard over the past year, but I had never time to dig into them, nor had the opportunity to learn about them.</p>
<p>These techniques are: Event Storming (ES), Domain Story Telling (ST), Concept Maps (CM) and Simple System Description (SSD)</p>
<h2 id="heading-simple-system-description">Simple System Description</h2>
<p>Let's start with the last one, the Simple System Description (SSD). It is a technique, which mankind uses since ages. It is nothing new, nothing fancy, nothing with graphics, just plain simple sentences. That what you do if you explain something to someone, who does not have a deeper understanding of a subject.</p>
<p>Maybe an example is best to explain it. Let's assume you would want to explain the color red to someone. You might be refering to the <a target="_blank" href="https://en.wikipedia.org/wiki/Red">Wiki article</a>, which starts with:</p>
<blockquote>
<p>... Red is the color at the long wavelength end of the visible spectrum of light, next to orange and opposite violet. It has a dominant wavelength of approximately 625–740 nanometres.[1] It is a primary color in the RGB color model and a secondary color (made from magenta and yellow) in the CMYK color model, and is the complementary color of cyan ...</p>
</blockquote>
<p>Most likely if you are <strong>not</strong> familiar with wavelengths or spectrum of light, you might easily get lost in a sea of words and concepts you have no idea of. Here is where the SSD technique steps in. </p>
<h4 id="heading-plain-simple-sentences">Plain simple sentences:</h4>
<blockquote>
<p>Red is a color<br />Red is a primary color in the RGB color model<br />The RGB color model is made of Red, Green and Blue<br />Red is a secondary color in the CMYK color model<br />The CMYK color model is made of Cyan, Magenta, Yellow and Key<br />Key is usual the color black<br />Red is located at the end of the visible spectrum of light<br />aso ...  </p>
</blockquote>
<p>So SSD is just a basic method to break up information in easy bite sized junks of information, which are easy to digest.</p>
<h3 id="heading-an-example">An example</h3>
<p>Since I worked with a ticketing system (<a target="_blank" href="https://www.atlassian.com/de/software/jira">Jira</a>) for the last two years, which had an locked in workflow, due to the enterprise setup we had to use, I made my own (quick and simple) workflow description in SSD, to test out this and other techniques.</p>
<p>So here it is, my SSD of a ticketing system. Not complete, not optimized, just some simple sentences hacked in an editor within 15 minutes, to describe the ticketing domain. For a real project, you would need even more description.</p>
<blockquote>
<p>...<br />A User Story Creator (USC) create the User Story's (US)<br />A Product Owner (PO) can be a USC<br />A Team Member (TM) can be a USC<br />A Stakeholder (SH) can be a USC<br />A US needs a short summary (SUM)<br />A US needs a description (DESC)<br />A US needs at least one acceptance criteria (AC)<br />A US needs a unique id (UID)<br />A US need some necessary meta informations (MI)<br />A US need some necessary organizational informations (OI)<br />A US can have links to other US's (USL)<br />A US can have links to other Defects (DL)<br />A US can have sub-tasks (ST)<br />A US can have one or more attachments (AT)<br />A US can have none or many comments (CO)<br />A US can have optional additional informations (AI)<br />Status is an OI<br />Estimation is an OI<br />Assignee is an OI<br />Creator is an OI<br />Project is an OI<br />Project ID (PID) is an OI<br />Ticketing Management System (TMS) assignees UID<br />TMS assigns PID<br />TMS sets MI<br />USC sets OI, SUM, DSC, AC, USL, DL, ST, AT, CO, AI<br />A US starts with status "New"<br />A US in "NEW" has the following follow up statis: "DELETED", "SPECIFICATION"<br />A US in "DELETED" is locked forever<br />A US in "SPECIFICATION" has the following follow up statis: "ESTIMATE", "DENIED", "REWORK"<br />A US in "ESTIMATE" has the following follow up statis: "READY", "REWORK"<br />A US in "DENIED" is locked forever<br />A US in "REWORK" has the following follow up statis: "SPECIFICATION", "DELETED"<br />A US in "READY" has the following follow up statis: "OPEN", "CANCELED"<br />A US in "CANCELED" is locked forever<br />A US in "OPEN" has the following follow up statis: "WORKEDON", "PENDING"<br />A US in "WORKEDON" has the following follow up statis: "PENDING", "TESTING", "REVIEW", "CANCELED"<br />A US in "PENDING" has the following follow up statis: "OPEN", "WORKEDON", "TESTING", "REVIEW", "CANCELED", "DONE"<br />A US in "TESTING" has the following follow up statis: "OPEN", "REVIEW", "PENDING", "CANCELED", "DONE"<br />A US in "REVIEW" has the following follow up statis: "OPEN", "PENDING", "DONE", "CANCELED"<br />A US in "DONE" has the following follow up statis: "CLOSED"<br />A US in "CLOSED" is locked forever<br />Statis can be changed by USC, TMS<br />...</p>
</blockquote>
<p>Well, if you took your time and read through all of it you should have a basic understanding of my ticketing system. At least you should have figured out some things about it. Eg. there is a somewhat complex status workflow. The tickets can have different kind of informations and there are some players acting with the ticket. And as a Software Developer/Software Architect you should have all what you need for starting the first draft of a Domain Model, which you can use, to build a ticketing system on it.</p>
<h2 id="heading-event-storming">Event Storming</h2>
<p>I head of Event Storming during 2020 when Youtube suggested my this <a target="_blank" href="https://www.youtube.com/watch?v=NGXl1D-KwRI">video</a> from the "goto"-Conference from 2018.</p>
<p>The presenter, Alberto Brandolini (https://www.eventstorming.com/), made a good point in his description of his method. So naturally I wanted to learn about it and try it out, but it took me till end of 2022 to have time for it. So I watched a bunch of <a target="_blank" href="https://www.youtube.com/results?search_query=event+stroming">videos about Event Storming</a>, believe me there are some good ones on YouTube, read some <a target="_blank" href="https://www.eventstorming.com/resources/">articles</a> how the method works, the ideas behind it and some tips and tricks. Of course I didn't bought the book, cause my company did not want to pay for it and I need my money currently for heating and power :-(</p>
<p>After reading and watching enough, I started Event Storming. Not in an ideal setup, since it was only me. Normally you should have a facilitator and a bunch of people which are working in the specific domain, you want to explore. Also the method suggest, you should use a huge wall with paper and an assortment of colorful post its. Don't have that. No long wall, no roll of paper, no colorful post its. So a software tool was in need. And <a target="_blank" href="https://app.diagrams.net/">draw.io</a> came to rescue.</p>
<p>Anyways heres my story about Event Storming.</p>
<p>First I made a template for the different colorful post its. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1669539045114/pVoP2SYDP.png" alt="ticket_es_template.png" /></p>
<p>Was not so complicated, and then I started adding Domain Events, after Domain Events in draw.io, based off the SSD from above. After a while I had a lot of Domain Events. So I started ordering them after the time of occurense. After that I added the Commands which I thought go in front of Domain Events. Then going over each tuple, I added Aggregates, Read Models and Behaviors. And in the end I had a nice picture. Well, and it seems like a proper Event Storming board. But I'm sure I made a bunch of errors and applied some wrong rules. But as I wrote it was my first try.</p>
<p>Here is the result. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1669539108045/-kvlvZqPl.png" alt="ticket_es.png" /></p>
<p>Hmm, when you look at it, you see it is very colorful. And you kinda see how the story moves trough it. There are roles and data, and also hotspots, where more information is needed. So all in all it gives you a good understanding about the domain. But as software developer, I'm not sure if this would help me. But I guess it depends, who reads this. And of course it heavily depends who is the facilitator of the method. This board was not done by a trained (Event Storming) facilitator, hence it looks nothing what it would look like when Alberto would have done it. But at least it gives an impression what it would look like, and what it takes to use this method.</p>
<h2 id="heading-domain-story-telling">Domain Story Telling</h2>
<p>This technique I also found trough a <a target="_blank" href="https://www.youtube.com/watch?v=XSE5m9Frvsg">video</a>, also in 2020. In a german IT magazine <a target="_blank" href="Link">heise.de</a> "https://www.golem.de/" there is an article series from Eberhard Wolff, who runs a <a target="_blank" href="https://software-architektur.tv/">webpage</a> on which he explores different facets of Agile, Software, Architecture, aso ...  And he releases his talks, mostly in German, with Experts als on his <a target="_blank" href="https://www.youtube.com/@EberhardWolff">Youtube Channel</a></p>
<p>In this video he talked about Domain Story Telling with two architects who are using this method to explore domains with <a target="_blank" href="https://domainstorytelling.org/">story telling</a>. And they created an open source tool <a target="_blank" href="https://github.com/WPS/domain-story-modeler">"Domain Story Modeler"</a> based on the open source project <a target="_blank" href="https://bpmn.io/">"bpmn.io"</a> from <a target="_blank" href="https://camunda.com/">Camunda</a> which is also available on their <a target="_blank" href="https://github.com/bpmn-io">github page</a>.</p>
<p>Since I liked the visual style and the tool. I tried it and I use it off and on since I saw the video and read about the method and tool.</p>
<p>Back to topic, so I used this method to model the above system, too. Here is the result:  </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1669539604652/lOlCzn1Fl.png" alt="Ticket System_2022-11-25.png" /></p>
<p>Well, IMHO it transports the information very well. You can identify, roles, data, flow and all the stuff to understand the domain. And with the feature to replay the creation of the diagram, you even have the change to describe the story as it unfoleds.</p>
<h2 id="heading-concept-maps">Concept Maps</h2>
<p>Last but not least, <a target="_blank" href="https://en.wikipedia.org/wiki/Concept_map">Concept Maps</a>. It is a visualization technique which is in IT relatively old. But I assume that it has exited long before. Basically since mankind learned to draw circles and arrows and tried to express concepts with them. </p>
<p>Think about treasure maps. They are concept maps, too. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1669540209036/-l4Pn3cU8.jpg" alt="map.jpg" />
You are here, you go there, you find treasure there. And most of the time it was drawn as circles and arrows on maps. And there are even a good method built on it called <a target="_blank" href="http://www.drawtoast.com/">"DrawToast"</a>, have a look or watch the <a target="_blank" href="https://www.youtube.com/watch?v=_vS_b7cJn2A">TED video</a> about it.</p>
<p>So creating a Concept Map is not very complex. You draw ellipses or circles, name them with object if needed, join them with arrows, named with actions, if needed and you're done. </p>
<p>The tool I used to create the below Concept Map, is an experiment I did a few years back. It combines <a target="_blank" href="https://p5js.org/">p5</a> and the network component of <a target="_blank" href="https://visjs.org/">VisJS.org</a> with some regex parsing of sentences, which then are drawn as a concept map.</p>
<p>And here is the result:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1669540389422/eQunSSVrD.png" alt="Concept_Map.png" /></p>
<p>Since it is very small, here are some zooms.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1669540413538/9kHZRM8UC.png" alt="Concept_Map_Zoom1.png" /> 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1669540427259/l0tfQYQKt.png" alt="Concept_Map_Zoom2.png" /></p>
<p>For me personally this is always a good fallback if I want to visualize something complex. Cause I can <em>SEE</em> dependencies, I can <em>SEE</em> where is complexity, I can <em>SEE</em> where is loose or tight coupling. It helps identify problems easily. And I can use it not only for software development, I also used it for understanding processes, organizational structures, workflows and other stuff. It is a versatile method IMHO.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>So there are some very interesting agile techniques out there, which can help you to understand your Problem Domain, better. Many are easy to understand and use. Some need more facilitating and guidance, then others, but in the end they all should help you solve a problem. Understanding your Problem Domain and bring everyone to talk about their understanding and their problems in the Domain they all work in.</p>
<p>I will stick most of the time to SSD and Concept Maps, but if I see an opportunity to apply Event Storming or Domain Story Telling, I definitively will use them all. And I hope one day I get the books about those techniques or I can visit a workshop where those methods are thought.</p>
<p>Ok, that's it for this month. As always apply this rule: "Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."</p>
<p>Have a good one and enjoy the pre-christmas time wherever you are. Alex  </p>
]]></content:encoded></item><item><title><![CDATA[Can you debug life? Or at least do a post-mortem?]]></title><description><![CDATA[Well, in a programmers life you do a lot of debugging, cause we should be honest there is nor bug free software. Ja ja, the obvious "Hello, world!" you can…]]></description><link>https://blog.arjs.net/can-you-debug-life-or-at-least-do-a-post-mortem</link><guid isPermaLink="true">https://blog.arjs.net/can-you-debug-life-or-at-least-do-a-post-mortem</guid><category><![CDATA[life]]></category><category><![CDATA[debugging]]></category><category><![CDATA[opinion]]></category><dc:creator><![CDATA[Alex Schiessl]]></dc:creator><pubDate>Sun, 23 Oct 2022 07:45:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1666511242945/UDrcpJ1Uz.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Well, in a programmers life you do a lot of debugging, cause we should be honest there is nor bug free software. Ja ja, the obvious "Hello, world!" you can write bug free or similar stuff, but it most of the time lacks the serious use. They most of the time just PoC's it can be done, but in serious software or for that matter real life you have to deal with bugs.</p>
<p>Serious software has bugs. Period. And as a programmer you have to debug sooner or later. Sometimes you only get the chance to do a post mortem (btw. also in real life, sadly), cause the bug was fixed by someone else (divine intervention, an angels hand or someone saved you) or was so serious that the software was shut down (or snuffed out your life). </p>
<p>Ja, I know a little bit cynical, but in any case, the good thing is, beside the bad things happened, is that you get the opportunity to learn (if you survive ;-)). In my recent Endeavour at work to preserve my newly won insight into Node-Red and python based Jira ticket analysis with KPI generation, I discovered a bug. It was in the html template generation for Confluence. And it was so trivial, you would assume I would have prepared for it. But I didn't.</p>
<p>Of course I had a lot of verification and check code built around the KPI confluence page generation. Also I have built tests to verify the code generation for the special the Confluence html (FYI it can be tricky to do normal html stuff, but you can apply some tricks to get more out of it, than Atlassian allows). All fine. But I didn't checked what happens when I have no data at all. I simply forget to cover this case. Who would have thought that :-(</p>
<p>A little background story to give you context. As it happens, one of our two teams was reassigned (I did mention in a <a target="_blank" href="https://blog.arjs.net/it-is-almost-over-or-how-i-preserve-know-how-from-a-dying-project">previous post</a> my project is shutting down) to a new project and handed over all remaining work to the one remaining team, till end of October. </p>
<p>So all Team labels in Jira where adjusted to reflect that only one team is doing the rest of the tickets. In my Jira ticket extraction code, I covered for that case, and I wrote no files or better I wrote empty files, depending what was best. Also I made sure to create empty statistics structures, so the reading and calculating part would even work in that case.</p>
<p>But all this preparation and carefully panning ahead, I simply forgot to cover that the aggregating part, the part which generates averages, max, min and such stuff, would work but would produce no usable result. Or to make it more concrete, what is the average of 0 tickets with 0 devs working 0 days on them. Hmm, ja I think you see the problem. I simply forgot to test and cover that case. The result was an empty ({}) json structure, cause nothing was calculated and lastly written in the aggregation file used by the KPI html code generation.</p>
<p>And that's how the bug happened and the KPI html code generation failed. I simply didn't cover this edge case with a test and with code handling to cover this case.</p>
<p>So what have I learned or better re-learned. Testing is good, in fact very good, but it doesn't help if you not cover all test cases. And it is easy to oversee an edge case. I've also learned to keep in mind that nothing in the world is constant (even time, hint leap year). My assumption was I'll always have data from both teams, until I didn't, and the the edge case appeared. So when it comes to assumptions, you better be prepared they are wrong. Make sure you are aware of the edge cases, when your assumptions are wrong.</p>
<p>Also another affect of this bug was, I could fix it, so I have a piece of software I can use in another project, now, with one bug less. You know the saying, at least I've learned it in Germany when I was starting my career: </p>
<blockquote>
<p>"If you fix one bug, you potentially introduce 10 new ones!"</p>
</blockquote>
<p>I would like to provide you with the code and the fix, but it was code written in the context of my employer, so I'm not at liberty to disclose the code. </p>
<h3 id="heading-and-real-life">And real life?</h3>
<p>Ok, back to the topic of the title. So why do I make a relation between life and debugging software. Well, I'd to deal with the big "C" virus. Some of you might have read in my <a target="_blank" href="https://blog.arjs.net/summer-hiatus-is-almost-over-what-happened">summer update</a>, that I'm a newly work council member in our local work council. Since we have several work council's all over Germany. Each year all the work councils members gather in one location, to meet each other, discuss stuff and plan what we want to achieve in the next year.</p>
<p>This event happened early October for this year. Of course we tried to be careful and look ahead (like I did with my KPI html generation code), so we made preparations, test kits where handed out, rules where agreed on, processes put in place, e.g. mask had to be worn in trains, public transports, hotels and tight meeting rooms. But as in software, despite all these precautions, a bug hit or better the big "C" virus hit. </p>
<p>As bad luck would have it, I was sitting beside a colleague, who had the big "C" and came to the conference any way, disregarding all the processes and rules. For his defense he didn't know that he had it (so he said), cause he only tested himself after he was home and had symptoms, even everyone had two quick test for before and after testing. </p>
<p>Anyway sh*t happens. Naturally everyone who was in close contact with that colleague got the "red" warning (<a target="_blank" href="https://www.bundesregierung.de/breg-de/themen/corona-warn-app">Official German Virus Warning App</a> - I don't want to promote or was sponsored, just want to give you the chance for your own research) on their Phones, that we had contact with an invected person. Btw. that is the problem with such kind of warning apps. They most of the time warn you after the effect and only if the invected person reports that he/she was invected within the app. :-(</p>
<p>Well in my case I gladly did the 4th buster shot a few days before my travels, but apparently not early enough, cause I got affected, too. Not so bad as my colleague, but I had a cough, was very tired and had a lack of energy. That slowed my progress at work and in my private project.</p>
<p>Well, so how can you debug such a problem in real life. IMHO you can't. Humans are simply to unpredictable. There is not much logic involved, to much emotions. Software does not have emotions (as of yet) and acts logic. As I said humans do sometimes stupid things, even they should have known better or applied logic. As in my case, a colleague, who should have done the test bevor he traveled to the conference and should have canceled the trip. Or we as group should have not relied that every one is healthy and hence nothing will happen. Can't chance it now, but at least I did a post-mortem and found some things I will do better next time or will suggest we as a group should handle differently. </p>
<p>First of all if there is a virus like big "C" and you come together from all over the country, no one should be admitted to the conference area until a recent negative PCR test is provided. In addition Masks have to be worn all the time, if you not sitting on your place with enough room around you. So basically the general rules for every large meeting, which where in place till April this year, but got canceled and forgotten, because the big "C" wasn't so deadly anymore. And the long term effect, are not accepted, yet, as illness. </p>
<p>And personally I won't attend any big meetings and conferences anymore, unless I'm sure we as a group and I personally are protected as good as possible with such kind of rules. Ja I know life is full of risks, and I can die of food poisoning or an accident, tomorrow. But it is a different thing to do things with or without precautions.</p>
<p>Ok, as usual that's my opinion on my personal experience and my situation. I know some of you might feel or think different. That's totally Ok with me. Simply keep in mind, that we are different persons, have different experiences, different upbringings, different culture, different feelings about it, different perspectives and most importantly different filters in our heads, as <a target="_blank" href="https://de.wikipedia.org/wiki/Vera_F._Birkenbihl">Vera F. Birkenbihl</a> once said: "Same information, same experience, different perception because of our different filters in our heads!"</p>
<p>So, to end my not so dev-like blog post, a short update on projects.</p>
<h3 id="heading-update-from-work">Update from work</h3>
<p>Let's start with work. As already mentioned, my current project is winding down. Shop closes for me in 31st of October. As written in my last post I prepared the anonymous data and code extraction, to preserve it for upcoming new projects. Currently I've to do all the necessary administrative work for a project closing down. Offboardings, remove of rights and roles, write documentation and have know how transfer meetings with the new Scrum Master and new Project Lead. After that I'm done and it is another page in my history book.</p>
<p>What comes next, I do not know. For now, I do help out in the work council, since there are changes coming from the company which need a lot of discussions. Also I got the good advice from by boss, to look into the "SAFe" agile framework and possible do a certification for that. Cause it could be in my future to work in a new project, which uses or requires know how about that framework.</p>
<h3 id="heading-update-from-private-projects">Update from private projects</h3>
<p>They were slowed down, too, because of the conference and the outcome of it. But in the meanwhile I continued on my Football Scoreboard and it slowly but surly comes along. The control panel is working, I do fine adjustments, like enabling and disabling buttons depending on the state. Optimizations for using it on my iPad. Fixing bugs. Code Refactoring. And still to find a good way to write tests for UI testing, beside Selenium.</p>
<p>The overlay part is getting enriched more and more. I've managed to implement the PoC of doing the Touchdown Overlay. This is now the blueprint for the other scoring events. No much progress on the rest of the events, like flag, timeouts, aso. Also I'm not so happy with my graphics. They look fine, but a but chunky and inconsistent. Anyhow, technical dept for the backlog.</p>
<p>Also I found a new P5js library called <a target="_blank" href="https://github.com/Milchreis/p5.tween">"tween"</a>. Which might help me to bring a little more life in the overlay. Currently when the scoreboard or the source events are rendered, they simply pop up. With this library you can have effects, like "easein", "easeout", aso. In addition there is another P5js library <a target="_blank" href="https://github.com/scottkildall/p5.timer">"Timer"</a>, which gives you an easy timer implementation, so you don't have to deal with "setTimeout" or "setInterval". Well I've to make an assessment, how much effort it costs to introduce this complexity into the current software. It might be go to the backlog for further enhancements.</p>
<p>I'd also a little hickup, cause another collegue at the conference suggested I should use either the local storgage (with and event listener for changes) or web-sockets. Anyhow, I did some experiments with the local storage. But local browser storage, is not feasible, cause it works only in the same browser, but I want to use a tablet for the control panel and a Raspi-Pi as server for the Overlay. Hence local storage wouldn't work. </p>
<p>For the web-sockets part, I'm sure this would be the best solution, but since I've no experience with it and I don't know how to use it in my case, yet. I leave this one for further improvements in the backlog. My focus for now is to finish and release the Scoreboard as Open Source rather sooner than later. And if it happens so, that someone is willing to participate and review/improve my Football Scoreboard, I'm the last to say no to a Pull Request. They are welcome.</p>
<p>Another great, well expensive, thing happened as well. I finally was able to score another Raspi-Pi 4B 4GB, with an original red/white case, cables, heatsink, 16GB SD card and powersupply for 133€. But if you keep in mind the retail price of all the components before the prices exploded, it is at least 30-40% more expensive than before. But I've my 3rd Raspi-Pi 4B, now. Hence I can work on completing my little k3s cluster, with 1 controller and 2 workers. So over the Christmas break I can have my little HW project I can tinker with. </p>
<p>Also I want to try out DietPI OS for the k3s cluster. It is apparently smaller and less bloated as the Raspberry OS lite. Well, another project for Christmas. And after one year delay it is time to complete my k3s cluster, so I can move all my container services from my Mac Mini 2007 and retire him.</p>
<p>And of course I still have all the other project from my <a target="_blank" href="https://blog.arjs.net/my-top-5-ideas-for-the-next-12-month">Top 5 projects</a> I have in my mind till the next summer hiatus.</p>
<p>Ok, that's it for this month. As always apply this rule: "Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."</p>
<p>Have a good one. Alex  </p>
]]></content:encoded></item><item><title><![CDATA[It is (almost) over Or How I preserve Know How from a dying project...]]></title><description><![CDATA[So it happened. As I mentioned in my summer update, one of the possibilities of my current work project is, that it will be canceled by our customer. And…]]></description><link>https://blog.arjs.net/it-is-almost-over-or-how-i-preserve-know-how-from-a-dying-project</link><guid isPermaLink="true">https://blog.arjs.net/it-is-almost-over-or-how-i-preserve-know-how-from-a-dying-project</guid><category><![CDATA[Python]]></category><category><![CDATA[agile methods]]></category><category><![CDATA[failure]]></category><dc:creator><![CDATA[Alex Schiessl]]></dc:creator><pubDate>Sun, 25 Sep 2022 09:41:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1664098948796/gVlIl25WM.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>So it happened. As I mentioned in my <a target="_blank" href="https://blog.arjs.net/summer-hiatus-is-almost-over-what-happened">summer update</a>, one of the possibilities of my current work project is, that it will be canceled by our customer. And this option became reality, we are out by end of October at latest. A new contractor takes over! We are finishing the rest of our features we have committed to, till early October, and after that we only are on standby for warranty stuff. Ja, it is sad for the team and our company, but that how it goes sometimes. And honestly I'm not to sad about the cancelation. When you followed my blog, I ranted once or twice about it.</p>
<p>Anyhow, so the project is winding down. Ok, what to do with all the data in the RethinkDB, with all the Node Red flows, with all the Elasticsearch/Kibana stuff, with all the python code I wrote to calculate the KPIs and do the Confluence pages. Guess I have to come up with an idea to save the data, without compromising any important information about the customer and the project.</p>
<p>So let's do a short inventory. </p>
<p><strong>The Database</strong><br />Ok, the database is, as I mentioned, the open source project RethinkDB a document based, no-sql database. I used only a few tables. </p>
<ol>
<li>One table for some persistent states, so Node Red can initialise some internal variables on startup and can continue at the last checkpoint. </li>
<li>Two seperate tables with infomation form the RSS streams for each team.</li>
<li>A table with all the tickets, starting from 2021, till last run of the update script. Currently over 2200 documents.</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664093984513/AKVyGjs8z.png" alt="Very simple Table structure" /></p>
<p><strong>Node Red</strong>  </p>
<ol>
<li>One flow for fetching the RSS feeds for the two teams and updating the ticket table and exporting it to Elasticsearch</li>
<li>A flow for fetching all the closed tickets and storing/updating it in the ticket table</li>
<li>Two flows to go over the closed tickets in the tickets table and updating the Elasticsearch information  </li>
</ol>
<p>Here is an example:<br /><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664094467630/dwiXBJVy7.png" alt="Just a sample" /></p>
<p><strong>Kibana/Elasticsearch</strong></p>
<ol>
<li>Two data sources. One for general ticket progress and one specific for state changes.</li>
<li>Some special queries for in-depth analysis and some more or less generic Lens graphics.</li>
</ol>
<p><strong>Python Scripts</strong><br />There is basically only one python script. It fetches info from jira, calculates kpis and then generate some special confluence pages. It is a cli based tool, with some simple scripting capabilities.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664094535442/2XusnfRzJ.png" alt="Basic code structure" /></p>
<p>Well, that's it. That's what I did, to keep my not so Scrum-based project interesting for me.</p>
<p><strong>The ideas</strong><br />Ok, let's start with the <em>Python script</em>. Should be a quick win. Of course it is a proper python project, with setup, configuration and you guessed it a git repo in the project bitbucket. So most of the changes are in configs/settings only. There are only five specific references to tie my code to the customer project. </p>
<p>There are two configurable Jira JQL queries which are used to fetch the affected tickets for both teams. Then there are three settings (url, user, password) for the customer Jira server and the same for the Confluence server. And at last some hard coded stuff in the otherwise very generic confluence template pages.</p>
<p>Well, since the code is in a Bitbucket git repo, it can be easily exported and I can create a new local git repo. Easy since I use WSL2 with ubuntu on my Windows Laptop. The settings/configs/templates can be anonymized very quick and easy by deleting or replacing it with generic settings. </p>
<p>Since I maintain a requirements.txt with all the module references, I do not need to keep the virtual environment. I can simply delete it. With that generic code in a local git repo, I should be able to very easily zip it and store it. And if I need it for a possible new Scrum project with Jira/Confluence it can be reused very easily. Simply adapt the JQL(s), the urls, users and passwords, and of course the confluence templates. Which I assume will be a bit more work, since it depends what the new Confluence offers for plug-ins.</p>
<p>Guess, I can do this preservation very quick, shortly before my customer project shuts down for good and I no longer have access to the bitbucket git.</p>
<p><em>One down, three more to go.</em></p>
<p>Let's continue with <em>Elasticsearch/Kibana</em>. The good thing is, that I didn't use to much specific features from them. Just the basic stuff. No calculated fields, no special developer configuration stuff, no special plug-ins, just plain Kibana/Elasticsearch stuff. As far as I know you can backup or export some settings and diagrams configs. But if not, it doesn't matter, since I built it once, so I can built it again. And what about all the stored data, you might ask. I won't safe or export it, since it can easily re-generated via the Node Red flow I have for that. And it is only useful for a post-mortem of the project, which I strongly hope I can convince my Project Lead and my Department Lead of, so we can have some insights and learnings for future projects.</p>
<p>The Kibana/Elasticsearch setup should be fairly easy to adopt it to a new Scrum project. I assume, another quick win for me. </p>
<p><em>Two done, two to go.</em></p>
<p>Next is <em>Node Red</em>. Node Red will IMHO a quick win, too. There is an export flow function, to export the all flows as a json to the clipboard, so it can easily copied and pasted to file. Of course there are some references to Jira and passwords stored. But since they are encrypted they are not in clear text, they can simply removed with search and replace. Of course the the RSS streams need to be removed as well. This is not a major headache, since RSS feeds can easily be generated and very easily retrieved from a JQL query in Jira. And since the JQLs have to be adopted to a new SCRUM Project anyway, no problem at all.</p>
<p>Hmm, of course I need some screenshot, too. Just to make sure, I get the same layout and the same plug-ins installed for the new Scrum project. And most importantly the used Node Red plugins and version numbers. Since there is no obvious way to save this information. At least if you don't want to dig around in the config files. Which I do not plan to do. </p>
<p>Well, sounds this one is also an easy win. </p>
<p><em>Only one left. The Database.</em></p>
<p><em>The Database</em> will require some more work, since it contains sensible data. </p>
<ol>
<li>First, I have to make sure, that no compromising data is exported. </li>
<li>Secondly, I have to make sure, that I have all the data I need for experimenting with different visual frameworks (eg. eGraph or Seaborn). And I can reconstruct the Elasticsearch/Kibana information, if I need it.</li>
<li>And at last, filter all data (eg. summary, description, attachments - maybe transform it to some simple statistical data, like length, counts, types or so) which I do not need for KPIs, Graphs or analyzing. </li>
<li>And I need to figure out in what format it should be exported.</li>
</ol>
<p>I did a <a target="_blank" href="https://duckduckgo.com/?q=how+to+flatten+the+json+in+python&amp;t=canonical&amp;ia=web">quick search</a> last week and I found some very simple ideas how to export data from RethinkDB. And I've implemented an experimental script.</p>
<p>Very basic. Just loop through the tickets, and export each ticket as a separate json file. Since the Jira Json structure is very large, I spare you an example, cause I don't think it is fun to scroll dozens of pages. Do a Rest Call with the Jira Rest API and you see what I mean. So here is the minimal script.</p>
<pre><code><span class="hljs-keyword">import</span> json
<span class="hljs-keyword">from</span> os <span class="hljs-keyword">import</span> path
<span class="hljs-keyword">from</span> rethinkdb <span class="hljs-keyword">import</span> RethinkDB
r = RethinkDB()

r.connect( <span class="hljs-string">"localhost"</span>, <span class="hljs-number">28015</span>).repl()
cursor = r.table(<span class="hljs-string">"tickets"</span>).run()
<span class="hljs-keyword">for</span> <span class="hljs-built_in">document</span> <span class="hljs-keyword">in</span> cursor:
    <span class="hljs-keyword">if</span> <span class="hljs-string">'key'</span> not <span class="hljs-keyword">in</span> <span class="hljs-built_in">document</span>: <span class="hljs-keyword">continue</span>
    _key = <span class="hljs-built_in">document</span>[<span class="hljs-string">"key"</span>]
    print(_key)
    _path = path.join(<span class="hljs-string">'exports'</span>, <span class="hljs-string">'data'</span>, _key+<span class="hljs-string">'.json'</span>)
    <span class="hljs-keyword">with</span> open(_path, <span class="hljs-string">"w"</span>) <span class="hljs-keyword">as</span> jf:
        json.dump(<span class="hljs-built_in">document</span>, jf, indent=<span class="hljs-number">4</span>)
</code></pre><p>And then I started a more in-depth script, which is still WIP, to achieve all my above goals. Some challenges were to overcome. Since the project language is german, there were many ä,ö,ü,ß used, which I had to deal with. Abd then the ',' and '.' dilemma in numbers. </p>
<p>But in general it is straight forward. Just a big loop with some filtering. And yes, it is not pretty or reusable. Just some throw away code, to export the data to excel, just before the project closes down, and my docker containers have to go to the bin.</p>
<pre><code><span class="hljs-keyword">from</span> typing <span class="hljs-keyword">import</span> NamedTuple
<span class="hljs-keyword">from</span> common.utils <span class="hljs-keyword">import</span> locate, read_json_data # some custom code I wrote years ago

Info = NamedTuple(<span class="hljs-string">'Info'</span>, [(<span class="hljs-string">'key'</span>, str), (<span class="hljs-string">'author'</span>, str), (<span class="hljs-string">'created'</span>, str), (<span class="hljs-string">'field'</span>, str), (<span class="hljs-string">'was'</span>, str), (<span class="hljs-string">'now'</span>, str)])
changes = []
count = <span class="hljs-number">0</span>
itemcount = <span class="hljs-number">0</span>
sp = []
<span class="hljs-keyword">for</span> _file <span class="hljs-keyword">in</span> locate([<span class="hljs-string">'*.json'</span>], <span class="hljs-string">'./exports/data'</span>):
    print(_file)
    count += <span class="hljs-number">1</span>
    _data = read_json_data(_file)
    _key = _data[<span class="hljs-string">'key'</span>]
    _changes = _data[<span class="hljs-string">'changelog'</span>][<span class="hljs-string">'histories'</span>]
    <span class="hljs-keyword">for</span> _change <span class="hljs-keyword">in</span> _changes:
        _author = _change[<span class="hljs-string">'author'</span>][<span class="hljs-string">'displayName'</span>]
        _created = str(_change[<span class="hljs-string">'created'</span>]).replace(<span class="hljs-string">'T'</span>, <span class="hljs-string">' '</span>)[:<span class="hljs-number">-9</span>]
        _items = []
        <span class="hljs-keyword">for</span> _item <span class="hljs-keyword">in</span> _change[<span class="hljs-string">'items'</span>]:
            _field = _item[<span class="hljs-string">'field'</span>]
            <span class="hljs-keyword">if</span> _field <span class="hljs-keyword">in</span> [<span class="hljs-string">'Comment'</span>, <span class="hljs-string">'description'</span>, <span class="hljs-string">'Acceptance Criteria Checklist'</span>, <span class="hljs-string">'Acceptance Criteria (old)'</span>, <span class="hljs-string">'summary'</span>]:
                itemcount += <span class="hljs-number">1</span>
                _from = _item[<span class="hljs-string">'fromString'</span>][<span class="hljs-number">0</span>:<span class="hljs-number">24</span>].replace(<span class="hljs-string">'\n'</span>, <span class="hljs-string">''</span>).replace(<span class="hljs-string">'\r'</span>, <span class="hljs-string">''</span>) + <span class="hljs-string">'...'</span> <span class="hljs-keyword">if</span> _item[<span class="hljs-string">'fromString'</span>] <span class="hljs-keyword">else</span> <span class="hljs-string">""</span>
                _to = _item[<span class="hljs-string">'toString'</span>][<span class="hljs-number">0</span>:<span class="hljs-number">24</span>].replace(<span class="hljs-string">'\n'</span>, <span class="hljs-string">''</span>).replace(<span class="hljs-string">'\r'</span>, <span class="hljs-string">''</span>) + <span class="hljs-string">'...'</span> <span class="hljs-keyword">if</span> _item[<span class="hljs-string">'toString'</span>] <span class="hljs-keyword">else</span> <span class="hljs-string">""</span>
                <span class="hljs-keyword">if</span> <span class="hljs-string">'\n'</span> <span class="hljs-keyword">in</span> _from:
                    _found = True
                <span class="hljs-keyword">if</span> <span class="hljs-string">'\n'</span> <span class="hljs-keyword">in</span> _to:
                    _found = True
                <span class="hljs-keyword">if</span> <span class="hljs-string">'\r'</span> <span class="hljs-keyword">in</span> _from:
                    _found = True
                <span class="hljs-keyword">if</span> <span class="hljs-string">'\r'</span> <span class="hljs-keyword">in</span> _to:
                    _found = True
                <span class="hljs-keyword">if</span> <span class="hljs-string">'Ã¶'</span> <span class="hljs-keyword">in</span> _from: # ö
                    _from = _item[<span class="hljs-string">'fromString'</span>][<span class="hljs-number">0</span>:<span class="hljs-number">24</span>].replace(<span class="hljs-string">'Ã¶'</span>, <span class="hljs-string">'ö'</span>)
                <span class="hljs-keyword">if</span> <span class="hljs-string">'Ã¶'</span> <span class="hljs-keyword">in</span> _to:
                    _to = _item[<span class="hljs-string">'toString'</span>][<span class="hljs-number">0</span>:<span class="hljs-number">24</span>].replace(<span class="hljs-string">'Ã¶'</span>, <span class="hljs-string">'ö'</span>)
                <span class="hljs-keyword">if</span> <span class="hljs-string">'Ã¤'</span> <span class="hljs-keyword">in</span> _from: # ä
                    _from = _item[<span class="hljs-string">'fromString'</span>][<span class="hljs-number">0</span>:<span class="hljs-number">24</span>].replace(<span class="hljs-string">'Ã¤'</span>, <span class="hljs-string">'ä'</span>)
                <span class="hljs-keyword">if</span> <span class="hljs-string">'Ã¤'</span> <span class="hljs-keyword">in</span> _to:
                    _to = _item[<span class="hljs-string">'toString'</span>][<span class="hljs-number">0</span>:<span class="hljs-number">24</span>].replace(<span class="hljs-string">'Ã¤'</span>, <span class="hljs-string">'ä'</span>)
                <span class="hljs-keyword">if</span> <span class="hljs-string">'Ã¼'</span> <span class="hljs-keyword">in</span> _from: # ü
                    _from = _item[<span class="hljs-string">'fromString'</span>][<span class="hljs-number">0</span>:<span class="hljs-number">24</span>].replace(<span class="hljs-string">'Ã¼'</span>, <span class="hljs-string">'ü'</span>)
                <span class="hljs-keyword">if</span> <span class="hljs-string">'Ã¼'</span> <span class="hljs-keyword">in</span> _to:
                    _to = _item[<span class="hljs-string">'toString'</span>][<span class="hljs-number">0</span>:<span class="hljs-number">24</span>].replace(<span class="hljs-string">'Ã¼'</span>, <span class="hljs-string">'ü'</span>)
                <span class="hljs-keyword">if</span> <span class="hljs-string">'Ãœ'</span> <span class="hljs-keyword">in</span> _from: # Ü
                    _from = _item[<span class="hljs-string">'fromString'</span>][<span class="hljs-number">0</span>:<span class="hljs-number">24</span>].replace(<span class="hljs-string">'Ãœ'</span>, <span class="hljs-string">'Ü'</span>)
                <span class="hljs-keyword">if</span> <span class="hljs-string">'Ãœ'</span> <span class="hljs-keyword">in</span> _to:
                    _to = _item[<span class="hljs-string">'toString'</span>][<span class="hljs-number">0</span>:<span class="hljs-number">24</span>].replace(<span class="hljs-string">'Ãœ'</span>, <span class="hljs-string">'Ü'</span>)

            elif _field <span class="hljs-keyword">in</span> [<span class="hljs-string">'Story Points'</span>]:
                itemcount += <span class="hljs-number">1</span>
                _from = _item[<span class="hljs-string">'fromString'</span>].strip().replace(<span class="hljs-string">'.'</span>, <span class="hljs-string">','</span>) <span class="hljs-keyword">if</span> _item[<span class="hljs-string">'fromString'</span>] <span class="hljs-keyword">else</span> <span class="hljs-string">""</span>
                _to = _item[<span class="hljs-string">'toString'</span>].strip().replace(<span class="hljs-string">'.'</span>, <span class="hljs-string">','</span>) <span class="hljs-keyword">if</span> _item[<span class="hljs-string">'toString'</span>] <span class="hljs-keyword">else</span> <span class="hljs-string">""</span>  
                <span class="hljs-keyword">if</span> _to not <span class="hljs-keyword">in</span> sp: sp.append(_to)
                <span class="hljs-keyword">if</span> _from not <span class="hljs-keyword">in</span> sp: sp.append(_from)

            elif _field <span class="hljs-keyword">in</span> [<span class="hljs-string">'Link'</span>, <span class="hljs-string">'RemoteIssueLink'</span>]:
                itemcount += <span class="hljs-number">1</span>
                _from = str(_item[<span class="hljs-string">'from'</span>]).strip() <span class="hljs-keyword">if</span> _item[<span class="hljs-string">'from'</span>] <span class="hljs-keyword">else</span> <span class="hljs-string">""</span>
                _to = str(_item[<span class="hljs-string">'to'</span>]).strip() <span class="hljs-keyword">if</span> _item[<span class="hljs-string">'to'</span>] <span class="hljs-keyword">else</span> <span class="hljs-string">""</span>

            <span class="hljs-attr">else</span>:
                itemcount += <span class="hljs-number">1</span>
                _from = <span class="hljs-string">'\"'</span> + _item[<span class="hljs-string">'fromString'</span>].strip() + <span class="hljs-string">'\"'</span> <span class="hljs-keyword">if</span> _item[<span class="hljs-string">'fromString'</span>] <span class="hljs-keyword">else</span> <span class="hljs-string">""</span>
                _to = <span class="hljs-string">'\"'</span> + _item[<span class="hljs-string">'toString'</span>].strip() + <span class="hljs-string">'\"'</span> <span class="hljs-keyword">if</span> _item[<span class="hljs-string">'toString'</span>] <span class="hljs-keyword">else</span> <span class="hljs-string">""</span>  

            _info = Info(_key, _author, _created, _field, _from, _to)
            _items.append(_info)

        changes.append(_items.copy())

<span class="hljs-keyword">with</span> open(<span class="hljs-string">'changes.csv'</span>, <span class="hljs-string">'w'</span>, encoding=<span class="hljs-string">'UTF16'</span>) <span class="hljs-keyword">as</span> _ef:
    <span class="hljs-keyword">for</span> _change <span class="hljs-keyword">in</span> changes:
        <span class="hljs-keyword">for</span> _item <span class="hljs-keyword">in</span> _change:
            _ef.write(f<span class="hljs-string">'{_item.created};{_item.key};{_item.author};{_item.field};{_item.was};{_item.now}\n'</span>)

print(sp)
print(count, itemcount)
</code></pre><p>I guess, I will build on that, especially I have only a few weeks left, before I do no longer have access and I have to do some other project closeout and administrative/housekeeping stuff.</p>
<p><strong>Outlook</strong><br />Ok, when all above ideas are implemented and I'm not wrong, I should get a local git repo which I can adapt for a new SCRUM project, a folder with some screenshoots and a flow json file, an excel file with 2000+ anonymized, essential Jira tickets for experimenting, and hopefully some exports from Kibana/Elasticsearch. All can be put in a zip file and stored for later use. Not so bad.</p>
<p>When I think about it, how much work and time I spent gathering all the information, programming, experimenting, just to present some KPIs (cause Jira was not offering it, or only in paid plug-ins, which you rarely can use in an enterprise setup) in a weekly meeting. And in the end I can boil it down to basically one zip file. Ja, sometimes I.T. projects are somewhat weird. But I spent a lot of work and time on stuff I can reuse, and that's a good thing. Of course I spent also a lot of work and time for stuff (useless discussions with our customer, how we should improve our processes) or escalation meetings over things, which just happened cause we have such a weird Scrum setup. And I might add, a very political (enterprise I mean) and more or less spontaneous customer.</p>
<p>Anyhow I learned a lot. Good things and things I do not want to do again. And that's good too. Or as Joda once said: <strong><em>"Ja, Failure a great teacher he is!"</em></strong>, and I agree that is very true. For me, I'll bring this project to an end, hand over my tasks to the new Scrum Master from the new contractor and wish him/her good luck and a better fortune with the customer. And I hope strongly I'm out end of October and can find my closure. </p>
<p>And I hope our company, our Project Lead, my Department Lead, some responsible Sales people and I can have a post-mortem to wrap up the 30+ month journey with this oddly strange project.</p>
<p>As always apply this rule: "Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."</p>
<p>Have a good one. Alex  </p>
]]></content:encoded></item><item><title><![CDATA[Summer hiatus is (almost) over. What happened...]]></title><description><![CDATA[Well, Summer was hot, dry and sometimes very wet, and of course very busy for me. As the summer winds down, I wanted to give a short update what happened…]]></description><link>https://blog.arjs.net/summer-hiatus-is-almost-over-what-happened</link><guid isPermaLink="true">https://blog.arjs.net/summer-hiatus-is-almost-over-what-happened</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[agile]]></category><category><![CDATA[football]]></category><dc:creator><![CDATA[Alex Schiessl]]></dc:creator><pubDate>Sat, 27 Aug 2022 07:07:07 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1661583855716/1oaGhlfdI.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-private-life">Private life</h1>
<p>Well, Summer was hot, dry and sometimes very wet, and of course very busy for me. As the summer winds down, I wanted to give a short update what happened in my summer hiatus and before autumn starts and I plan to blog regularly again. </p>
<p>Of course I did all the summer stuff you normally do. Hang out with friends and family. Do BBQ’ing, traveling, doing Outdoor stuff, gardening and of course some home crafting (more like fixing broken stuff, then creating new things). </p>
<p>Most of my time this summer I spent helping my local (American) football team the <a target="_blank" href="www.munich-cowboys.de">Munich Cowboys</a> stream their home games to <a target="_blank" href="sportdeutschland.tv/gfl">sportdeutschland.tv/gfl</a>, this years home of all GFL’s (German Football League) football games. So if you want to see what American football looks in Germany, have a peek over <a target="_blank" href="sportdeutschland.tv/gfl">there</a>.</p>
<p>And football summer isn't over, yet. We still have at least two more games to stream, before the „streaming“ season is over. The Cowboys currently on 2nd place in the South division, will have one more Home game, today the 27th of August at 16:00 o’clock against the Frankfurt Universe. This will most likely a will be a win, cause the Universe, lost the mojo, when most of the team players went to a different team in a different <a target="_blank" href="https://europeanleague.football/">league</a>. </p>
<p>With that last game, the regular season is over and the playoff starts, which ultimately end in the <a target="_blank" href="https://www.germanbowl.de/">German Bowl</a>. For the Cowboys this means, we have to host at least one more home game on the 10th of September. This quarter final game is against the 3rd placed team in the North division. Currently this would be the Cologne Crocodiles, but in football everything is possible, even a different team or place or game outcome. ;-) So let's wait and see, what the outcome of this weekend will be.</p>
<p>Also in case the 1st seated Schwäbisch Hall Unicorns (in the South division) would loose their quarter final, the Cowboys, would have another home game against the winning team. But I doubt that, since the Unicorns are unbeaten this year as the year, before, and before... </p>
<p>Btw. there is a great documentation from <a target="_blank" href="https://www.youtube.com/c/NALFVLOGS">Nick Alfieri</a> available about the Unicorns, called Unicorn Town. And this documentary was co-produced by Christian McCaffrey, RB at the NFL team Carolina Panthers. Have a look at the <a target="_blank" href="https://youtu.be/pbnHSLi_wGY">trailer</a> and also have a look at the <a target="_blank" href="sportdeutschland.tv/gfl">sportdeutschland.tv/gfl</a> page to see what games are streamed this Saturday and Sunday. And of course the playoffs, later in September.</p>
<p>Anyway back to Developer topics. So as I mentioned, I helped stream the Cowboys home games. Here btw. is a look at our setup:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1661580670377/Gwz4JC_Zd.jpg" alt="B3B8747C-BF13-449C-B022-D8F460045AEE.jpg" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1661580768330/dY5yeZJoZ.jpg" alt="IMG_2816.jpg" /></p>
<p>As you see on the screen there is a window which controls the Scoreboard for the Live Stream. This Scoreboard software was written by my friend in Visual Basic, with NDI output support. As you might also see, the interface looks kinda old, but I can ensure you, it is practical and does it’s job very well. And my friend and I improved it over two seasons, so you can work with it very efficiently.  </p>
<p>That was only the foreplay for the real story I want to tell. Originally I didn’t wanted to do any programming work over the summer, but since I worked with this Scoreboard software over the years so intensively, I got the Idea, I could write my own Scoreboard, just in case I’m ever able to live stream my simulated robot football games on YouTube and I'm in need for such software. As a good old saying goes: "<em>Better have, then need!</em>"</p>
<p>So I thought, it would be nice to have my own software at hand, without relying on the over complicated Scoreboard software of my friend, with technology I don't have or need. Don't get me wrong, my friends solution is almost perfect for the live football games at the Dante Stadion, but I doubt it would help me much in my streaming setup at home.</p>
<p>So on a hot summer evening with a beer in my hand, I thought to start a little side project, for the few hours of spare time I have during summer. I cooked up a small design, based upon two web pages, a control page with all the control elements, and an overlay page for all the overlay displays. Bound together with a simple REST API server. As technology I decided to use Javascript, <a target="_blank" href="https://p5js.org/">p5.js</a>, <a target="_blank" href="https://github.com/typicode/json-server">json-server</a> with <a target="_blank" href="https://nodejs.org/en/">node.js</a>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1661581377283/rLj5OhipG.png" alt="scoreboard.drawio.png" /></p>
<p>Here is a sneak peek of my current WIP prototype. As I said, it is a side project, which I work on only on my rare spare time. So it is far away from being finished. But I plan to finish it up and release it as open source along side of my <a target="_blank" href="https://arjs-public.github.io/arjs.projects.github.io/">football field generator</a>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1661581470381/J9Xeyr6r4.png" alt="Bildschirmfoto 2022-08-25 um 19.09.09.png" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1661581484724/3IPZtqwtG.png" alt="Bildschirmfoto 2022-08-25 um 19.09.03.png" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1661581496845/vuAsYFNdQ.png" alt="Bildschirmfoto 2022-08-25 um 19.09.35.png" /></p>
<h1 id="heading-work-life">Work life</h1>
<p>Of course I had to work in these 3 month, also. And work life wasn’t so interesting and satisfying as my private life, but a few things happened worth mentioning. And they will affect my life in the fall.</p>
<p>As usual in summer velocity at work goes down, since each and everyone goes on vacation has days off or doesn't want to stay late so often. And of course our customer has factory vacations, which results that the IT departments are also not fully available. Anyway, so we tried to fulfill the requests from our customer during this vacation challenge. It was hard, but despite of all the obstacles, with Developer-, Administrator-, Management- and sometimes even Hardware-Resources shortages, <strong>We delivered</strong>. We released new features, new bug-fixes and hot-fixes, as fast as we could, but in the end all this stress didn’t paid out. We won somehow the release battle, but also lost a lot during this period.</p>
<p>First we lost 3 java developers (2 senior and one junior), cause they had enough from this overcomplicated, stressing and less satisfying „scrum“ project and of course they got better paid offers from other IT companies. Then our customer was not satisfied of the quality of the software <em>(again, waterfall testing at the end, not agile testing as you would do in a good scrum project)</em>, the amount of features we delivered <em>(well, bad user stories and lack of good communication - no speaking englisch, only german, in an english speaking dev team setup)</em> and the pace we deliver <em>(Only old fashioned snowflake environments were provided by the customer, no cloud setup whatsoever, effecting in HW outages and delays, until the snowflake environments where no longer blocked or were fixed)</em>. </p>
<p>In addition our management was displeased, that we burn so much money with so little profit. Anyway, with all these factors, it is obviously clear, that a major change has to come, to improve or at least change the situation. </p>
<p>First we have to reshuffle our Devs into two new teams, so we do not have a very small team and a very big team for development. This will be challenging, since the small team is located all over Europe, and the big team is located in a single Eastern Europe country. And they are used to work together in an Office. Now they have to work in different teams and only remote. That will be interesting to see how this new teams will perform. Of course after they go through the "Forming", "Storming", "Norming" and "Performing" steps. </p>
<p>Then the customer wants changes in the process how and what we deliver. The process, which was designed many years before we came on board, was never adjusted. So our way to work (e.g. we using heavily Jira statuses to regulate the work flow) wasn't very compatible with the waterfall based approach the customer uses. So we used Jira Tags instead of statuses and that caused problems with the customer workflow. So they want us to change our processes to fit in their "agile" waterfall system. </p>
<p>Also they want us to abandon the complete Feature Epics approach. They want us to focus more on their weekly changed prioritized User Stories. So we deliver the features and bug-fixes they promised to their stakeholders. Even this causes chaos in delivering releases and leaves unfinished features hanging in the backlog. But that's what they want. Politics first, Features second. </p>
<p>At last our management wants us to be more productive and efficient in our work and the communication with the customer, so we loose so much time for extra work, communication and organizing releases, and we make more profit in the end. Which basically means that we have to make sure in each dev team there are at least two german speaking devs, so they can translate between Devs and product stakeholders.</p>
<p>Anyhow, this will be interesting times in the fall, and it will be interesting to see how this plays out at the end. And how it will affect me and my work at this project and this company. My prediction is as good as yours, but I speculate, that there will be either the end of the project for our company, soon, or that the customer reduces our contract and get a competitor on board, and starts a performance battle. And the winner get the renewed contract for next year. Anyway I’ll see.</p>
<p>On the positive side there was another change in my work life. I became a permanent member of our local <a target="_blank" href="https://handbookgermany.de/en/works-council">work council</a>. When I was elected in November 21 into the work council I was on 14th place on the election list. This ment with 9 permanent members (because of the employee count on our location), I was only a spare member, just in case someone is not available, but since there where 4 spare members before me, my chances to become a permanent member where not none, but very small, so I assumed. But as life goes, 5 permanent members left till May'22 and on early June I got the call, you’re now a permanent member of our local work council, reserve some time for your duties.</p>
<p>So I had an interesting time during my work summer because of that. I'd to learn all the new things about workers rights, work council duties and rights and how to deal with the upper company management, lawyers and other work council members in negotiations, meetings and talks. </p>
<p>And on top, since our company has a somewhat complex company structure, I’m now also a member of a joint work council, and a spare member in different other work groups of the different work councils. And as I learned in the short period since I’m permanent, the work for a work council can eat away quite some daily work time, very fast. Cause you have to read a lot of documents, emails, laws, have a ton of extra meetings and talks. And of course as result I have less time I can spend on my project and time I can spend with my teams. I assume this will also affects how and what I work in the fall and so it will not get boring till the end of the year.</p>
<p>Ok, guess that was enough to read for a "short" summer blogging hiatus update :-) </p>
<p>Oh, btw. if you like the look of my title image, I made this with a story telling tool you can find under (https://www.wps.de/modeler/). It is free and [open source|(https://github.com/WPS/domain-story-modeler).</p>
<p>As always apply this rule: <em>"Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."</em></p>
<p>Have a good one. Alex</p>
]]></content:encoded></item><item><title><![CDATA[My top 5 ideas for the next 12 month...]]></title><description><![CDATA[... if I find the time and energy for them...]]></description><link>https://blog.arjs.net/my-top-5-ideas-for-the-next-12-month</link><guid isPermaLink="true">https://blog.arjs.net/my-top-5-ideas-for-the-next-12-month</guid><category><![CDATA[ideas]]></category><category><![CDATA[Python]]></category><category><![CDATA[Flutter]]></category><dc:creator><![CDATA[Alex Schiessl]]></dc:creator><pubDate>Sun, 15 May 2022 16:12:07 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/ETRPjvb0KM0/upload/v1652631055374/mqPT86VnH.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Ok, time to write a new blog entry and most likely the last for this late spring / early summer, before the American Football season in Germany starts, and I'm busy with my friends streaming the football games of the <a target="_blank" href="https://www.munich-cowboys.de/">Munich Cowboys</a> on <a target="_blank" href="https://livestream.com/gfltv">GFL TV</a>. Of course I follow the NFL, too. And I hope I can get a ticket for the first NFL game in Germany in my hometown Munich. Well fingers crossed and hope for the best.</p>
<p>Anyway, so since my success with making dashboards in Elasticsearch/Kibana are more or less a failure so far, I currently cannot continue my little series about Jira, Node-Red, aso. </p>
<p>Hence, I've to find a new topic for this blog. Since another year passed by I thought I'll make an updated list of my top 5 ideas I want to work on the next 12 month, if I find the time and energy for them.</p>
<p>Most of my ideas are based upon writing python and javascript code. But there is one exception. But I'll come to this later.</p>
<h1 id="heading-ideas">Ideas</h1>
<p>Well so let the ideas flow:</p>
<h2 id="heading-idea-1">Idea 1</h2>
<p><em>Jira Dashboard in Python with Node-Red Rest API</em></p>
<p>My first idea is a Dashboard for the Jira Data I collect with Node-Red written in Python. I'll use the Python graphic module <a target="_blank" href="https://altair-viz.github.io/">Altair</a> or alternatively create the Dashboard in Javascript (using a open-source Graph library like charts.js or vis.js) with a Rest API backend implemented with Node-Red. Yes, you can do Rest API's with Node-Red. Have to look into using it for Mocking stuff for TDD, but this is another project.</p>
<p>Since my adventures around Jira and Elasticsearch/Kibana are not so satisfying so far, and since I generate my Jira events for Elasticsearch I have now ten-thousends of events in elastic search, I do not only want to use the search features of ES, I also want to tried to make some visualizations. But as mentioned so far I'm not happy what I got out of the Lens feature from Kibana. Especially I was hoping to get a heatmap, but apparently it is no longer available in the lens visualization library. </p>
<p>And, I've not found a way yet, to make a rolling average over all events on one numeric field. Especially I want the average over the Lead/Cycle Time of tickets.</p>
<p>Anyway I searched around and I found some interesting alternatives. One is the <a target="_blank" href="https://altair-viz.github.io/">Altair</a> module for python and the <a target="_blank" href="https://www.chartjs.org/">chart.js</a>/<a target="_blank" href="https://visjs.org/">vis.js</a> for Javascript.</p>
<p><em>Basic concept:</em></p>
<ol>
<li>Write a Rest API services in Node-Red to deliver the data (eg. rolling averages, unique count of statis) for the heatmap or other graphs.</li>
</ol>
<p>Variant a)</p>
<ol>
<li>Write some python code to generate Altair dashboard charts which consume the data from this Rest API services</li>
</ol>
<p>Variant b)</p>
<ol>
<li>Write some html/javascript code, preferably with the bootstrap framework, and use the Rest API services to generate the dashboard charts.</li>
</ol>
<p>But first I want to give Elasticsearch/Kibana a little more time. Or better I give me some more time to learn what ES/K has to offer.</p>
<h2 id="heading-idea-2">Idea 2</h2>
<p><em>Python Sequence Chart/Flow Chart</em></p>
<p>In my thesis, which I wrote some 30+ years, ago, for my Computer Science Diploma, I had the topic "Analyse C/C++ and generate meta-code from this analysis. And use this meta-code as basis for generating a graphical representation of the C/C++ code".</p>
<p>What can I say, I passed and got an A+ or as we count in Germany, a 1.0*. Ok, the graphical representation was not so fancy, but that was not important for my professor. Anyway, since then I wanted to redo this topic, with another language and do a better graphic. Many years back, I started with Java. Then a decade pause. Then I thought I do it with C#, in my C# phase. Again years passed by. Then I started with Javascript. Again, a pause. And forward years again, here we now in 2022, I ant to try it with python.</p>
<p><em>Basic concept:</em></p>
<ol>
<li><p>Find a python lexer/parser generator or write my own simplified lexer/parser. I might want to try <a target="_blank" href="https://www.antlr.org/">antlr</a> for that.</p>
</li>
<li><p>Define and develop the meta-code. I might reuse the meta-code I invented 30+ years ago. Or define a new one.</p>
</li>
<li><p>Bring lexer/parser and meta-code generation together. Write a ton of test, or better use TDD, I might use <a target="_blank" href="https://behave.readthedocs.io/en/stable/">behave</a> for that.</p>
</li>
<li><p>Write a visualization module, base upon the meta-code. Again use a graphical library for python which can deliver the flow chart feature. Or I might use <a target="_blank" href="https://mermaid-js.github.io/mermaid/#/">Mermaid</a> or <a target="_blank" href="https://plantuml.com/">PlantUML</a>.</p>
</li>
</ol>
<p>Well, I hope this time I find the time and energy to realize this idea.</p>
<h2 id="heading-idea-3">Idea 3</h2>
<p><em>Concept Map in Python with iGraph</em></p>
<p>Currently I work as a Scrum Master, hence I've to read a lot of User Stories, Defects and Requirements. So basically a lot of text. But since I'm a somewhat visual oriented person, I understand most concepts better if I see a graph or a visual representation of it.</p>
<p>A little background. In my early C# days, I was invited to a Microsoft Coding Dojo in Unterschleissheim near Munich. The main speaker for that evening event was Ralf Westphal a charismatic Programmer, Software Architekt and conference speaker. Btw. check out his website https://ralfw.de/. </p>
<p>He showed us at the beginning of the Dojo, how you can create a <a target="_blank" href="https://en.wikipedia.org/wiki/Concept_map">concept map</a> out of written requirements. And later use this concept map to identify classes, relationships, data models and even the basic infrastructure architecture.</p>
<p>Since back then I wanted a specialized software for drawing such concept maps. For a long time I used pen and paper to realize my concept maps. Then I used Mindmaps. But it was not what I wanted. So for a long time I carried this idea around with me to write my on specialized version.</p>
<p>Finally I think the time is right and the technologies are developed to write such a little tool.</p>
<p><em>Basic concept:</em></p>
<ol>
<li><p>Define a simple syntax for a one line parser syntax. Maybe use <a target="_blank" href="https://www.antlr.org/">antlr</a> as lexer/parser generator
E.g.:
red is a color
red is used in traffic lights
red is used as signal color
red is used to signal warning</p>
</li>
<li><p>Write a simple tkinter or alternatively a Web Interface for entering the concept map sentences</p>
</li>
<li><p>Implement the concept map generator based on the lexer/parser, maybe use <a target="_blank" href="https://igraph.org/python/">iGraph</a></p>
</li>
<li><p>Polish with save/load/print, aso.</p>
</li>
</ol>
<p>Here is a sample:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1652628903347/zRudzfyWI.png" alt="image.png" /></p>
<h2 id="heading-idea-4">Idea 4</h2>
<p><em>Robot Football Simulator Game</em></p>
<p>Another idea I have is to write a Robot Football Simulator Game. The idea is based on two separate ideas from other people(s). One inspiration was born 2002 from a little film sequence from <strong>"Star Wars II: Attack of the Clones"</strong>. There is a <a target="_blank" href="https://youtu.be/oKxN3EXAkvI?t=24">scene in a Bar</a>, where you see on screens some Robots playing (American) football. I liked this idea so much, that I never got it out of my mind. </p>
<p>Especially since I discovered American Football a few years earlier and I'm a fan of that sport. Hard, Regulated, Strategic, Technical challenging, entertaining, Team Sport, Individual performance and talent in players, what more can you want in a Sport. I even got involved with a local Football team, the Munich Cowboys. Anyway since 2002 I wanted to write such a game. </p>
<p>The beginning you can find in my Football Field Generator here:<br />https://arjs-public.github.io/arjs.projects.github.io/</p>
<p>The second inspiration came from a coding series about <a target="_blank" href="https://www.youtube.com/watch?v=9zfeTw-uFCw&amp;list=PLRqwX-V7Uu6bJM3VgzjNV5YxVxUwzALHV">genetic algorithms</a> from <a target="_blank" href="https://www.youtube.com/c/TheCodingTrain">The Coding Train (Daniel Shiffman)</a>. </p>
<p>He described how to implement a basic genetic algorithms in Javascript with <a target="_blank" href="https://p5js.org/">p5.js</a>.</p>
<p>And recently I found a very interesting <a target="_blank" href="https://www.youtube.com/watch?v=N3tRFayqVtk">Video from David Randal Miller</a> about programming creatures with genetic algorithm: <strong>"I programmed some creatures. They Evolved."</strong></p>
<p><em>Basic concept:</em></p>
<ol>
<li><p>Build a '<em>living'</em> environment for testing the football robots</p>
</li>
<li><p>Implement the 5 building blocks of genetic algorithm</p>
</li>
<li><p>Visualize the progress</p>
</li>
<li><p>Improve</p>
</li>
</ol>
<p>But it is not trivial, so it might take me several years to get it in a reasonable working state. </p>
<h2 id="heading-idea-5">Idea 5</h2>
<p><em>Flutter Desktop for macOS/linux</em></p>
<p>I mentioned, that my last idea is not based on Python or Javascript. So at Google I/O 2022, the Flutter team, announced Flutter 3.0 Stable, and with this version a stable support for macOS and Linux where introduced. Basically my last ideas will be based upon the programming language dart.</p>
<p>Basic concept:</p>
<ol>
<li><p>Use the 37h <a target="_blank" href="https://www.youtube.com/watch?v=VPvVD8t02U8">video course from freeCodeCamp.org</a> to learn dart and flutter</p>
</li>
<li><p>Build a start project with flutter/dart. Maybe the concept map idea? </p>
</li>
<li><p>Polish</p>
</li>
<li><p>Release as open source project</p>
</li>
</ol>
<p>Btw. I think, that Flutter will overtake the node.js/Electron combination in the next few years. I wouldn't be surprised if Visual Studio Code could be one of the early adopters. But we will see, what the creative minds will create with this new Desktop/Mobile cross-platform framework.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Ok, that where my top 5 ideas, I want to work on the next 12 month. Maybe you find something for yourself. Or you might have input or resources for me. Would be nice if you drop a comment.</p>
<p>With that written, I wish you all a nice, relaxing and peaceful spring/summer. Maybe give German American Football a try: <a target="_blank" href="https://livestream.com/gfltv">GFL TV</a></p>
<p>And maybe I drop a blog entry, if I come across something interesting. </p>
<p>As always apply this rule: "Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."</p>
<p>Have a good one. Alex  </p>
]]></content:encoded></item><item><title><![CDATA[My (current) solution to push Jira ticket events via Node-Red to Elasticsearch...]]></title><description><![CDATA[So, due to my Easter break, my Node-Red/Jira update was a little delayed. Ja, not much to do at work. Our car manufacturer client, still is reluctant to…]]></description><link>https://blog.arjs.net/my-current-solution-to-push-jira-ticket-events-via-node-red-to-elasticsearch</link><guid isPermaLink="true">https://blog.arjs.net/my-current-solution-to-push-jira-ticket-events-via-node-red-to-elasticsearch</guid><category><![CDATA[elasticsearch]]></category><category><![CDATA[Node.js]]></category><category><![CDATA[automation]]></category><dc:creator><![CDATA[Alex Schiessl]]></dc:creator><pubDate>Sat, 23 Apr 2022 16:08:11 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1650724881442/E-f3ouk0-.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-introduction">Introduction</h3>
<p>So, due to my Easter break, my Node-Red/Jira update was a little delayed. Ja, not much to do at work. Our car manufacturer client, still is reluctant to adapt to Scrum, so no need on my side to do Team Building Workshops and/or Scrum/Kanban trainings. So I'm reduced to drop a piece of wisdom once in a while about the correct meaning of Scrum terms. </p>
<p>Latest "highlight" from our client. The Manager in charge of the whole Department, said, he wants from us ASAP the velocity we have left for the next release of the product. So I couldn't resit and correct him, that the "velocity" is calculated from the achieved SP of the past sprints. And that the "capacity" the team has left to achieve or better over-achieve the planned Sprint goal is documented at the agreed confluence page. Well, what can you say, our client is how he is. If he doesn't want to change you cannot force him to. Anyway, that means more time for my little project, hence back to my Node-Red/Jira project extension to Elasticsearch.</p>
<p>In the <a target="_blank" href="https://blog.arjs.net/custom-jira-bot-for-ms-teams-using-node-red-and-rethinkdb">last post</a> I described how I implemented the push of ticket change information via Jira RSS to MS Teams via Node-Red. As I also mentioned I wanted to extend my Node-Red flow to also push the information to Elasticsearch, to do some Kibana Dashboards for KPIs and other analytics.</p>
<p>So my Jira RSS flow in Node-Red downloaded the information from changed tickets via Jira Rest API (<em>/rest/api/2/issue/?expand=changelog</em>) to a RethinkDB.</p>
<p>With that url I get all the essential information about a Jira ticket, including the "changelog". And that "changelog" is exactly what I need to generate the information for Elasticsearch.</p>
<p>So here is the new flow for the push to Elasticsearch and the needed modules for Node-Red:</p>
<p>Part 1: Modules</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650725806445/cnzQ6Qw-A.png" alt="Screenshot 2022-04-21 121232 Kopie.png" /></p>
<p>Part 2: Addition of a flow link to the elastic push flow</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650725850532/erOk35CNn.png" alt="Bot.png" /></p>
<p>Part 3: The elastic push flow</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650725884216/Ux5oHrG8E.png" alt="Screenshot 2022-04-21 121411.png" /></p>
<h3 id="heading-part-1">Part 1</h3>
<p>To push information via Node-Red to Elasticsearch, I use the free Node-Red module "node-red-contrib-elasticsearch-continued". I used this module, because the source code is available on <a target="_blank" href="https://github.com/Steve-Nzr/node-red-contrib-elasticsearch-continued">guthub.com</a> and it has the nodes (exists, create, update) I needed to do my flow.</p>
<h3 id="heading-part-2">Part 2</h3>
<p>Ok, in Part 2 there is only one small addition the flow out link:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650726437013/IuCMwCiO6.png" alt="bot-addition.png" /></p>
<p>With this flow out link, you can connect a flow on a different flow tab. What this link does, is that when a change is promoted to MS Teams, it also starts the elastic flow from Part 3. Very easy and simple, like a function call. And not much of a change of the existing Bot functionality.</p>
<h3 id="heading-part-3">Part 3</h3>
<p>If you look at the Part 3, here lies the real change for the push to Elasticsearch. </p>
<p>Basically there are three components:</p>
<ol>
<li><p>The actual push to elastic flow:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650727907531/XU6jkiH1I.png" alt="elastic.png" /></p>
</li>
<li><p>The initialization of the event information during Node-Red startup:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650726797640/kzHi25NPv.png" alt="changes-at-startup.png" /></p>
</li>
<li><p>The persistence of the pushed events:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650726837899/V5_ecuBKO.png" alt="save-changes.png" /></p>
</li>
</ol>
<h4 id="heading-component-persistence">Component "Persistence"</h4>
<p>Ok, let's start with Component "Persistence". Again, I use RethinkDB to persist the control variables. As already mentioned I do this, to avoid that duplicate entries are created over and over again. And this spam is cloaking up Node-Red and Elasticsearch.</p>
<p>Secondly currently I have no clue how I could achieve it otherwise in Node-Red. </p>
<p>Also during testing I found out, that my local docker setup can only handle so many storage operation, before it shuts down. Hence I needed to introduce a throttle mechanism. Luckily Node-Red has a node "delay" for that. And I could very easily limit to send of messages to 5 messages per second. Problem solved</p>
<p>But let's start at the beginning. So the manual trigger "Store Changes", is only for testing the store process or do manual saves. The actual trigger is the "status: 2" trigger. </p>
<p>The status node is a node that listens on changes of other Node-Red nodes. In my case I listen on the two nodes "limit create" and "limit update". Here I listen for the queue length. To use this information, I use a switch node, where you can evaluate values from a message. Here I check if the queue length is greater 0. If greater, then the port 2 of the switch is triggered. If the queue is empty, the Done port 1 is triggered.</p>
<p>As I mentioned I have to make sure to avoid duplicate entries. Hence I created a, Ja I know not very good, solution. I delete (r<em>.table("changes").delete();</em>) the changes table in the RethinkDB. I also delay the store for 5s to hope the deletion is through by then. After that I create the store messages for the RethinkDB.</p>
<pre><code><span class="hljs-keyword">var</span> _queue <span class="hljs-operator">=</span> global.get(<span class="hljs-string">'queue'</span>) <span class="hljs-operator">|</span><span class="hljs-operator">|</span> [];
<span class="hljs-keyword">var</span> _changes <span class="hljs-operator">=</span> global.get(<span class="hljs-string">'changes'</span>) <span class="hljs-operator">|</span><span class="hljs-operator">|</span> {};
Object.entries(_changes).forEach(_item <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> {
    <span class="hljs-keyword">var</span> _id <span class="hljs-operator">=</span> _item[<span class="hljs-number">0</span>];
    <span class="hljs-keyword">if</span> (<span class="hljs-operator">!</span>(_queue.includes(_id))) {
       _queue.<span class="hljs-built_in">push</span>(_id);

       <span class="hljs-comment">// Create new msg</span>
       <span class="hljs-keyword">var</span> newMsg <span class="hljs-operator">=</span> {};
       newMsg.topic <span class="hljs-operator">=</span> <span class="hljs-string">"update"</span>;
       newMsg.payload <span class="hljs-operator">=</span> { <span class="hljs-string">"id"</span>: _id, <span class="hljs-string">"value"</span>: _item[<span class="hljs-number">1</span>] };
       node.<span class="hljs-built_in">send</span>(newMsg);
     }
});
global.set(<span class="hljs-string">'queue'</span>, _queue);
<span class="hljs-keyword">return</span> null;
</code></pre><p>After a while I noticed that a ton of save changes events are generated, since the "0" queue event is happening very often, since the handling of Node-Red is so freaking fast. At one point I had over 1 million events scheduled, even only about 1000 tickets are stored. </p>
<p>Hence I had to create a queue to control what message was already sent, to reduce and cleanup this load. But with that I needed a mechanism to delete the queue, when all change messages are stored to the RethinkDB.</p>
<p>But that was very easy. I used the status node again, to check for an empty queue of the store messages.</p>
<pre><code><span class="hljs-keyword">var</span> _count <span class="hljs-operator">=</span> parseInt(<span class="hljs-built_in">msg</span>.status.text);
<span class="hljs-keyword">if</span> (_count <span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-number">0</span>) {
  global.set(<span class="hljs-string">'queue'</span>, []);
}
<span class="hljs-keyword">return</span> null;
</code></pre><p>With that out of the way, I had a safe and reliable way to persist every change to the RethinkDB.</p>
<h4 id="heading-component-startup">Component "Startup"</h4>
<p>Ok, lets continue with Component "Startup", it is actually the easiest of those three. To avoid to save duplicates, I keep for each ticket key, a record what was the last event I pushed to Elasticsearch. So I can first of all avoid to push all events over and over again and of course do some optimization. </p>
<p>With the saved last event number, a simple compare is sufficient to filter out already sent messages. This is very easy, cause the Jira changelog keeps a value with the count of change records. But more later.</p>
<p>As you can see, there is a little Javascript needed for the initialization:</p>
<pre><code><span class="hljs-keyword">var</span> _data <span class="hljs-operator">=</span> <span class="hljs-built_in">msg</span>.payload;
<span class="hljs-keyword">var</span> _changes <span class="hljs-operator">=</span> {};
<span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i <span class="hljs-operator">=</span> <span class="hljs-number">0</span>; i <span class="hljs-operator">&lt;</span> _data.<span class="hljs-built_in">length</span>; i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
  <span class="hljs-keyword">var</span> _key <span class="hljs-operator">=</span> _data[i].id;
  <span class="hljs-keyword">var</span> _value <span class="hljs-operator">=</span> _data[i].<span class="hljs-built_in">value</span>;
  <span class="hljs-keyword">if</span> (<span class="hljs-operator">!</span>(_key in _changes)) {
     _changes[_key] <span class="hljs-operator">=</span> _value;
  }
 }
 global.set(<span class="hljs-string">'changes'</span>, _changes);
 <span class="hljs-keyword">return</span> null;
</code></pre><p>This little script simply converts the information delivered with msg.payload I get from the <em>Get Changes</em> node from the RethinkDB table, to key/value pairs in a global flow variable <em>changes</em>.</p>
<p>To trigger this script whenever Node-Red starts, I use a special functionality from the Node-Red trigger node. This node has an option to trigger the following nodes after a delay. I simply use the standard delay of 0.1s. So after 0.1s the load of the changes to the internal Node-Red global storage is triggered. Very handy!</p>
<h4 id="heading-component-push">Component "Push"</h4>
<p>Finally lets describe the "Push" Component. The actual Elasticsearch push.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650728269050/RPCsUHNcz.png" alt="elastic-start.png" /></p>
<p>The start of the flow looks very complex, but it really isn't. Actually only the link in node is relevant. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650728390961/2vb-6HQrO.png" alt="linkin.png" /></p>
<p>This node is linked to the Bot trigger link out flow. So this flow in trigger is triggered when a change was registered. Since the msg generated by the bot flow contains the type of change in the message topic, I can use this information to request the ticket information from RethinkDB: </p>
<pre><code>r.table(<span class="hljs-string">'issues'</span>).filter(doc <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span>
  doc(<span class="hljs-string">'fields'</span>)(<span class="hljs-string">'status'</span>)(<span class="hljs-string">'name'</span>).match(<span class="hljs-built_in">msg</span>.topic)
);
</code></pre><p>The information delivered in the meassage payload can then be converted in the information I want to push to elasticsearch. Here is the Javascript for the "Request Update".</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650729184721/gbCWWXeeq.png" alt="elastic-filter.png" /></p>
<pre><code><span class="hljs-keyword">var</span> _changes <span class="hljs-operator">=</span> global.get(<span class="hljs-string">'changes'</span>) <span class="hljs-operator">|</span><span class="hljs-operator">|</span> {};
<span class="hljs-keyword">var</span> _payload <span class="hljs-operator">=</span> <span class="hljs-built_in">msg</span>.payload;
<span class="hljs-keyword">var</span> _key <span class="hljs-operator">=</span> _payload.key;
<span class="hljs-keyword">var</span> _status <span class="hljs-operator">=</span> _payload.fields.status.<span class="hljs-built_in">name</span>;
<span class="hljs-keyword">var</span> _kind <span class="hljs-operator">=</span> _payload.fields.issuetype.<span class="hljs-built_in">name</span>;
<span class="hljs-keyword">var</span> _team <span class="hljs-operator">=</span> <span class="hljs-string">'-'</span>;
<span class="hljs-keyword">if</span> (_payload.fields.labels.includes(<span class="hljs-string">'TEAM-1'</span>)) {
    _team <span class="hljs-operator">=</span> <span class="hljs-string">'TEAM-1'</span>;
} <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (_payload.fields.labels.includes(<span class="hljs-string">'TEAM-2'</span>)) {
    _team <span class="hljs-operator">=</span> <span class="hljs-string">'TEAM-2'</span>;
} <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (_payload.fields.labels.includes(<span class="hljs-string">'TEAM-3'</span>)) {
    _team <span class="hljs-operator">=</span> <span class="hljs-string">'TEAM-3'</span>;
} <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (_payload.fields.labels.includes(<span class="hljs-string">'TEAM-4'</span>)) {
    _team <span class="hljs-operator">=</span> <span class="hljs-string">'TEAM-4'</span>;
}

<span class="hljs-comment">// create new entry for a new key/ticket</span>
<span class="hljs-keyword">if</span> (<span class="hljs-operator">!</span>(_key in _changes)) {
    _changes[_key] <span class="hljs-operator">=</span> {
        stamp: <span class="hljs-keyword">new</span> Date().toISOString(),
        total: <span class="hljs-number">0</span>,
        last: <span class="hljs-number">0</span>
    }
}

<span class="hljs-keyword">var</span> _idstart <span class="hljs-operator">=</span> <span class="hljs-number">100</span>;
<span class="hljs-keyword">var</span> _total <span class="hljs-operator">=</span> _payload.changelog.total;
<span class="hljs-keyword">var</span> _stamp <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> Date().toISOString();
<span class="hljs-keyword">var</span> _current <span class="hljs-operator">=</span> _changes[_key];
<span class="hljs-keyword">var</span> _count <span class="hljs-operator">=</span> _current.last;

<span class="hljs-comment">// if no new changes we are done</span>
<span class="hljs-keyword">if</span> (_current.total <span class="hljs-operator">&gt;</span><span class="hljs-operator">=</span> _total) <span class="hljs-keyword">return</span> null;

<span class="hljs-comment">// loop through the changes</span>
<span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> _i <span class="hljs-operator">=</span> _current.total; _i <span class="hljs-operator">&lt;</span> _total; _i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
    <span class="hljs-keyword">var</span> _entry <span class="hljs-operator">=</span> _payload.changelog.histories[_i];
    _stamp <span class="hljs-operator">=</span> _entry.created;
    _entry.items.forEach(_item <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> {
        <span class="hljs-comment">// New id from key, id start + item count</span>
        <span class="hljs-keyword">var</span> _id <span class="hljs-operator">=</span> _key <span class="hljs-operator">+</span> <span class="hljs-string">'_'</span> <span class="hljs-operator">+</span> (_idstart <span class="hljs-operator">+</span> _count<span class="hljs-operator">+</span><span class="hljs-operator">+</span>);

        <span class="hljs-comment">// Create new entry for elasticsearch</span>
        _from <span class="hljs-operator">=</span> (_item.fromString) ? _item.fromString : <span class="hljs-string">''</span>;
        _to <span class="hljs-operator">=</span> (_item.toString) ? _item.toString : <span class="hljs-string">''</span>;
        <span class="hljs-keyword">if</span> (_item.field <span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-string">'description'</span>) {
            _from <span class="hljs-operator">=</span> (_from) ? _from.substring(<span class="hljs-number">0</span>,<span class="hljs-number">49</span>) <span class="hljs-operator">+</span> <span class="hljs-string">'...'</span> : <span class="hljs-string">''</span>;
            _to <span class="hljs-operator">=</span> (_to) ? _to.substring(<span class="hljs-number">0</span>,<span class="hljs-number">49</span>) <span class="hljs-operator">+</span> <span class="hljs-string">'...'</span> : <span class="hljs-string">''</span>;
        }
        _rdate <span class="hljs-operator">=</span> null;
        <span class="hljs-keyword">if</span> (<span class="hljs-string">'resolutiondate'</span> in _payload.fields) {
            _rdate <span class="hljs-operator">=</span> _payload.fields.resolutiondate;
        }

        <span class="hljs-comment">// Create new msg</span>
        <span class="hljs-keyword">var</span> newMsg <span class="hljs-operator">=</span> {};
        newMsg.documentIndex <span class="hljs-operator">=</span> <span class="hljs-string">"tickets"</span>;
        newMsg.documentType  <span class="hljs-operator">=</span> <span class="hljs-string">"message"</span>;
        newMsg.documentId    <span class="hljs-operator">=</span> _id;
        newMsg.payload <span class="hljs-operator">=</span> {
            <span class="hljs-string">"@timestamp"</span>: _stamp,
            <span class="hljs-string">"key"</span>: _key,
            <span class="hljs-string">"kind"</span>: _kind,
            <span class="hljs-string">"status"</span>: _status,
            <span class="hljs-string">"reason"</span>: (_payload.fields.customfield_13000) ? _payload.fields.customfield_13000.<span class="hljs-built_in">value</span> : <span class="hljs-string">'-'</span>,
            <span class="hljs-string">"resolution"</span>: (_payload.fields.resolution) ? _payload.fields.resolution.<span class="hljs-built_in">name</span> : <span class="hljs-string">'-'</span>,
            <span class="hljs-string">"resolutiondate"</span>: _rdate,
            <span class="hljs-string">"team"</span>: _team,
            <span class="hljs-string">"effort"</span>: (_payload.fields.customfield_12401) ? _payload.fields.customfield_12401.<span class="hljs-built_in">value</span> : <span class="hljs-string">'-'</span>,
            <span class="hljs-string">"points"</span>: (_payload.fields.customfield_12006) ? _payload.fields.customfield_12006 : null,
            <span class="hljs-string">"author"</span>: _entry.author.displayName,
            <span class="hljs-string">"change"</span>: _item.field,
            <span class="hljs-string">"from"</span>: _from,
            <span class="hljs-string">"to"</span>: _to
        };
        node.<span class="hljs-built_in">send</span>(newMsg);
    });
}
_current.last <span class="hljs-operator">=</span> _count;
_current.total <span class="hljs-operator">=</span> _total;
_current.stamp <span class="hljs-operator">=</span> _stamp;
global.set(<span class="hljs-string">'changes'</span>, _changes);
<span class="hljs-keyword">return</span> null;<span class="hljs-string">",</span>
</code></pre><p>Here again, I ran into a problem. My docker setup was not powerful enough to handle all the messages. So I once again hat to add a throttle the message to the "exists" check against Elasticsearch. </p>
<p>Since the Node-Red Elasticsearch nodes I use, use the Elasticsearch Rest API, and the specifice implementation (see on top) does not have an upsert, I had to introduce an exists check, which basically just checks, if a message was already sent. Depending on the outcome the switch node decide to use the create or the update Elasticserach functionality. </p>
<p>But with this extra exists check, a new msg field "exists" was introduced, so I had to add some code to remove this extra info.</p>
<pre><code><span class="hljs-keyword">if</span> (<span class="hljs-string">'exists'</span> in <span class="hljs-built_in">msg</span>) {\n    <span class="hljs-keyword">delete</span> <span class="hljs-built_in">msg</span>[<span class="hljs-string">'exists'</span>];\n}\nreturn <span class="hljs-built_in">msg</span>;
</code></pre><p>And once again, a throttle was needed, to not overload my system. And finally the Elasticsearch Rest API was called. There is not much to show, since the Rest API call is hidden in the node.js of the node, which simply takes the message and send it to Elasticsearch. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650729454131/bXKNEBTws.png" alt="elastic-push.png" /></p>
<p>The only problem I ran into with these nodes, where that the nodes have a Elasticsearch configure node, with host and port fields, but the actual node.js does only use the host field, so the port field is not used. And you have to add the port to the host url, like <em>http://localhost:9200</em>. With that out of the way everything worked. </p>
<p>And here how it looked in Kibana:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650729501189/F5uLDwh8I.png" alt="Screenshot 2022-04-21 121435.png" /></p>
<p>Next step is to create some useful KPI dashboards out of this data. But that's another post in the future.</p>
<h3 id="heading-conclusion">Conclusion</h3>
<p>Well, what did I learn. Node-Red is a great flow based programming system. Very flexible, very variable and very easily extendable, if there are modules. There are many specialized nodes available, but sometimes with the problem of un-maintained code and/or documentation. </p>
<p>So sometimes you have to dig through github code to understand how they work or where the error lies in your flow. Like the not used port field. </p>
<p>I don't think it is production ready. For example I have now clue how to make a HA setup with it. But for local and simple automation task, definitely a great option.</p>
<p>And I learned, that I have to understand a lot more of the core nodes of Node-Red, to make efficient and beautiful flows. Currently I have to jump through extra hoops, like extra queues or other stuff, to keep the flow working. </p>
<p>So my flows are not perfect by any means. There is room to grow in the future. But for now I'm very satisfied with my success. I have my MS Teams bot, which informs me that a ticket was updated. I have the events in Elasticsearch with the changes. And now, I have the change to use the power of Elasticsearch and Kibana to do something with the data, outside of Jira. </p>
<p>Of course Jira has a lot of such feature already and with the Marketplace you can find a lot of nice extra extensions. But in an enterprise environment, there are some challenges with that. And with my solution I have it completely in my hands. </p>
<p>So thanks for reading and I hope you got some inspiration or a little bit Know How out of it.</p>
<p>As always apply this rule: "Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."</p>
<p>Have a good one. Alex  </p>
]]></content:encoded></item><item><title><![CDATA[Custom Jira-Bot for MS Teams using Node-Red and RethinkDB]]></title><description><![CDATA[Or why not to use a new approach]]></description><link>https://blog.arjs.net/custom-jira-bot-for-ms-teams-using-node-red-and-rethinkdb</link><guid isPermaLink="true">https://blog.arjs.net/custom-jira-bot-for-ms-teams-using-node-red-and-rethinkdb</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[code]]></category><category><![CDATA[Experience ]]></category><dc:creator><![CDATA[Alex Schiessl]]></dc:creator><pubDate>Sun, 13 Mar 2022 12:01:17 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1647173164886/aDPXvRey-.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Today, I want to show you my little project I did at my <em>spare</em> time at work, to make my 
<a target="_blank" href="https://blog.arjs.net/love-to-fail-at-work-or-fail-to-love-your-work">work</a> more fun again. In a previous post, I wrote about my experience at work and how I found love again, to do my job and doing this project helped with it.</p>
<p>One part of continue my job, beside the Teams and the good working condition, is stuff like this, I can do, cause our client is stuck in I.T. from 2010 and I do not have to coach or improve processes.</p>
<p>Ok, let's dive into it. Two of my teams have to rely heavily on the tags feature of the Jira ticketing system. All cause the client does not allow us to use standard features, such as Environment, Team, Portfolio fields and similar fields.<br />Reason: <strong>It messes up our filters for billing.</strong> :-O</p>
<p>Anyway, to cope with the situation, we built most of our processes all around the tags feature of the Jira ticketing system. But since we are all human beings, stuff gets missed or forgotten or not followed. In addition, we also got two new PO, the old PO quit after 1,5h, cause of work overload and our difficult client. So two new PO's where hired to avoid the bad situation from the past. One PO for each team, should lower the workload and they can help each other and give them more standing at the client. But since they are both new to the project and din't had much training by the now gone old PO, and they are not used to such complicated ticket handling in Jira, I have to double sometime tripple check each updated ticket, to see if it is fill out correctly and the processes are fulfilled. I don't want to do it, but if I don't do it, it results in a somewhat chaos at the end of the Sprint, when billing or release time comes up.</p>
<p>Back to the topic. Before I wrote my bot, I sat down every morning with my coffee and went over my email inbox and checked for changed tickets emails, opened the ticket and verified it and correct it if necessary. But after I did this for a few weeks, it felt like a cumbersome and boring task. And part of my DevOps mindset said, "<em>Can't I automate that somehow!?</em>". So since I haven't to do much agile coaching for my teams or better for the client, I used my <em>spare</em> time to write me a notification bot.</p>
<p>Of course I could try to write a bot for MS Teams, but then I would be locked in to that Microsoft Universe. So I decided to use a different approach. I use Node-Red for my weather station visualization at home, and it works perfect, so I decided I implement my bot with Javascript in Node-Red. And if possible with ready available standard nodes. And only with some custom Javascript if needed. I hope that with that approach to make the system flexible and easy transferable. So in case I want to replace MS Teams, with Slack, Yammer or Discord, it can be done relatively easily. </p>
<p>That's how I started my "<strong>Node-Red-Jira-For-MS-Teams</strong>"-Bot. Here is the simple architecture overview. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1647173189469/-s9ZgZohy.png" alt="node-red-jira (1).png" /></p>
<p>I decided for RethinkDB, cause in addition to save some basic information from the RSS feed, like Ticket No and update date, I also want to save the actual ticket information in json format, for later use. To be precise to try out Grafana+Loki or the ELK Stack for more detailed analysis of our tickets, at a later time.</p>
<p>Ok, lets continue. First I started with two simple flows in Node-Red. The RSS-Change flow and the RSS-Storage-Delete flow.</p>
<p>The RSS-Change flow is basically only for monitoring and debugging. Hence after everything was working, I disabled it. Here is the flow:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1647170745664/u55pE81yD.png" alt="jiraflow-RSS-changes.png" /></p>
<p>Design decision here, was simple. Simple use the monitor node that comes with the RethinkDB nodes and dump it to a debug node.</p>
<p>The RSS-Storage-Delete flow was necessary, to clean out the store once in a while. Cause it seams a good idea to have a wipe once in a while and start fresh. Here is the flow and the code:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1647170490648/2eZfu9FfV.png" alt="jiraflow-RSS-delete.png" /></p>
<pre><code><span class="hljs-keyword">global</span>.<span class="hljs-keyword">set</span>(<span class="hljs-string">'items'</span>, {})
<span class="hljs-keyword">return</span> <span class="hljs-keyword">null</span>;
</code></pre><p>Design decision here, was to handle all the data storage in the database or do some caching. I decided to do caching in the global storage of Node-Red. Hence the simple delete code.</p>
<p>Next I started out to create the flow for getting the Jira changes. First I needed a start point. Usually if you have nothing else, you use a trigger node in Node-Red. With this trigger node you can trigger the execution by click or e.g. as a timed trigger. In my case I deceided for 15 min trigger event.</p>
<p>Next step getting data. Since Jira offers a RSS feature for jql-queries, it was easy to convert the Kanban Board query to a RSS feed url. The feed delivers all changes to tickets filtered by the specific jql-query. Problem here is simply, that you cannot specifiy what information you want to delivered in the result XML. Anyway, no problem here.</p>
<p>So here is the flow so far (doted line):</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1647170820834/iax-orPfO.png" alt="jiraflow-RSS-flow-1.png" /></p>
<p>With the result XML at hand I could continue dealing with what I want to do with the XML. So I created a function node, dealing with the XML:</p>
<pre><code><span class="hljs-comment">// extract payload item data</span>
<span class="hljs-keyword">var</span> data <span class="hljs-operator">=</span> <span class="hljs-built_in">msg</span>.payload.rss.channel[0].item;

<span class="hljs-comment">// get the items cache if it exists otherwise an empty dictionary</span>
<span class="hljs-keyword">var</span> items <span class="hljs-operator">=</span> global.get(<span class="hljs-string">'items'</span>) <span class="hljs-operator">|</span><span class="hljs-operator">|</span> {};
<span class="hljs-keyword">var</span> list <span class="hljs-operator">=</span> [];

<span class="hljs-comment">// loop over the elements in the payload data</span>
<span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i <span class="hljs-operator">=</span> <span class="hljs-number">0</span>; i <span class="hljs-operator">&lt;</span> data.<span class="hljs-built_in">length</span>; i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
 <span class="hljs-keyword">var</span> title <span class="hljs-operator">=</span> data[i].title;
 <span class="hljs-keyword">var</span> datetime <span class="hljs-operator">=</span> data[i].pubDate[<span class="hljs-number">0</span>];

 <span class="hljs-comment">// since there is no jira ticket key field, it must be extracted from the title via regex</span>
 <span class="hljs-keyword">var</span> rx <span class="hljs-operator">=</span> <span class="hljs-operator">/</span><span class="hljs-operator">^</span>\[(TICKET\<span class="hljs-operator">-</span>\d<span class="hljs-operator">*</span>)\]\s.*$<span class="hljs-operator">/</span>;
 <span class="hljs-keyword">var</span> arr <span class="hljs-operator">=</span> rx.exec(title);
 <span class="hljs-keyword">var</span> key <span class="hljs-operator">=</span> arr[<span class="hljs-number">1</span>];

 <span class="hljs-comment">// If not in cache, store it</span>
 <span class="hljs-keyword">if</span> (<span class="hljs-operator">!</span>(key in items)) {
   items[key] <span class="hljs-operator">=</span> datetime;
   list.<span class="hljs-built_in">push</span>(key);
} <span class="hljs-keyword">else</span> {
   <span class="hljs-comment">// if in cache and it was updated, store it</span>
   <span class="hljs-keyword">if</span> (items[key] <span class="hljs-operator">&lt;</span> datetime) {
       items[key] <span class="hljs-operator">=</span> datetime;
       list.<span class="hljs-built_in">push</span>(key);
   }
 }
}

<span class="hljs-comment">// no loop over each cache item and create a new updated msg for each ticket and send it to the next node</span>
Object.entries(items).forEach(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">[key, value]</span>) </span>{
    <span class="hljs-keyword">var</span> newMsg <span class="hljs-operator">=</span> {};
    <span class="hljs-keyword">if</span> (list.includes(key)) {
        newMsg.topic <span class="hljs-operator">=</span> <span class="hljs-string">'Update'</span>;
        newMsg.update <span class="hljs-operator">=</span> { <span class="hljs-string">"key"</span>: key, <span class="hljs-string">"value"</span>: value };
        node.<span class="hljs-built_in">send</span>(newMsg);
    }
});

<span class="hljs-comment">// save the cache to the global storage</span>
global.set(<span class="hljs-string">'items'</span>, items);

<span class="hljs-comment">// eliminate the XML message</span>
<span class="hljs-keyword">return</span> null;
</code></pre><p>So nothing fancy, just some plain looping, restructuring, creating and sending messages, and bookkeeping. Ja experienced Javascript programmers will see some problems, especially with, what happens in case of errors. I have it on my list. But I follow the good old principle:    </p>
<blockquote>
<p>First make it run, then make it fast and at last make it pretty and safe.</p>
</blockquote>
<p>So with the essential information extracted, what to do with the messages. Here the flow so far:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1647171243747/FaI5Mijbm.png" alt="jiraflow-RSS-flow-2.png" /></p>
<p>Of course debugging. Done with a debug node. Actually two debug nodes. One for the whole message and one for only the payload. </p>
<p>Next addition persistence of the RSS tickets. Since the whole system is running on my company notebook in Docker for Windows, it will shutdown every evening. So I would possible loose the data I stored in the Node-Red cache so far. Hence I needed to persist the cache. Solution store the information in a database. In my case I selected RethinkDB (why not use a different approach and path). </p>
<p>The RethinkDB got a new very simple table "rss_jedi" - btw. Jedi is just a nickname the teams chooses for themself -, where I could store the items array and each timestamp for the item. To do this was not so problematic. Or wasn't it. </p>
<p>Well I ran into a problem. I don't know why, but if an RSS item was already in the RethinkDB table, it was not overwritten or replaced, as I configured in the conflict argument. Instead it created a new entry in the DB. Hence I soon had many duplicates in the RSS DB.</p>
<pre><code>r.table(<span class="hljs-string">"rss_jedi"</span>).insert(
  <span class="hljs-built_in">msg</span>.update, { conflict: <span class="hljs-string">'replace'</span> }
);
</code></pre><p>So even I had a conflict handling configured, it did not work for the RSS items persistence. So I had to use  </p>
<pre><code>r.table(<span class="hljs-string">"rss_jedi"</span>).filter(r.row(<span class="hljs-string">'key'</span>).eq(<span class="hljs-built_in">msg</span>.update.key)).delete();
</code></pre><p>to delete the entry in the DB first, and then I could update it with above insert code. And since I had to make sure it happens sequentially, I needed a wait node, which delayed the insert message for 5s, so the previous delete was complete. This is a workaround, since the RethinkDB nodes don't have output connectors, hence you cannot daisy chain them. The progress so far:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1647171267498/tOdC9geOH.png" alt="jiraflow-RSS-flow-3.png" /></p>
<p>Finally only two more challenges to do. First, what happens when I restart the flow, when I start Docker for Windows in the morning. How do I fill the cache. For that I simply used the trigger at the beginning and a function node with the following code:</p>
<pre><code><span class="hljs-comment">// Data from the RethinkDB RSS DB</span>
<span class="hljs-keyword">var</span> data <span class="hljs-operator">=</span> <span class="hljs-built_in">msg</span>.payload;
<span class="hljs-keyword">var</span> items <span class="hljs-operator">=</span> {};

<span class="hljs-comment">// loop over the DB entries and fill the cache</span>
<span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i <span class="hljs-operator">=</span> <span class="hljs-number">0</span>; i <span class="hljs-operator">&lt;</span> data.<span class="hljs-built_in">length</span>; i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
 <span class="hljs-keyword">var</span> key <span class="hljs-operator">=</span> data[i].key;
 <span class="hljs-keyword">var</span> datetime <span class="hljs-operator">=</span> data[i].<span class="hljs-built_in">value</span>;
 <span class="hljs-keyword">if</span> (<span class="hljs-operator">!</span>(key in items)) {
   items[key] <span class="hljs-operator">=</span> datetime;
 }
}
global.set(<span class="hljs-string">'items'</span>, items);
<span class="hljs-keyword">return</span> null;
</code></pre><p>The experienced viewer will note a problem right away. Isn't that cache filling triggered every 15 minutes, too. Yup, it is. But since in the normal case, the persistent cache is equal to the Node-Red cache, it is overwritten with the same data. But you're right a better solution should be found.</p>
<p>And at last, the last challenge. I mentioned earlier that I want to persist the changed tickets, for later use with Grafana/Loki or ELK, so I needed a flow for that, too. So for that I need the ticket information first. Luckily with Jira and the REST Api it is trivial, hence this simple code:</p>
<pre><code><span class="hljs-built_in">msg</span>.url <span class="hljs-operator">=</span> <span class="hljs-string">"https://xxx/jira/rest/api/2/issue/"</span> <span class="hljs-operator">+</span> <span class="hljs-built_in">msg</span>.update.key + <span class="hljs-string">"?expand=changelog"</span>
<span class="hljs-built_in">msg</span>.payload <span class="hljs-operator">=</span> {}
<span class="hljs-keyword">return</span> <span class="hljs-built_in">msg</span>;
</code></pre><p>I simply use the REST Api URL, add the Jira ticket key, add the desired change-log and send this into a http request, which uses the json data header and the payload and url to retrieve the ticket data and stores it into a new RethinkDB table. Funny thing here is, that here the conflict solving worked. Here is the code:</p>
<pre><code>r.table(<span class="hljs-string">'issues'</span>).insert(<span class="hljs-built_in">msg</span>.payload, { conflict: <span class="hljs-string">'replace'</span>});
</code></pre><p>And here the final flow:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1647172009423/eFbeSuwwg.png" alt="jiraflow-RSS-flow.png" /></p>
<p>And now you ask, where is the message part for MS Teams. Here it is:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1647172067989/poxM9aZ_1.png" alt="jiraflow-DB-changes.png" /></p>
<p>It is relatively easy. I used the RethinkDB monitoring node for changes. Which gets a message for the changes. I put the messages payload into a function node, which creates the http request code for the MS teams webhook and sends out the http request to the MS teams universe, which promptly triggers the message in my local running MS Teams. How to add a webhook to MS teams, can easily googled, hence I did not described it here. Here is the code for the function node:</p>
<pre><code><span class="hljs-keyword">var</span> newMsg <span class="hljs-operator">=</span> {};
newMsg.headers <span class="hljs-operator">=</span> {
    <span class="hljs-string">"Content-Type"</span>: <span class="hljs-string">"application/json"</span>
};

<span class="hljs-comment">// deleted nodes have an empty new_val, hence I ignore it</span>
<span class="hljs-keyword">if</span> (<span class="hljs-built_in">msg</span>.payload.new_val) {
    newMsg.payload <span class="hljs-operator">=</span> {
        <span class="hljs-string">"@type"</span>: <span class="hljs-string">"MessageCard"</span>,
        <span class="hljs-string">"@context"</span>: <span class="hljs-string">"http://schema.org/extensions"</span>,
        <span class="hljs-string">"themeColor"</span>: <span class="hljs-string">"0072C6"</span>, <span class="hljs-comment">// light blue</span>
        <span class="hljs-string">"summary"</span>: <span class="hljs-string">"Summary description"</span>,
        <span class="hljs-string">"sections"</span>: [
            {
                <span class="hljs-string">"activityTitle"</span>: <span class="hljs-built_in">msg</span>.payload.new_val.key,
                <span class="hljs-string">"text"</span>: <span class="hljs-string">"Ticket "</span> <span class="hljs-operator">+</span> <span class="hljs-built_in">msg</span>.payload.new_val.key + <span class="hljs-string">" was updated! (https://xxx/jira/browse/"</span> <span class="hljs-operator">+</span> <span class="hljs-built_in">msg</span>.payload.new_val.key + <span class="hljs-string">")"</span>
            }
        ]
    };

    node.<span class="hljs-built_in">send</span>(newMsg);
}
<span class="hljs-keyword">return</span> null;
</code></pre><p>And here what MS teams spits out:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1647171160684/t6eTvyGX0.jpg" alt="watcher.jpg" /></p>
<p>For the grand finally, I thought, it would be good, to have a flow to update all tickets with the latest information, just in case there is a problem and I want to make sure I got all tickets covered. Hence I created this flow:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1647170571284/qpyIg8mle.png" alt="jiraflow-DB-updates.png" /></p>
<p>This flow is straight forward. Get all the cached items, request the Jira ticket information and update the RethinkDB. Here is the code for the fetch items function node:</p>
<pre><code><span class="hljs-comment">// get the cached items or an empty dictionary</span>
<span class="hljs-keyword">var</span> items <span class="hljs-operator">=</span> global.get(<span class="hljs-string">'items'</span>) <span class="hljs-operator">|</span><span class="hljs-operator">|</span> {};

<span class="hljs-comment">// loop over the cache items and request the jira ticket information</span>
Object.entries(items).forEach(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">[key, value]</span>) </span>{
    <span class="hljs-keyword">var</span> newMsg <span class="hljs-operator">=</span> {};
    newMsg.topic <span class="hljs-operator">=</span> <span class="hljs-string">'Fetch'</span>;
    newMsg.url <span class="hljs-operator">=</span> <span class="hljs-string">"https://xxx/jira/rest/api/2/issue/"</span> <span class="hljs-operator">+</span> key <span class="hljs-operator">+</span> <span class="hljs-string">"?expand=changelog"</span>
    newMsg.payload <span class="hljs-operator">=</span> {}
    node.<span class="hljs-built_in">send</span>(newMsg);
});
<span class="hljs-keyword">return</span> null;
</code></pre><p>Well I instantly ran into two problems. The Jira server hand a request limit of 10 requests per second, so since my loop was firing so fast, I had to add a delay node, so my account wasn't locked and in case of a locked message I cannot update the DB. So I added a switch node, that checks if the response from the http request is json or normal http, and in case of http, it routes to a debug node, otherwise it stores the json result, which is the Jira ticket information into the RethinkDB.</p>
<p>So all in all it was a very unspectacular development of these flows. Of course you have to go through a learning curve and learn what nodes do, what they can provide, what you have to do programmatically, but if you look at the complete flow plan, it is very small. All in all it was a great experience to develop in a new way and doing it in a System normally only used for home automation or visualization. And it shows how flexible Node-Red with the node.js base has become. I even think about it, trying to use it as test tool for some purposes. </p>
<p>Sure in the background each of the nodes has many more Javascript code, but I did not have to write it, I can simply use the nodes. And ja, you have to find the right nodes, but with the basic set of nodes you can do a lot of stuff. The only custom nodes I added was the RethinkDB nodes.</p>
<p>And at last here is the complete flow, how it runs on my Docker for Windows instance with Node-Red and a RethinkDB:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1647172329577/C_JGFflaM.png" alt="jiraflow.png" /></p>
<p>Ja, hard-core node.js or python programmers or automation specialist would say, I could do this much easier so and so, with even less code and system requirements. I know that. That's not the point I wanted to accomplish. I wanted to do a thing I haven't done before in a new system I've rarely used before. And that what I did and I had success - at least in my eyes - with it.</p>
<p>Ok, hope that was as helpful for you as it was fun for me. At least it spiced up some weeks in my otherwise not so interesting job. And I will continue to use this path, cause I want to add more flows to fill Grafana+Loki or ELK. And of course in the end i want to make my flows safe and error resistant and also try to use sub-flows for more structure. So plenty of fun to come.</p>
<p>As always apply this rule: "Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."</p>
<p>Have a good one. Alex </p>
]]></content:encoded></item><item><title><![CDATA[Love to fail (at work) or fail to love (your work)]]></title><description><![CDATA[Ok, I'll explain the title a little later. Let me start with a little bit of background, so you might understand me and the title better. Some of you might…]]></description><link>https://blog.arjs.net/love-to-fail-at-work-or-fail-to-love-your-work</link><guid isPermaLink="true">https://blog.arjs.net/love-to-fail-at-work-or-fail-to-love-your-work</guid><category><![CDATA[agile development]]></category><category><![CDATA[Scrum]]></category><dc:creator><![CDATA[Alex Schiessl]]></dc:creator><pubDate>Sun, 20 Feb 2022 10:49:29 GMT</pubDate><content:encoded><![CDATA[<p>Ok, I'll explain the title a little later. Let me start with a little bit of background, so you might understand me and the title better.</p>
<p>Some of you might have read my blog where I mentioned I deal with some sicknesses. One of those sicknesses is depression. I have this depression quit some time now. Mostly it comes in the dark month of the year and it is pushed by external influences, like e.g. bad experience at work. </p>
<p>Over the years of treatment and talking about it I learned some strategies to deal with this downward spiral. E.g. like go on walks on sunny winter days or use light therapy or talk about my thoughts and feelings in a support group. And especially have adopted a strategy from someone who suggested a treasure chest with success stories. In this treasure chest I put success stories I had in my life and where I felt happy and complete. With this stories I can counter the feelings of failure with a success story. Lately I had that feeling of failure at work a lot.</p>
<p>But one of my treasure story is actually not a story it is a bunch of videos on Youtube. There are some very good teaching videos on <a target="_blank" href="https://www.youtube.com/results?search_query=vera+birkenbihl+depression">YouTube</a> from the late <a target="_blank" href="https://www.birkenbihl.com/">Vera Birkenbihl</a>. Here is a little background on <a target="_blank" href="https://de.wikipedia.org/wiki/Vera_F._Birkenbihl">Mrs. Birkenbihl</a>. She was a Management Trainer and Behaviour Change Expert. </p>
<p>Whenever I have bad feelings these videos reminded me, on a core principle of our existence: 
<strong><em>"We have the power of our thoughts."</em></strong><br />With our thoughts we can control our feelings and control what we do about it. You are not powerless, you can change it.</p>
<p>So I took the time over the holidays and quite some time after that, and thought long and hard why I have these feelings of failure at work. And I found two reasons for those feelings and how I should deal with them ASAP. And ultimately revealed the sentence I choose to use as my blog title: 
<strong><em>"Love to fail (at work) or fail to love (your work)"</em></strong>.</p>
<p>Well, you might be curious and ask, so what went wrong at work. I don't want to leave you hanging and give you a glimpse into the backgrounds of my failure feelings. </p>
<p>Since a couple of month I'm responsible for three Agile Teams. These teams work at a large project at a major car manufacturer on different parts of the contract. And these teams work for different departments at this car manufacturer. So that means they have different responsible PO's. That means with that, there are  a lot of different rules, requirements and other difficulties for the teams.</p>
<p>Eg. one Team's PO actually likes agile SW development and Scrum a lot. He/she and the Team do a very good job applying Scrum guidelines. But since the Team setup is a little bit odd - Devs and Ops and Customer Support Agents mixed together as one Team and called DevOps -, this setup causes a lot of not so agile work patterns and changes to the "normal" Scrum process.</p>
<p>In case, for example, the CSAs are overwhelmed with customer tickets, the Devs and Ops guys have to drop everything and do CS tickets. We talk here about mostly simple tickets, like reset password or extend my account, aso.. And of course this kind of work for the Devs is not tracked in anyway on the Scrum Board via a special ticket with some default Story Points. This work the Devs do is simply hidden work they have to do but don't get credits for in the form of velocity. Velocity is only tracked for actual Dev work. The Devs have to do this kind of not "plannable" work, but it is expected to full fill the Sprint Commitment. This is mainly because the CS "part" of the Team is understaffed and sometimes cannot do all the work. So it falls back to the "Rest" of the Team to help out. In those cases, most of the time the sprint goal cannot be achieved. </p>
<p>Or another example. The Ops guy, ja there is only one - also understaffed for a 24/7 service -, has to do all the changes for production and test environments. No Dev is allowed to help out, cause he is the sole person who has the authority to communicate with the WebOps guys in India directly. You probably already guessed, every change has to go trough India to be put on production/test machines. So if this Ops guy is sick or had a long work night with a change. Every dev ticket, and he has regular dev tickets (Build Pipeline, Cloud Maintenance on the Dev environments, aso) in the sprint, too, are delayed as reason of that. And so the Sprint Goal is sometimes also not achieved.</p>
<p>Alright, so I tried for over a month now to rise awareness at our Management that this Team setup is bad and it will get even worse when we are held accountable to actually deliver the 24/7 CS. The Team structure and how work is organised needs IMHO to be change ASAP or at least analysed, so we can adjust it accordingly, so the Team can work better, with less interruptions and conflicting work.</p>
<p>But every talk I have, every e-mail I sent, there are only answers like that: "Yeah you're right, but we can't do that.", "There is no time to change it.", "There is no budget for more personell." or "The customer doesn't want that. The system as it is now, works for the customer." or the all in one killer argument "Never change a running system!"</p>
<p>These kind of answers are very frustrating for me. It is hard on me to know there is something wrong, but you do not have the power, the right connections or maybe the right charisma to change something in the system and that gives me the feeling of failure.</p>
<p>The second example is from the other Teams. They work for a different department. This department says they do Scrum and organise their work in Sprints, but in fact they do Waterfall with feedback in 4 weeks cycles, and of course with a lot of politics, delays on delivery of information and testing and of course a lot of spontaneous "We need this fixed immediately" sprinkled in.</p>
<p>So since I'm the Scrum Master for these teams, I never saw the Teams successfully complete a sprint because of that. Best result was 65% of the Sprint Goals. And I'm sure that it does not fall back on the performance of the teams. </p>
<p>The Customer PO does not know what agile SW development means and he/she does not want to be educated in that regard. E.g. for him/her a sprint in Jira is not planned work in a defined amount of time with a deployable deliverable. For him/her it is a work order for a period of time. And he/she can change the work order whenever he/she likes it or sees the necessity. Of couse he/she think they pay the bill so it can be done like that. No care if the team agrees to the change, no care what the velocity for the teams are, no care if all of the members of the teams are available, no care if starting and stoping work is hurting feature progress, no care if re-prioritisation causes ("politicly") promised features to get delayed. </p>
<p>And there are more things the PO is very reluctant to change. Switch to cloud based test environments or feature based tests and releases. No, it has to be a snow-flake environment for testing. Testing is only done before the quarterly releases. Yes, there are acceptance tests at the end of the sprint, so we get tickets closed and get paid, but that doesn't mean anything for a release, since most of the time this is done not done on a stable and defined environment. Means even if the feature is accepted, cause it works on the current test environment, it doesn't mean it work two month later for the Quality Gate Test before a release. Hence Devs have to work overtime before a release to fix those bugs, which where most of the time introduced after the acceptance of the feature or because something changed on the snow-flake environment, eg. DB changes they didn't know. And you guessed it, automatic testing is not a Prime citizen in this setup. So there are only a hand-full of Smoke tests. The rest of the tests are done by manual clicking stuff to do end to end tests. </p>
<p>Well I hope you can imagine, that I tried over an extended period of time to change many of those things or at least make them aware of the problems they cause, but in my position and working in a Customer / Service Provider setup, I was not very successful. Same problem/answers as before with the Scrum team. So this all is very frustrating for me and because of my helplessness a source of failure and for my bad feelings.</p>
<p>Anyway enough with the bad work experience, the main goal of my blog was to explain the title "Love to fail (at work) or fail to love (your work)" and why I think this is a good guideline. With the help and the reminder of the Vera Birkenbihl's videos, I found out, that it is noting bad if I fail at those projects. Actually it is a good thing that I fail and I have to love the fact, that I fail, cause that gives me the freedom to accept that I cannot change anything in the current setup. So I shouldn't invest to much time and energy into it, if the customer is happy and my employer is happy, why should I fight and be unhappy. And with this acceptance, I found more freedom to look for things I love to do, things I want to do, things I can control.</p>
<p>So for a long time I wanted to explore the Jira Rest API and what you can do with it. And since I'm a somewhat decent python programmer, I started developing a python program which extracts information from Jira Tickets and do analytics and reports on them. And what was the good thing about that is, I learned also the Confluence Rest API, to publish the Sprint and KPI reports for our teams. And that made me happy.</p>
<p>And since the Python program is almost done, only some fine tuning, refactoring and documentation needs to be done, to be  completely finished. Hence I started to look for more happy things to do. And I picked to explore the RSS feature of Jira. This time I want to use Node-Red and a no-sql database to publish changes in MS Teams with a webhook. I decided to do it with Node-Red, since I use Node-Red at home for my Weather Dashboard and it is spectacular what you can do with Node-Red. Ja, another happy little project at work. But details about these projects might be some future blogs.</p>
<p>Ja, so I hope you understand now a little bit the background and the meaning of the title. I learned to love to fail at work, so I could start to love other things I can do at work. And with this new feeling, my depression was not as bad as in the years before and I could manage without medication and emergency help. And that made me happy, too.</p>
<p>As always apply this rule: "Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."</p>
<p>Have a good one. Alex  </p>
]]></content:encoded></item><item><title><![CDATA[Kubernetes, Honeypot and I]]></title><description><![CDATA[It has been a while since my last post, but as most of you know, every Year's end there are two events that keep you busy and occupied. So was I. And in my…]]></description><link>https://blog.arjs.net/kubernetes-honeypot-and-i</link><guid isPermaLink="true">https://blog.arjs.net/kubernetes-honeypot-and-i</guid><category><![CDATA[Kubernetes]]></category><category><![CDATA[Raspberry Pi]]></category><category><![CDATA[youtube]]></category><dc:creator><![CDATA[Alex Schiessl]]></dc:creator><pubDate>Sun, 23 Jan 2022 13:32:32 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1642942263007/-rvxEfwDd.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>It has been a while since my last post, but as most of you know, every Year's end there are two events that keep you busy and occupied. So was I. And in my case I also had to fight my sicknesses. So the motivation to post something was very low on my side. But as the new year getting started I found my balance and routine again.
So I thought it's time to pick up and post a new blog entry.</p>
<p>Since my last post I was able to enhance my little PI k8s cluster to two Raspi's and I want to give a little update on that.</p>
<p>In a previous post I mentioned I <a target="_blank" href="https://blog.arjs.net/switching-to-raspberry-pi-zero-2-w-for-monitoring">freed up</a> a 4GB Raspi 4B+ and I wanted it to add it to my single node k8s cluster I was currently running. My old "mini" cluster was running 
k3os with <a target="_blank" href="https://github.com/k3s-io/k3s">k3s</a>. So naturally I tried to setup the new node as agent with k3os and k3s</p>
<p>Anyway here is what I tried to accomplish:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1642942263007/-rvxEfwDd.png" alt="Goal.png" /></p>
<p>So the Raspi Zero 2W with an attached 19'' Asus Monitor is my Monitoring solution. The Raspi Zero WH is my Weather gathering solution. In addition the two Zeros are building with "keepalived" a HA solution for my PiHole/DNS solution. My "mini" cluster based on the Raspi 4B+, runs currently Uptime Kuma to monitor all services and also Node-Red to generate the UI which is shown on the Asus Monitor from the Raspi Zero 2W. And my trusty old 2007 MacMini as my "ubuntu/docker" based host for services like, drone.io, gitea, portainer, registry and of course CouchDB. And last, but not least my good old Macbook Pro as main Work/Fun/Surf machine.</p>
<p>Ok, let's start. I did an install of Ubuntu on a SD card for the 4B+ 4GB, got it running and updated. Went through the takeover part on the k3s github.com page and failed. I tried that for two days and then I gave up. What I could do in December 2020, I was not able to reproduce in December 2021. Maybe it was because I used a newer version of Ubuntu 21.10 or I was not able to manipulate the "/boot/(firmware/)cmdline.txt" correctly. Anyhow after that frustration I gladly had the mandatory X-mas break and my mind was occupied with other and family stuff. </p>
<p>After the time out I decided to start over. And so I tore down my still running "mini" cluster with my Raspi 4B+ 8GB. First I tried to start the new k8s cluster with k3s on ubuntu. But I don't know why or what I did wrong or what I forgot to do, but I couldn't manage to boot ubuntu from an SSD on my Raspi 4B+ 8GB. It worked perfect with the 32GB SD card on the Raspi 4B+ 4GB, but not on the bigger with the SSD. There it worked fine with the SD card, but not with the SSD. And since I wanted the k8s master to boot from my 120GB SSD, that was another setback. </p>
<p>I invested again a couple of days to get it to work, but I failed, again. So I went to my Plan B. Plan B, I made up one evening before I fell asleep. My Plan B was using the experimental 64bit lite version of Raspberry OS Bullseye. And what can I say. It was as you would expect it. Flashed the SSD with the OS and it booted right away from the SSD, did the initial stuff and the master node was ready to become the k8s master. </p>
<p>I executed some commands on the Raspi "Master":</p>
<pre><code>sudo rpi-eeprom-<span class="hljs-keyword">update</span> -h # <span class="hljs-keyword">To</span> <span class="hljs-keyword">check</span> the <span class="hljs-keyword">info</span>
sudo rpi-eeprom-<span class="hljs-keyword">update</span> -a -d # <span class="hljs-keyword">To</span> actually <span class="hljs-keyword">update</span>
sudo raspi-config # <span class="hljs-keyword">To</span> <span class="hljs-keyword">check</span> the boot <span class="hljs-keyword">order</span> <span class="hljs-keyword">and</span> boot <span class="hljs-keyword">version</span>
sudo vi /boot/cmdline.txt # <span class="hljs-keyword">To</span> <span class="hljs-keyword">add</span>  cgroup_memory=<span class="hljs-number">1</span> cgroup_enable=memory
sudo apt <span class="hljs-keyword">update</span> &amp;&amp; sudo apt <span class="hljs-keyword">full</span>-upgrade -y
 sudo apt autoclean
sudo apt autoremove
sync; sync; sudo reboot
</code></pre><p>I repeated the same with my Rasp 4B+ 4GB and in no time the agent node was also ready to become a k8s agent.</p>
<p>Next step was installing k8s. Naturally I went to k3s, cause it was designed for small devices like the Raspi. So I did the steps described on the k3s github page. And what can I say, I failed, yet again. It worked kinda, but not perfect, the "kubeconfig" was always in RO mode and hence I had problems. I tried it several times, but no success.</p>
<p>Of course I consulted my good "shiny" friend google or better his "ugly" pendant Duckduckgo to find help. But what I found was either to old and outdated or it didn't fit for my problem. But sometimes you have luck. So did I. At one point I came across an open source project <a target="_blank" href="https://github.com/alexellis/k3sup">"k3sup"</a> - Shoutout to alexellis - and with this tool and the description it goes along with it, I was able to setup k3s successfully on both Raspi's 4B+. And the best part I could do it from my MacBook Pro. With two command lines my little mini cluster with two nodes was set up.</p>
<pre><code>k3sup<span class="hljs-operator">-</span>darwin install <span class="hljs-operator">-</span><span class="hljs-operator">-</span>ip <span class="hljs-number">192.168</span>.x.y <span class="hljs-operator">-</span><span class="hljs-operator">-</span>k3s<span class="hljs-operator">-</span>extra<span class="hljs-operator">-</span>args <span class="hljs-string">'--write-kubeconfig-mode=644'</span> <span class="hljs-operator">-</span><span class="hljs-operator">-</span>user pi
k3sup<span class="hljs-operator">-</span>darwin join <span class="hljs-operator">-</span><span class="hljs-operator">-</span>ip <span class="hljs-number">192.168</span>.x.z <span class="hljs-operator">-</span><span class="hljs-operator">-</span>server<span class="hljs-operator">-</span>ip <span class="hljs-number">192.168</span>.x.y <span class="hljs-operator">-</span><span class="hljs-operator">-</span>user pi
</code></pre><p>One day later I deployed "Uptime Kuma" and "Node-Red" on my new k8s cluster and after 4 weeks of trial, error and success I was at the point I started out Mid-December, with the difference, I have now, two Raspi's in my cluster, both running Raspberry OS Bullseye 64bit lite with k3s. And that means I have finally space and resources to try more k8s stuff. For example I want to try out the <a target="_blank" href="https://camunda.com/">Camunda Workflow Engine</a> or finally migrate my docker based services from my old 2007 mac mini with 4GB to the k8s cluster, so it can go to retirement, eventually. And with the 120GB SSD on my "master" node I might also be able to try some NFS and file sharing things. I really want to try out if Samba Sharing is possible in k8s.</p>
<p>So till now, you wonder where is the Honeypot part. That's my fiends is a lucky coincident for you and for me. Ok, when I started to write this post, I searched on Youtube for some of the videos I watched in December to prepare for my k8s cluster setup, which I could include in my blog post, but as usual the Youtube algorithm gets you, and you stumble upon a video that distracts you from your original goal. Well, all I can say, the Youtube algorithm works and I got distracted. </p>
<p>The video that distracted me was this <a target="_blank" href="https://www.youtube.com/watch?v=BE77h7dmoQU">video</a>: kubernetes part 1 by <a target="_blank" href="https://www.youtube.com/channel/UCsUalyRg43M8D60mtHe6YcA">Honeypot</a></p>
<p>Surprisingly it was a Honeypot for me, cause it is one thing to use a tool/technology like k8s, but it is something else if you know some of the history that is behind it. Since my love/hate relationship with k8s is still present, it was a nice break and for me also educational. I hope you enjoy the little k8s history from Honeypot, too.</p>
<p>As always apply this rule: "Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."</p>
<p>Have a good one. Alex </p>
]]></content:encoded></item><item><title><![CDATA[Switching to Raspberry Pi Zero 2 W for monitoring...]]></title><description><![CDATA[... or better to show the monitoring website on my monitoring monitor. So recently I saw some review videos of the new Raspberry Pi Zero 2 W SoC. All were…]]></description><link>https://blog.arjs.net/switching-to-raspberry-pi-zero-2-w-for-monitoring</link><guid isPermaLink="true">https://blog.arjs.net/switching-to-raspberry-pi-zero-2-w-for-monitoring</guid><category><![CDATA[Raspberry Pi]]></category><category><![CDATA[Kubernetes]]></category><category><![CDATA[monitoring]]></category><dc:creator><![CDATA[Alex Schiessl]]></dc:creator><pubDate>Sun, 28 Nov 2021 18:30:45 GMT</pubDate><content:encoded><![CDATA[<p>... or better to show the monitoring website on my monitoring monitor.</p>
<p>So recently I saw some review videos of the new Raspberry Pi Zero 2 W SoC. All were more or less ecstatic about the performance over the old version. So I decided I want one, too. My intension was to replace my current Raspi who drives my monitoring monitor.</p>
<p>But let's make a short intermezzo, to explain the situation. I'm using a Raspberry Pi Zero WH as my choice of HW to gather my weather data from my padio. And since it was so underperforming when I first installed it in Desktop mode, I quickly changed it to RaspiOS lite version to avoid the Desktop overhead. And to be honest, since this Raspi only gathers weather data and pushes it to a CouchDB, it does not need a Desktop. All configuration can be done with a ssh shell.</p>
<p>Anyway, so this Raspi was running well and I gathered a ton of data. So I quickly built a Node-Red dashboard to visualise the data. Originally I only checked it on my everyday Mac Mini 2014 when I had the urge to check the temperature or the pressure. But for home office reasons I upgraded my monitors on my mac mini to a double monitor setup, hence my old monitor was free for other use.</p>
<p>Well, I had a spare Raspberry Pi 4B 4GB Ram, so I hooked it up with this "old" monitor, configured Chromium with "Tab Rotate" and my uptime kuma and the node-red dashboard websites, added two cron jobs to tun the monitor off and on at evening and morning, and voila I had a monitoring monitor.</p>
<p>I had this setup running for some month now. But since I want to do more stuff with k8s and I only have one Raspi 4B 8GB running as master, I want at least one agent to have a little more options. So when I scored a Raspberry Pi Zero 2 W, I was happy I could finally free the 4B from monitoring duty and add it as an agent to my Raspi k8s cluster. Sure, it would be nice to add 3 Raspi 4B 8GB as agents to my cluster, but currently, especially in X-mas holiday season and the chip shortage, you cannot find those boards or if you find them only way overpriced. </p>
<p>Ok, so as soon as all the stuff arrived to bring this Raspi Zero 2 W alive, I installed RaspiOS Buster Desktop. Moved all the Data from my 4B 4GB Raspi to the Zero 2 and in about 2h everything was running. And my monitoring monitor was driven by the Zero 2. The only downside I found so far is that somehow the Zero 2 is still a little to slow to render the Uptime Kuma website fast enough, so once in a while a white flash happens, when the Uptime Kuma is reloaded and the original empty white website is shown for a fraction of a second. This never happened with the 4B, cause this SoC was fast enough rendering the website. But for now I'm fine with it, since I'm happy enough to get the Zero 2 running and I have my 4B back to add it as agent to my k8s cluster.</p>
<p>So the next project will be adding this Raspi to the k8s cluster. And if this is successful, I want to try to move all my docker stuff to the k8s cluster and retire my Mac Mini 2007, which currently runs Ubuntu 20.04 with docker and all my services. And even this Mac Mini runs just perfect and I never had problems with the docker setup, I think it is time that I remove this "oversized" Mac Mini with something smaller and newer.</p>
<p>As always apply this rule: "Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."</p>
<p>Have a good one. Alex</p>
]]></content:encoded></item><item><title><![CDATA[Looking on k8s through a Lens…]]></title><description><![CDATA[... or better with a tool call Lens which can be found on k8slens.dev. Ok, so here is another chapter in my k8s adventures. This time it is somewhat…]]></description><link>https://blog.arjs.net/looking-on-k8s-through-a-lens</link><guid isPermaLink="true">https://blog.arjs.net/looking-on-k8s-through-a-lens</guid><category><![CDATA[Kubernetes]]></category><category><![CDATA[monitoring]]></category><category><![CDATA[Developer Tools]]></category><dc:creator><![CDATA[Alex Schiessl]]></dc:creator><pubDate>Sun, 14 Nov 2021 14:29:48 GMT</pubDate><content:encoded><![CDATA[<p>... or better with a tool call Lens which can be found on <a target="_blank" href="https://k8slens.dev/">k8slens.dev</a>.</p>
<p>Ok, so here is another chapter in my k8s adventures. This time it is somewhat positive. Let’s start from the beginning. Recently I watched a video  <a target="_blank" href="https://www.youtube.com/watch?v=evWPib0iNgY">"How To Replace Docker With nerdctl And Rancher Desktop"</a> from the DevOps Toolkit Youtube channel. In that video there was a compelling argument to switch from Docker for Mac/Windows to Rancher Desktop. Three arguments sold me the switch.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1636897851043/BuuUYJdFf.png" alt="image.png" /></p>
<p>First there is a simple installation tool. Simply download the install tool from <a target="_blank" href="https://rancherdesktop.io/">rancherdesktop.io</a>. It is available for Windows, Mac and Linux. Look at the  <a target="_blank" href="https://github.com/rancher-sandbox/rancher-desktop">Rancher Sandbox Github page</a> for details on the requirements. After the download, start the install process. Everything else is done in the background, and you have a somewhat normal dev environment. And after a while Rancher Desktop is running and most likely without hassle.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1636897908806/_T392VVT6.png" alt="image.png" /></p>
<p>Second there are some nice cli tools installed by default. Ok first of all <em>kubectl</em> and then <a target="_blank" href="https://github.com/containerd/nerdctl"><em>nerdctl</em></a>, which in most parts is comparable to the docker and docker-compose cli commands. Except for some small exceptions, e.g. prune is not available, yet.</p>
<p>And at last there is k8s or better  <a target="_blank" href="https://k3s.io/">k3s</a>  from Rancher running beneath the hood. Ok it is not the full fledged k8s stack, but k3s is for the most parts all you need.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1636897991105/otfIXSvkl.png" alt="image.png" /></p>
<p>So I was very pleased about the hassle free experience and having a future proof k8s stack as a replacement for a  <a target="_blank" href="https://www.techradar.com/news/businesses-can-no-longer-access-docker-desktop-for-free">product</a> which will rather sooner than later is no good alternative for development with container on developer machines anymore.</p>
<p>Now what, I have a k8s stack running on my mac desktop, but as you might read on a previous blog post, I do not want to mess around with k8s config files so much. So I looked around for an easy way to deal with k8s configs, on google of course, and I found <a target="_blank" href="https://k8slens.dev/">k8slens.dev</a> with their tool Lens. A tool for managing k8s clusters. It is an electron based app, like VS Code. It was very easy to connect to Rancher Desktop and see all the guts of this k3s cluster. Even installing some helm charts was easy.  </p>
<p>And of course Lens is not limited to the desktop, I could easily connect to my k3s cluster on my Raspberry Pi, too. So I’m even more pleased, that my love hate relationship for k8s might have swung to love again.</p>
<p>Of course with all that positive experiences, I had to try something new. Also recently I saw a <a target="_blank" href="https://www.youtube.com/watch?v=r_A5NKkAqZM">video</a> from the Techno Tim Youtube Channel, about <a target="_blank" href="https://github.com/louislam/uptime-kuma">Uptime Kuma</a>, an open-source alternative for the commercial Uptime service.</p>
<p>First I wanted to try the install method, described on the Github page, but then I thought why not look for a Helm chart. And guess what I found <a target="_blank" href="https://github.com/dirsigler/uptime-kuma-helm">one</a>. But then the first drawback, I was not able to use this Github based helm chart. Ok no problem, of to the command line I went. Added the repo, did the repo update and did the helm install. Everything worked fine, but, isn’t there always a but. But the installed Uptime Kuma was only available with an external URL "chart-example.local". And of course I could add it to the hosts file, but nah, that’s lame.</p>
<p>So I googled around and found the "<em>helm show</em>" way to get the variables. And I learned how to overwrite the values. I configured an uptime.x.y in my Pi-Hole DNS, configured the helm values file to my likings. Used "<em>helm install</em>" and in no time Uptime Kuma was running, but of course in ClusterIP mode. Ok, rollback. Changed to "<em>type: LoadBalancer</em>", but I don’t know why, I only could access it through the port 3001. So I fiddled around for at lease two hours, trying and turning comments on and off until, ja, until I found a solution. Here it is, I couldn’t figure out exactly why I have to do it this way, but it worked and that was good enough for me. And I didn’t cared much, since it was working as I wanted it. </p>
<pre><code><span class="hljs-attr">service:</span>
  <span class="hljs-attr">type:</span> <span class="hljs-string">LoadBalancer</span>
  <span class="hljs-attr">ports:</span>
    <span class="hljs-attr">http:</span>
      <span class="hljs-attr">port:</span> <span class="hljs-number">80</span>
      <span class="hljs-attr">targetPort:</span> <span class="hljs-number">3001</span>


<span class="hljs-attr">ingress:</span>
  <span class="hljs-attr">name:</span> <span class="hljs-string">traefik-ingress-uptime</span>
  <span class="hljs-attr">enabled:</span> <span class="hljs-literal">true</span>
  <span class="hljs-attr">namespace:</span> <span class="hljs-string">default</span>
  <span class="hljs-attr">annotations:</span>
    <span class="hljs-attr">kubernetes.io/ingress.class:</span> <span class="hljs-string">traefik</span>
    <span class="hljs-attr">traefik.frontend.passHostHeader:</span> <span class="hljs-string">"false"</span>
    <span class="hljs-attr">traefik.frontend.priority:</span> <span class="hljs-string">"1"</span>

<span class="hljs-comment">#     kubernetes.io/ingress.class: nginx</span>
<span class="hljs-comment">#     kubernetes.io/tls-acme: "true"</span>
<span class="hljs-comment">#     nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"</span>
<span class="hljs-comment">#     nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"</span>
<span class="hljs-comment">#     nginx.ingress.kubernetes.io/server-snippets: |</span>
<span class="hljs-comment">#       location / {</span>
<span class="hljs-comment">#         proxy_set_header Upgrade $http_upgrade;</span>
<span class="hljs-comment">#         proxy_http_version 1.1;</span>
<span class="hljs-comment">#         proxy_set_header X-Forwarded-Host $http_host;</span>
<span class="hljs-comment">#         proxy_set_header X-Forwarded-Proto $scheme;</span>
<span class="hljs-comment">#         proxy_set_header X-Forwarded-For $remote_addr;</span>
<span class="hljs-comment">#         proxy_set_header Host $host;</span>
<span class="hljs-comment">#         proxy_set_header Connection "upgrade";</span>
<span class="hljs-comment">#         proxy_set_header X-Real-IP $remote_addr;</span>
<span class="hljs-comment">#         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;</span>
<span class="hljs-comment">#         proxy_set_header   Upgrade $http_upgrade;</span>
<span class="hljs-comment">#         proxy_cache_bypass $http_upgrade;</span>
<span class="hljs-comment">#         }</span>
  <span class="hljs-attr">hosts:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">host:</span> <span class="hljs-string">uptime.x.y</span>
    <span class="hljs-attr">paths:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">path:</span> <span class="hljs-string">/</span>
      <span class="hljs-attr">backend:</span>
        <span class="hljs-attr">serviceName:</span> <span class="hljs-string">uptime-kuma</span>
        <span class="hljs-attr">servicePort:</span> <span class="hljs-number">3001</span>
<span class="hljs-comment">#   tls:</span>
<span class="hljs-comment">#     - secretName: uptime-x-y-tls</span>
<span class="hljs-comment">#       hosts:</span>
<span class="hljs-comment">#         - uptime.x.y</span>
</code></pre><p>And a special ingress config:</p>
<pre><code><span class="hljs-attribute">piVersion</span>: extensions/v1beta1
<span class="hljs-attribute">kind</span>: Ingress
<span class="hljs-attribute">metadata</span>:
  <span class="hljs-attribute">name</span>: traefik-ingress-uptime
  <span class="hljs-attribute">namespace</span>: default
  <span class="hljs-attribute">annotations</span>:
    kubernetes.io/ingress.<span class="hljs-attribute">class</span>: traefik
    traefik.frontend.<span class="hljs-attribute">passHostHeader</span>: <span class="hljs-string">"false"</span>
    traefik.frontend.<span class="hljs-attribute">priority</span>: <span class="hljs-string">"1"</span>
<span class="hljs-attribute">spec</span>:
  <span class="hljs-attribute">rules</span>:
  - <span class="hljs-attribute">host</span>: uptime.x.y
    <span class="hljs-attribute">http</span>:
      <span class="hljs-attribute">paths</span>:
      - <span class="hljs-attribute">path</span>: /
        <span class="hljs-attribute">backend</span>:
          <span class="hljs-attribute">serviceName</span>: uptime-kuma
          <span class="hljs-attribute">servicePort</span>: <span class="hljs-number">3001</span>
</code></pre><p>Oh, one little funny side note, of course in my config ordeals I misspelled “kuma” at some point with “karma”, and of course it messes everything up, and since the two words almost looks the same, it is not easy to spot. :-) </p>
<p>Now you have read through my post, you would say, your ordeal has to do with my somewhat hate for how k8s is configured, but you know, of course it is nice to get your V8 of your Mustang or Charger running again and enjoy a Sunday drive out. But sometimes you simply want to hop in your F150 push the start button and ride to your destination. And exactly that’s it what I want most of the time from k8s. Install an app or service make some minor adjustments and be done with it and I can use the app and /or service.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1636899676508/wuMu0oJrbU.png" alt="image.png" /></p>
<p>Well, anyway. At the end I got Uptime Kuma running and I put it on my monitoring pi and other services. After installing a rotating Tab chromium extensions, I now have Weather and Uptime Kuma on rotation and enjoy my home grown monitoring. And I will extend it in the future, as soon as I get my hand on three more Raspberry PI 4B+. I will extend my k8s cluster with some agents and move all my docker based services to the new k8s cluster.</p>
<p>As always apply this rule: "Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."</p>
<p>Have a good one. Alex</p>
]]></content:encoded></item><item><title><![CDATA[Perseverance, Analytics, Search expressions and a little luck.]]></title><description><![CDATA[Pair perseverance, some good analytic skills, the ability to build the right search expressions and a little luck and you most likely get a success story…]]></description><link>https://blog.arjs.net/perseverance-analytics-search-expressions-and-a-little-luck</link><guid isPermaLink="true">https://blog.arjs.net/perseverance-analytics-search-expressions-and-a-little-luck</guid><category><![CDATA[macOS]]></category><category><![CDATA[macbook]]></category><category><![CDATA[problem solving skills]]></category><dc:creator><![CDATA[Alex Schiessl]]></dc:creator><pubDate>Mon, 01 Nov 2021 12:07:15 GMT</pubDate><content:encoded><![CDATA[<p>Pair perseverance, some good analytic skills, the ability to build the right search expressions and a little luck and you most likely get a success story.</p>
<p>So as many of you already know, <a target="_blank" href="https://www.youtube.com/watch?v=exM1uajp--A">Apple</a> put some speedy new hardware out on the marketplace, coming with it a new version of their OS, called macOS Monterey. </p>
<p>After watching the <a target="_blank" href="https://www.youtube.com/watch?v=exM1uajp--A">Apple Live event</a> on Youtube I went to view the aftermath of <a target="_blank" href="https://www.youtube.com/watch?v=44ewVR_mv-8">Luke Miani stream</a>  and saw him spent thousands and thousands of $ for the new Apple hardware. Of course he is a Youtuber who make his living around videos about Apple hardware, but you also could see, the somewhat critical, Apple fanboy and the little child that wants what it wants and it wants it now.</p>
<p>As a grown up, I'm hopefully no longer in the phase "I've to have it, cause it is new and shinny. And very speedy, too.".</p>
<p>I did the thing a grown up should do, at least what I think they should do, assess the situation, gather information, think about the options and alternatives and eventually after weighing facts, arguments and reasons come to a decision.</p>
<p>Ok my decision was, that the new MacBook Pro's are not for me, at least for now. Yes they have many good new things I like and want. Like speed, more memory, a larger screen, Magsafe cable again, more extension ports and most important they got rid of the awful touchpad, I could not stand. </p>
<p>In the beginning I was ready to shelve out the big bugs (keep in mind in Germany you have to pay a 19% luxury tax and some extra money for a Media device) for a somewhat pimped 14" MacBook Pro. But then the cruel awakening came, when they showed the stupid notch in the screen. Yes it was a technical reason, why they did it, but where is the "Function follows Design" approach? I accept a notch in a smartphone, cause of the space and you still want some goodies on the screen side. But for a Notebook this is a no go, at least for me. And of course the notch became a somewhat issue prone "feature", soon, too. </p>
<p>I use my menubar to display a lot of extra information, and of course you could hide some information in the Control Centre, but I don't want to do the extra click. All I want to do ist lift my eyes a little bit and see the information. And hence, I don't like loosing screen real estate in my menubar. That means for me the Notch is a "No buy argument". And I hope Apple is listening and get rid of it sooner than later, at least make it a configurable option. </p>
<p>Anyhow that meant, I do not have to rob my bank account to buy me a new gadget from Apple. But that also means I'm stuck with my Apple MacBook Pro late 2013, running the last supported OS macOS Big Sur. Not getting new hardware meant, I at least want the new OS macOS Monterey. But after investigating I learned that my MacBook Pro was no longer supported for that OS. And as most of you know, that's sooner or later the end of macOS on my machine. </p>
<p>Cause if Apple decides to stop making security fixes for that OS, you should not use it any longer. So I accepted the fact, that I have to switch to Linux sooner or later on my MacBook Pro. At least I can use one feature Apple is still the best, sustainability. Which other computer hardware producer, produces hardware that is still usable after 5+ years. And my MacBook Pro is no exception. It is in good shape, display is still fine, keyboard is in order, battery still has a good state and the CPU is still decent enough to run and do my tasks. I admit I use my MacBook Pro mainly for programming, writing, conceptional work, surfing and once in a while it goes with me on a trip. </p>
<p>Shortly, after settling with my decision to keep Big Sur and switch to Linux in an appropriate timespan, I stumbled over a <a target="_blank" href="https://www.youtube.com/watch?v=go6RTCHv4GA">Youtube video from Mr. Macintosh</a>, in which he described how to get macOS Monterey on unsupported Mac's. And it was a great inspiring video. So since we have a public holiday in my state in Germany on 1.11.2021, I started the process to throw macOS Monterey on my "unsupported" MacBook Pro.</p>
<p>But as usual, Youtubers makes it sound easy and it looks always so polished with them. Of course I ran into problems. </p>
<p>First I wanted to do an image from my MacBook Pro SSD, but for some reason my external SSD was 1 GB to small for it. So I did a new TimeMachine backup, which took forever. After that and the download of macOS Monterey was finished I created the bootable USB as described in this article. Then I continued with the steps which involves the OpenCore Legacy Patcher. And what did you know I was at the point to install macOS Monterey. </p>
<p>So of course I wanted just the update install. But as soon as I pressed the "continue" button my MacBook Pro froze and nothing happened. I rebooted a couple more times to see if it was a hick up or a consistent pattern. And it was a pattern. I then, deleted the internal SSD to see if this is the problem that prevents the install process. And since I had made a TimeMachine backup after all it shouldn't be a problem and I don't loose any data. But no success, yet.</p>
<p>So naturally after all that rebooting and deleting of the SSD, I thought that I did something wrong with the steps to create the bootable USB stick. So I started over. But this time during the "createinstallmedia" command, I got an error. Ok once again, erase and do it, again. But the Disk Utility said the USB stick is no longer erasable. I was puzzled, what is the problem!? But as it seems the 16 GB USB stick was bad and I was lucky to get one try out of it. Neither under Linux or Windows I was able to revive that USB stick again. So the broken macOS install was because of a broken USB stick. Luckily I had an old Windows 7 16 GB stick laying around and even it was not used for many years, it still worked. </p>
<p>Start over time. After spending already hours and hours preparing, rebooting, analysing, searching, reading, watching Youtube videos, I started from the beginning with a new 16 GB USB stick. And after a hour or so, I was at the same point I was hours before. But this time pressing the "continue" button lead to success, after another 3+ hours I was booting into macOS Monterey, eventually. </p>
<p>Wow, that was hard, nothing compared to previous macOS updates. Never have I spent so many hours for an OS upgrade. But it was a success. Of course there was a moment of horror, when I tried a reboot (without USB stick present) and I got an error message (blinking folder with a question mark and a link below) from apple on the screen. So naturally I thought "F*ck, your Mac is bricked!", but after watching the Mr. Macintosh video again on my iPad, I knew I forgot one after-install step. It was the copy of the OpenCore to the internal SSD EFI partition. After that was done, reboot was no issue any more.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1635767945418/G0_x1xhcp.png" alt="Bildschirmfoto 2021-11-01 um 11.49.01.png" /></p>
<p>So as I wrote in the title, perseverance, analysing the problems and informations, build good search expressions for the search engines that deliver the informations and tools you need, and of course some lucky accidents helped me have success and having macOS Monterey on my MacBook Pro late 2013. Ok I have now a somewhat hacked piece of hardware, but I kept one otherwise deemed "retired" Apple hardware alive.</p>
<p>And it also showed that without all these knowledgeable, nerdy geeks and Youtubers no success would have been possible so my special thanks go to <a target="_blank" href="https://www.youtube.com/c/MrMacintoshBlog">Mr. Macintosh</a> , dortania and all the people behind the <a target="_blank" href="https://dortania.github.io/OpenCore-Legacy-Patcher/START.html">OpenCore Legacy Patcher &amp; Website</a> and <a target="_blank" href="https://technclub.com/guides/create-macos-monterey-usb-installer/">Dinesh from TechNClub</a> , for making my success even possible.</p>
<p>As always apply this rule: "Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."</p>
<p>Have a good one. Alex</p>
]]></content:encoded></item><item><title><![CDATA[2004 and my Bail Bond Web Scraper]]></title><description><![CDATA[A few days ago Youtube suggested a video to me how to make a "Build a Web Scraper (super simple!)". This reminded me, that I have to write one more story…]]></description><link>https://blog.arjs.net/2004-and-my-bail-bond-web-scraper</link><guid isPermaLink="true">https://blog.arjs.net/2004-and-my-bail-bond-web-scraper</guid><category><![CDATA[web scraping]]></category><category><![CDATA[Java]]></category><category><![CDATA[MySQL]]></category><dc:creator><![CDATA[Alex Schiessl]]></dc:creator><pubDate>Sun, 10 Oct 2021 18:04:28 GMT</pubDate><content:encoded><![CDATA[<p>A few days ago Youtube suggested a <a target="_blank" href="https://www.youtube.com/watch?v=-3lqUHeZs_0">video</a> to me how to make a "Build a <a target="_blank" href="https://en.wikipedia.org/wiki/Web_scraping">Web Scraper</a>  (super simple!)". This reminded me, that I have to write one more story from my past, where I think I was a pioneer.</p>
<p>But let's put it into context. So the huge Online Service Provider I was working in 2002, decided to shut down our office in Munich, and set me free with a 6 month separation period. So I decided to make a 3 month visit to my sister in the United States of America, she was an US citizen since many years now and living in the south of the US. </p>
<p>During my time there I met many interesting peoples, including my later employer in the US. He owned a Bail Bonding Business and had a need for a reliable IT guy, since his IT guy died in a car accident a few month earlier. He had hired some IT guys since then, but they never worked out. </p>
<p>Since I passed an opportunity to study and work in Boston, MA when I still was a student of the Computer Science in Regensburg, Germany in 1988. So here was the chance to full fill my dream to life and work in US, so naturally I accepted his offer. And so in mid 2003 I was living in the south of the US and working in IT at a Bail Bonding Company.</p>
<p>At this Bail Bonding Company I was the jack of all "IT" trades. Did everything which was computer related. Trained the agents, made backups, made sure the internet was working, we had backup power supplies, the bail bond management system was working, bought new computers and replaced outdated one, replaced printer cartridges and the list of responsibilities goes on. It included even taking pictures and doing paperwork from released inmates. But after a 4-5 month period I had a grip on things, organized and optimized and brought everything up to shape and standards, introduced maintenance and to do schedules, so the job started to get boring. </p>
<p>But luckily for me the county jail started to publish the inmates on their web page. Before that, the agent had to call the jail for a fax or even drive there to get a copy of the new inmates. So naturally after I learned about the new web page, I told my boss, and he agreed with me and saw also the potential for our company. So I got the go and could start the task to train the agents to use the county jail webpage and the online inmates list. </p>
<p>But that was harder than I thought. First of all we had guys who had no or only little PC experience, they knew how to start the bail bond management program, enter data, make photos and do printing. But using a Webbrowser was for most of them new. You have to keep in mind our agents, where Ex-Cops, Ex-Military, Ex-Martian-Art Coaches and that sort, so training them in computer stuff was hard. And even writing a step-by-step training manual was not so successful.</p>
<p>Hence I decided to write a program. Luckily the former IT guy of the Bail Bond Company had bought a VB6 license, so I could start writing a VB program which embedded the Microsoft Web component and I could simplify all the Webbrowser stuff, so the agents could be trained much easier. I even added a button to the Bail Bond Management System, so they could start it from there not only from the Desktop.</p>
<p>The first version of my program was a success and it speeded up the process identify arrested clients of us. But soon I found a flaw. Since we now longer had a fax or a hardcopy of the inmate list, we had to print out the information. And printing of the web information was hard and complicated for our agents. So the agents wouldn't print information very often and therefor information got lost. Cause when an inmate was released, the information was no longer available on the webpage. As reaction to that I started to save the information in the background, and it could be retrieved later, if needed. But the retrieval was still a manual process and could only done by me. Also the problem was that the information was only available on the PC the agent was using. Since we had around 10 PC in use, it sometimes was a guessing game where to find the information to retrieve.</p>
<p>So I decided to improve the system. I began researching how to extract data from a webpage. Back then in 2004 Web scraping was not unknown, but you could not find many information about it. At least I couldn't find it. And Youtube was also not a thing, yet ;-) But after some research I found a java component which could parse html code and extract information from it. That was the start point for the Jail Data Collector. This was basically a java program which accessed the jail webpage inmate list, accessed the individual inmate information, downloaded all referenced inmate pictures and stored them into a folder on our server.</p>
<p>Since the inmate jail list and the detail pages, were simple generated html documents, it was easy to extract information and store it. After I did that, I adapted the VB6 Jail Inmate Browser, removed the Web component and replaced it with an image viewer for the pictures and a text box for the text files with the inmate information. And most importantly a working print feature. So it didn't matter anymore if the information was still present on the county jail webpage, we had it stored locally on our server.</p>
<p>After a while the server got cluttered with inmate information text files and pictures. So I started the transformation to a DB based system. I created a MySQL DB replication cluster on linux. We had two locations, which needed to be independent, because of power- and/or internet outages, but where regularly synchronized. First I rewrote the storage module of my Jail Data Collector from file to DB. After that worked flawless, I migrated all the old inmate text files to the new DB. Then the Jail Inmate Browser was adapted to use the information from the DB. The pictures where still coming from the central folder from the server. One at each location. Synchronized by the Jail Data Collector.</p>
<p>The synchronization was a simple mechanism, driven by existents, date and time only. So we lost some pictures sometimes, when the download of a picture was interrupted and the image was broken. So I added a md5 and sanity-check later. But it worked on the most part perfectly.</p>
<p>It took me till spring 2005 until every component of the Jail Information System was done and the system was finished, used by our company and most importantly by our agents. We saved a lot of our bond money, cause we didn't have to pay the bail to the court. And it brought us a speed benefit, cause if a former client was arrested again, we knew it before our competitors, so we could make the business with his family much earlier and also could collect outstanding payments as well. Cause Bail Bond hopping was a thing back then.</p>
<p>Ok, so the system was done and I could switch to maintenance mode, again, until I left late 2006 and went back to Germany. The Jail Information System ran as I learned later till 2015. Of course there were some adjustments necessary, in the 3 years after I left I did it later IT consultants and programmers did their work with it. Things what needed adjustments where e.g. a work around after introduction of a basic authentication and later a personalized login. Occasionally an OS update, like Windows Server or the Fedora Linux Updates came along, some HW faults with HD's happened and once in a while a PC broke down and needed replacement. I did the maintenance till 2009 remotely from Germany. After that it was done by IT consultants with the occsional support from me. A $500US check I once in a while gladly accepted.</p>
<p>Eventually the Jail Information System stopped working in 2015, because the County Jail switched to a new authentication (captcha) system and they stopped publishing the inmate pictures, too. So it ment rewriting the whole parser and data extraction module. Since I didn't wanted to do it, cause I hadn't programmed java since 2007 and all IT consultants wanted too much money, at least that is what the Bail Bonding Company owner said. So it was not updated and was shut down. Even I designed it modular, so it could be easily done by an experience java programmer. Simply write a new html retrieval and data extraction component, store the data to the existing DB, and voila, it would have worked again. Ok, one thing would have become a little challenge: Overcome the re-captcha protection. But an experienced java programmer should have found a way to overcome that.</p>
<p>Anyway, that was my last story, where I think I was a pioneer doing stuff not many people where doing at that point in time. At least I like to think so. But as usual I leave it up to you, if you think I was a pioneer in 2004 doing a web scraper to extract data into a database and hence giving a company a business advantage.</p>
<p>After that I have the feeling I was never really able to do new stuff anymore. It was already done, you could buy, or there was an open source software available. But never the less I still think it was an interesting work life in IT.</p>
<p>As always apply this rule: "Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."</p>
<p>Have a good one. Alex  </p>
]]></content:encoded></item><item><title><![CDATA[My love hate relationship with k8s continues]]></title><description><![CDATA[Yup, another chapter in my love hate relationship is topic of this blog post. So, a few days ago, exactly on the morning of my birthday, I wanted to check…]]></description><link>https://blog.arjs.net/my-love-hate-relationship-with-k8s-continues</link><guid isPermaLink="true">https://blog.arjs.net/my-love-hate-relationship-with-k8s-continues</guid><category><![CDATA[Kubernetes]]></category><category><![CDATA[k8s]]></category><category><![CDATA[problem solving skills]]></category><dc:creator><![CDATA[Alex Schiessl]]></dc:creator><pubDate>Sat, 25 Sep 2021 19:13:29 GMT</pubDate><content:encoded><![CDATA[<p>Yup, another chapter in my love hate relationship is topic of this blog post.</p>
<p>So, a few days ago, exactly on the morning of my birthday, I wanted to check the temperature at my node-red driven Weather panel. But, "page cannot be found"! So, naturally I thought "WTF, come on it is my birthday"! Never the less I made coffee and checked what's going on. </p>
<p>Soon I found out, k3s on k3os - yes, I run k3s on k3os, which itself is an takeover installation of ubuntu, which is the only way I got k3os on my Raspi 4B+, cause I couldn't get k3os to boot on the Raspi. Anyway back to topic. </p>
<p>Ok, so naturally I tried to use portainer, since it is my lightweight choice for k8s management. It was not working, so I ssh'ed into my k3os-server and did the natural thing "kubectl get pods -A". So k3s was running, but most of the pods which I needed, node-red, portainer, elk where not running, they where pending. It looked like this:</p>
<pre><code><span class="hljs-string">k3os-server</span> [<span class="hljs-string">~</span>]<span class="hljs-string">$</span> <span class="hljs-string">kubectl</span> <span class="hljs-string">get</span> <span class="hljs-string">pods</span> <span class="hljs-string">-A</span>
<span class="hljs-string">NAMESPACE</span>        <span class="hljs-string">NAME</span>                                                              <span class="hljs-string">READY</span>   <span class="hljs-string">STATUS</span>     <span class="hljs-string">RESTARTS</span>   <span class="hljs-string">AGE</span>
<span class="hljs-string">elk</span>              <span class="hljs-string">kibana-kibana-54c46c54d6-nx9nr</span>                                    <span class="hljs-number">0</span><span class="hljs-string">/1</span>     <span class="hljs-string">Pending</span>    <span class="hljs-number">0</span>          <span class="hljs-string">13h</span>
<span class="hljs-string">elk</span>              <span class="hljs-string">logstash-logstash-0</span>                                               <span class="hljs-number">0</span><span class="hljs-string">/1</span>     <span class="hljs-string">Pending</span>    <span class="hljs-number">0</span>          <span class="hljs-string">13h</span>
<span class="hljs-string">portainer</span>        <span class="hljs-string">portainer-agent-5988b5d966-5cgkz</span>                                  <span class="hljs-number">0</span><span class="hljs-string">/1</span>     <span class="hljs-string">Pending</span>    <span class="hljs-number">0</span>          <span class="hljs-string">3h45m</span>
<span class="hljs-string">elk</span>              <span class="hljs-string">elasticsearch-master-0</span>                                            <span class="hljs-number">0</span><span class="hljs-string">/1</span>     <span class="hljs-string">Running</span>    <span class="hljs-number">3</span>          <span class="hljs-string">13h</span>
<span class="hljs-string">portainer</span>        <span class="hljs-string">svclb-portainer-agent-9xssw</span>                                       <span class="hljs-number">1</span><span class="hljs-string">/1</span>     <span class="hljs-string">Running</span>    <span class="hljs-number">2</span>          <span class="hljs-string">3h43m</span>
<span class="hljs-string">elk</span>              <span class="hljs-string">svclb-logstash-logstash-47ksf</span>                                     <span class="hljs-number">1</span><span class="hljs-string">/1</span>     <span class="hljs-string">Running</span>    <span class="hljs-number">3</span>          <span class="hljs-string">13h</span>
<span class="hljs-string">elk</span>              <span class="hljs-string">svclb-kibana-kibana-8wp5z</span>                                         <span class="hljs-number">1</span><span class="hljs-string">/1</span>     <span class="hljs-string">Running</span>    <span class="hljs-number">3</span>          <span class="hljs-string">13h</span>
<span class="hljs-string">node-red</span>      <span class="hljs-string">node-red-6678875c4c-cxgpk</span>                   <span class="hljs-number">0</span><span class="hljs-string">/1</span>     <span class="hljs-string">Running</span>       <span class="hljs-number">3</span>          <span class="hljs-string">3h45m</span>
<span class="hljs-string">kube-system</span>      <span class="hljs-string">svclb-traefik-lqcr7</span>                                               <span class="hljs-number">2</span><span class="hljs-string">/2</span>     <span class="hljs-string">Running</span>    <span class="hljs-number">4</span>          <span class="hljs-string">3h51m</span>
<span class="hljs-string">k3os-system</span>      <span class="hljs-string">system-upgrade-controller-8bf4f84c4-dwmnv</span>                         <span class="hljs-number">1</span><span class="hljs-string">/1</span>     <span class="hljs-string">Running</span>    <span class="hljs-number">14</span>         <span class="hljs-string">78d</span>
<span class="hljs-string">k3os-system</span>      <span class="hljs-string">apply-k3os-latest-on-k3os-server-with-de0d67248001a3a3b02-8bppd</span>   <span class="hljs-number">0</span><span class="hljs-string">/1</span>     <span class="hljs-string">Init:1/2</span>   <span class="hljs-number">0</span>          <span class="hljs-string">9m9s</span>
<span class="hljs-string">kube-system</span>      <span class="hljs-string">metrics-server-7566d596c8-rpx6w</span>                                   <span class="hljs-number">0</span><span class="hljs-string">/1</span>     <span class="hljs-string">Pending</span>    <span class="hljs-number">0</span>          <span class="hljs-string">107s</span>
<span class="hljs-string">kube-system</span>      <span class="hljs-string">traefik-56f7bf7775-wsjb6</span>                                          <span class="hljs-number">0</span><span class="hljs-string">/1</span>     <span class="hljs-string">Pending</span>    <span class="hljs-number">0</span>          <span class="hljs-string">74s</span>
<span class="hljs-string">kube-system</span>      <span class="hljs-string">local-path-provisioner-64d457c485-pv9w4</span>                           <span class="hljs-number">0</span><span class="hljs-string">/1</span>     <span class="hljs-string">Pending</span>    <span class="hljs-number">0</span>          <span class="hljs-string">61s</span>
<span class="hljs-string">kube-system</span>      <span class="hljs-string">coredns-5d69dc75db-7jln6</span>                                          <span class="hljs-number">0</span><span class="hljs-string">/1</span>     <span class="hljs-string">Pending</span>    <span class="hljs-number">0</span>          <span class="hljs-string">47s</span>
<span class="hljs-string">system-upgrade</span>   <span class="hljs-string">system-upgrade-controller-85b58fbc5f-xft58</span>                        <span class="hljs-number">0</span><span class="hljs-string">/1</span>     <span class="hljs-string">Pending</span>    <span class="hljs-number">0</span>          <span class="hljs-string">3s</span>
</code></pre><p>So I tried with "kubectl describe pod/portainer-agent-5988b5d966-5cgkz -n portainer" to figure out, why portainer was not working. This was the output:</p>
<pre><code><span class="hljs-string">k3os-server</span> [<span class="hljs-string">~</span>]<span class="hljs-string">$</span> <span class="hljs-string">kubectl</span> <span class="hljs-string">describe</span> <span class="hljs-string">pod/portainer-agent-5988b5d966-5cgkz</span> <span class="hljs-string">-n</span> <span class="hljs-string">portainer</span>
<span class="hljs-attr">Name:</span>           <span class="hljs-string">portainer-agent-5988b5d966-5cgkz</span>
<span class="hljs-attr">Namespace:</span>      <span class="hljs-string">portainer</span>
<span class="hljs-attr">Priority:</span>       <span class="hljs-number">0</span>
<span class="hljs-attr">Node:</span>           <span class="hljs-string">&lt;none&gt;</span>
<span class="hljs-attr">Labels:</span>         <span class="hljs-string">app=portainer-agent</span>
                <span class="hljs-string">pod-template-hash=5988b5d966</span>
<span class="hljs-attr">Annotations:</span>    <span class="hljs-string">&lt;none&gt;</span>
<span class="hljs-attr">Status:</span>         <span class="hljs-string">Pending</span>
<span class="hljs-attr">IP:</span>
<span class="hljs-attr">IPs:</span>            <span class="hljs-string">&lt;none&gt;</span>
<span class="hljs-attr">Controlled By:</span>  <span class="hljs-string">ReplicaSet/portainer-agent-5988b5d966</span>
<span class="hljs-attr">Containers:</span>
  <span class="hljs-attr">portainer-agent:</span>
    <span class="hljs-attr">Image:</span>      <span class="hljs-string">portainer/agent:latest</span>
    <span class="hljs-attr">Port:</span>       <span class="hljs-number">9001</span><span class="hljs-string">/TCP</span>
    <span class="hljs-attr">Host Port:</span>  <span class="hljs-number">0</span><span class="hljs-string">/TCP</span>
    <span class="hljs-attr">Environment:</span>
      <span class="hljs-attr">LOG_LEVEL:</span>           <span class="hljs-string">DEBUG</span>
      <span class="hljs-attr">AGENT_CLUSTER_ADDR:</span>  <span class="hljs-string">portainer-agent-headless</span>
      <span class="hljs-attr">KUBERNETES_POD_IP:</span>    <span class="hljs-string">(v1:status.podIP)</span>
    <span class="hljs-attr">Mounts:</span>
      <span class="hljs-string">/var/run/secrets/kubernetes.io/serviceaccount</span> <span class="hljs-string">from</span> <span class="hljs-string">portainer-sa-clusteradmin-token-zdg7s</span> <span class="hljs-string">(ro)</span>
<span class="hljs-attr">Conditions:</span>
  <span class="hljs-string">Type</span>           <span class="hljs-string">Status</span>
  <span class="hljs-string">PodScheduled</span>   <span class="hljs-literal">False</span>
<span class="hljs-attr">Volumes:</span>
  <span class="hljs-attr">portainer-sa-clusteradmin-token-zdg7s:</span>
    <span class="hljs-attr">Type:</span>        <span class="hljs-string">Secret</span> <span class="hljs-string">(a</span> <span class="hljs-string">volume</span> <span class="hljs-string">populated</span> <span class="hljs-string">by</span> <span class="hljs-string">a</span> <span class="hljs-string">Secret)</span>
    <span class="hljs-attr">SecretName:</span>  <span class="hljs-string">portainer-sa-clusteradmin-token-zdg7s</span>
    <span class="hljs-attr">Optional:</span>    <span class="hljs-literal">false</span>
<span class="hljs-attr">QoS Class:</span>       <span class="hljs-string">BestEffort</span>
<span class="hljs-attr">Node-Selectors:</span>  <span class="hljs-string">&lt;none&gt;</span>
<span class="hljs-attr">Tolerations:</span>     <span class="hljs-string">node.kubernetes.io/not-ready:NoExecute</span> <span class="hljs-string">op=Exists</span> <span class="hljs-string">for</span> <span class="hljs-string">300s</span>
                 <span class="hljs-string">node.kubernetes.io/unreachable:NoExecute</span> <span class="hljs-string">op=Exists</span> <span class="hljs-string">for</span> <span class="hljs-string">300s</span>
<span class="hljs-attr">Events:</span>
  <span class="hljs-string">Type</span>     <span class="hljs-string">Reason</span>            <span class="hljs-string">Age</span>   <span class="hljs-string">From</span>               <span class="hljs-string">Message</span>
  <span class="hljs-string">----</span>     <span class="hljs-string">------</span>            <span class="hljs-string">----</span>  <span class="hljs-string">----</span>               <span class="hljs-string">-------</span>
  <span class="hljs-attr">Warning  FailedScheduling  92m   default-scheduler  0/1 nodes are available:</span> <span class="hljs-number">1</span> <span class="hljs-string">node(s)</span> <span class="hljs-string">were</span> <span class="hljs-string">unschedulable.</span>
</code></pre><p>Ok, there was a glue: "unschedulable". Aha! So I did the next logical thing, at least for me, I entered "kubectl get node" and the output was:</p>
<pre><code>k3os-<span class="hljs-keyword">server</span> [~]$ kubectl <span class="hljs-keyword">get</span> node
<span class="hljs-type">NAME</span>          STATUS                     ROLES                  AGE    <span class="hljs-keyword">VERSION</span>
k3os-<span class="hljs-keyword">server</span>   Ready,SchedulingDisabled   control-plane,master   <span class="hljs-number">233</span>d   v1<span class="hljs-number">.19</span><span class="hljs-number">.15</span>+k3s1
</code></pre><p>Aha! "Ready,SchedulingDisabled". So I was confused why was scheduling disabled. So naturally I checked k3os on github. And of course a <a target="_blank" href="https://github.com/rancher/k3os/releases/tag/v0.20.11-k3s1r1">new version</a>  was released. So I immediately suspected the Auto Upgrade Feature. So I mad sure, auto upgrade was configured right, rebooted and waited 30min, while I was finally getting my breakfast. But when I checked again, no success, still same output.</p>
<p>Well, so I did another thing most of you have done before. Stackoverflow to the rescue. There I found this little line:</p>
<pre><code>k3os-<span class="hljs-keyword">server</span> [~]$ kubectl patch node k3os-<span class="hljs-keyword">server</span> -p "{\"spec\":{\"unschedulable\":false}}"
</code></pre><p>So I made sure, that my server was tainted "unschedulable"</p>
<pre><code><span class="hljs-string">k3os-server</span> [<span class="hljs-string">~</span>]<span class="hljs-string">$</span> <span class="hljs-string">kubectl</span> <span class="hljs-string">describe</span> <span class="hljs-string">node</span>
<span class="hljs-attr">Name:</span>               <span class="hljs-string">k3os-server</span>
<span class="hljs-attr">Roles:</span>              <span class="hljs-string">control-plane,master</span>
<span class="hljs-attr">Labels:</span>             <span class="hljs-string">beta.kubernetes.io/arch=arm64</span>
                    <span class="hljs-string">beta.kubernetes.io/instance-type=k3s</span>
                    <span class="hljs-string">beta.kubernetes.io/os=linux</span>
                    <span class="hljs-string">k3os.io/mode=local</span>
                    <span class="hljs-string">k3os.io/upgrade=enabled</span>
                    <span class="hljs-string">k3os.io/version=v0.19.15-k3s1r0</span>
                    <span class="hljs-string">k3s-upgrade=true</span>
                    <span class="hljs-string">k3s.io/hostname=k3os-server</span>
                    <span class="hljs-string">k3s.io/internal-ip=192.168.0.7</span>
                    <span class="hljs-string">kubernetes.io/arch=arm64</span>
                    <span class="hljs-string">kubernetes.io/hostname=k3os-server</span>
                    <span class="hljs-string">kubernetes.io/os=linux</span>
                    <span class="hljs-string">node-role.kubernetes.io/control-plane=true</span>
                    <span class="hljs-string">node-role.kubernetes.io/master=true</span>
                    <span class="hljs-string">node.kubernetes.io/instance-type=k3s</span>
                    <span class="hljs-string">plan.upgrade.cattle.io/k3os-latest=ac5fabe1f913dcad262a3c711eba31016d3297ac24d3db12f8daaa8d</span>
<span class="hljs-attr">Annotations:        flannel.alpha.coreos.com/backend-data:</span> {<span class="hljs-string">"VtepMAC"</span><span class="hljs-string">:"4a:a8:ea:c2:69:6c"</span>}
                    <span class="hljs-attr">flannel.alpha.coreos.com/backend-type:</span> <span class="hljs-string">vxlan</span>
                    <span class="hljs-attr">flannel.alpha.coreos.com/kube-subnet-manager:</span> <span class="hljs-literal">true</span>
                    <span class="hljs-attr">flannel.alpha.coreos.com/public-ip:</span> <span class="hljs-number">192.168</span><span class="hljs-number">.0</span><span class="hljs-number">.7</span>
                    <span class="hljs-attr">k3s.io/node-args:</span>
                      [<span class="hljs-string">"server"</span>,<span class="hljs-string">"--node-label"</span>,<span class="hljs-string">"k3os.io/upgrade=enabled"</span>,<span class="hljs-string">"--node-label"</span>,<span class="hljs-string">"k3os.io/mode=local"</span>,<span class="hljs-string">"--node-label"</span>,<span class="hljs-string">"k3os.io/version=v0.19.15-k3s1r0"</span>]
                    <span class="hljs-attr">k3s.io/node-config-hash:</span> <span class="hljs-string">UVUEL5HG5BTFEVR6MMGXJKHXJDX6XUREL7WJWDOM3IRLYCPS7JAQ====</span>
                    <span class="hljs-attr">k3s.io/node-env:</span>
                      {<span class="hljs-string">"K3S_CLUSTER_SECRET"</span><span class="hljs-string">:"********"</span>,<span class="hljs-string">"K3S_DATA_DIR"</span><span class="hljs-string">:"/var/lib/rancher/k3s/data/dcd31a7b8a5c2021f385fc354f38fe7b3fb758660905ed62a0faf7307e701fe...</span>
                    <span class="hljs-attr">node.alpha.kubernetes.io/ttl:</span> <span class="hljs-number">0</span>
                    <span class="hljs-attr">volumes.kubernetes.io/controller-managed-attach-detach:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">CreationTimestamp:</span>  <span class="hljs-string">Tue</span>, <span class="hljs-number">02</span> <span class="hljs-string">Feb</span> <span class="hljs-number">2021 12:23:32</span> <span class="hljs-string">+0000</span>
<span class="hljs-attr">Taints:</span>             <span class="hljs-string">node.kubernetes.io/unschedulable:NoSchedule</span>
<span class="hljs-attr">Unschedulable:</span>      <span class="hljs-literal">true</span>
<span class="hljs-attr">Lease:</span>
  <span class="hljs-attr">HolderIdentity:</span>  <span class="hljs-string">k3os-server</span>
  <span class="hljs-attr">AcquireTime:</span>     <span class="hljs-string">&lt;unset&gt;</span>
  <span class="hljs-attr">RenewTime:</span>       <span class="hljs-string">Thu</span>, <span class="hljs-number">23</span> <span class="hljs-string">Sep</span> <span class="hljs-number">2021 10:23:30</span> <span class="hljs-string">+0000</span>
<span class="hljs-attr">Conditions:</span>
  <span class="hljs-string">Type</span>                 <span class="hljs-string">Status</span>  <span class="hljs-string">LastHeartbeatTime</span>                 <span class="hljs-string">LastTransitionTime</span>                <span class="hljs-string">Reason</span>                       <span class="hljs-string">Message</span>
  <span class="hljs-string">----</span>                 <span class="hljs-string">------</span>  <span class="hljs-string">-----------------</span>                 <span class="hljs-string">------------------</span>                <span class="hljs-string">------</span>                       <span class="hljs-string">-------</span>
  <span class="hljs-string">NetworkUnavailable</span>   <span class="hljs-literal">False</span>   <span class="hljs-string">Thu</span>, <span class="hljs-number">23</span> <span class="hljs-string">Sep</span> <span class="hljs-number">2021 08:48:26</span> <span class="hljs-string">+0000</span>   <span class="hljs-string">Thu</span>, <span class="hljs-number">23</span> <span class="hljs-string">Sep</span> <span class="hljs-number">2021 08:48:26</span> <span class="hljs-string">+0000</span>   <span class="hljs-string">FlannelIsUp</span>                  <span class="hljs-string">Flannel</span> <span class="hljs-string">is</span> <span class="hljs-string">running</span> <span class="hljs-string">on</span> <span class="hljs-string">this</span> <span class="hljs-string">node</span>
  <span class="hljs-string">MemoryPressure</span>       <span class="hljs-literal">False</span>   <span class="hljs-string">Thu</span>, <span class="hljs-number">23</span> <span class="hljs-string">Sep</span> <span class="hljs-number">2021 10:18:47</span> <span class="hljs-string">+0000</span>   <span class="hljs-string">Tue</span>, <span class="hljs-number">02</span> <span class="hljs-string">Feb</span> <span class="hljs-number">2021 12:23:32</span> <span class="hljs-string">+0000</span>   <span class="hljs-string">KubeletHasSufficientMemory</span>   <span class="hljs-string">kubelet</span> <span class="hljs-string">has</span> <span class="hljs-string">sufficient</span> <span class="hljs-string">memory</span> <span class="hljs-string">available</span>
  <span class="hljs-string">DiskPressure</span>         <span class="hljs-literal">False</span>   <span class="hljs-string">Thu</span>, <span class="hljs-number">23</span> <span class="hljs-string">Sep</span> <span class="hljs-number">2021 10:18:47</span> <span class="hljs-string">+0000</span>   <span class="hljs-string">Tue</span>, <span class="hljs-number">02</span> <span class="hljs-string">Feb</span> <span class="hljs-number">2021 12:23:32</span> <span class="hljs-string">+0000</span>   <span class="hljs-string">KubeletHasNoDiskPressure</span>     <span class="hljs-string">kubelet</span> <span class="hljs-string">has</span> <span class="hljs-literal">no</span> <span class="hljs-string">disk</span> <span class="hljs-string">pressure</span>
  <span class="hljs-string">PIDPressure</span>          <span class="hljs-literal">False</span>   <span class="hljs-string">Thu</span>, <span class="hljs-number">23</span> <span class="hljs-string">Sep</span> <span class="hljs-number">2021 10:18:47</span> <span class="hljs-string">+0000</span>   <span class="hljs-string">Tue</span>, <span class="hljs-number">02</span> <span class="hljs-string">Feb</span> <span class="hljs-number">2021 12:23:32</span> <span class="hljs-string">+0000</span>   <span class="hljs-string">KubeletHasSufficientPID</span>      <span class="hljs-string">kubelet</span> <span class="hljs-string">has</span> <span class="hljs-string">sufficient</span> <span class="hljs-string">PID</span> <span class="hljs-string">available</span>
  <span class="hljs-string">Ready</span>                <span class="hljs-literal">True</span>    <span class="hljs-string">Thu</span>, <span class="hljs-number">23</span> <span class="hljs-string">Sep</span> <span class="hljs-number">2021 10:18:47</span> <span class="hljs-string">+0000</span>   <span class="hljs-string">Thu</span>, <span class="hljs-number">23</span> <span class="hljs-string">Sep</span> <span class="hljs-number">2021 08:48:41</span> <span class="hljs-string">+0000</span>   <span class="hljs-string">KubeletReady</span>                 <span class="hljs-string">kubelet</span> <span class="hljs-string">is</span> <span class="hljs-string">posting</span> <span class="hljs-string">ready</span> <span class="hljs-string">status</span>
<span class="hljs-attr">Addresses:</span>
  <span class="hljs-attr">InternalIP:</span>  <span class="hljs-number">192.168</span><span class="hljs-number">.0</span><span class="hljs-number">.7</span>
  <span class="hljs-attr">Hostname:</span>    <span class="hljs-string">k3os-server</span>
<span class="hljs-attr">Capacity:</span>
  <span class="hljs-attr">cpu:</span>                <span class="hljs-number">4</span>
  <span class="hljs-attr">ephemeral-storage:</span>  <span class="hljs-string">153593272Ki</span>
  <span class="hljs-attr">memory:</span>             <span class="hljs-string">7997752Ki</span>
  <span class="hljs-attr">pods:</span>               <span class="hljs-number">110</span>
<span class="hljs-attr">Allocatable:</span>
  <span class="hljs-attr">cpu:</span>                <span class="hljs-number">4</span>
  <span class="hljs-attr">ephemeral-storage:</span>  <span class="hljs-number">149415534885</span>
  <span class="hljs-attr">memory:</span>             <span class="hljs-string">7997752Ki</span>
  <span class="hljs-attr">pods:</span>               <span class="hljs-number">110</span>
<span class="hljs-attr">System Info:</span>
  <span class="hljs-attr">Machine ID:</span>                 <span class="hljs-string">47db285f8c257cdd3191ef3f614ce3ab</span>
  <span class="hljs-attr">System UUID:</span>                <span class="hljs-string">47db285f8c257cdd3191ef3f614ce3ab</span>
  <span class="hljs-attr">Boot ID:</span>                    <span class="hljs-string">259c932f-16d4-4674-8232-6b98edc4096c</span>
  <span class="hljs-attr">Kernel Version:</span>             <span class="hljs-number">5.4</span><span class="hljs-number">.0</span><span class="hljs-number">-1028</span><span class="hljs-string">-raspi</span>
  <span class="hljs-attr">OS Image:</span>                   <span class="hljs-string">k3OS</span> <span class="hljs-string">v0.19.15-k3s1r0</span>
  <span class="hljs-attr">Operating System:</span>           <span class="hljs-string">linux</span>
  <span class="hljs-attr">Architecture:</span>               <span class="hljs-string">arm64</span>
  <span class="hljs-attr">Container Runtime Version:</span>  <span class="hljs-string">containerd://1.4.9-k3s1</span>
  <span class="hljs-attr">Kubelet Version:</span>            <span class="hljs-string">v1.19.15+k3s1</span>
  <span class="hljs-attr">Kube-Proxy Version:</span>         <span class="hljs-string">v1.19.15+k3s1</span>
<span class="hljs-attr">PodCIDR:</span>                      <span class="hljs-number">10.42</span><span class="hljs-number">.0</span><span class="hljs-number">.0</span><span class="hljs-string">/24</span>
<span class="hljs-attr">PodCIDRs:</span>                     <span class="hljs-number">10.42</span><span class="hljs-number">.0</span><span class="hljs-number">.0</span><span class="hljs-string">/24</span>
<span class="hljs-attr">ProviderID:</span>                   <span class="hljs-string">k3s://k3os-server</span>
<span class="hljs-attr">Non-terminated Pods:</span>          <span class="hljs-string">(7</span> <span class="hljs-string">in</span> <span class="hljs-string">total)</span>
  <span class="hljs-string">Namespace</span>                   <span class="hljs-string">Name</span>                                                               <span class="hljs-string">CPU</span> <span class="hljs-string">Requests</span>  <span class="hljs-string">CPU</span> <span class="hljs-string">Limits</span>  <span class="hljs-string">Memory</span> <span class="hljs-string">Requests</span>  <span class="hljs-string">Memory</span> <span class="hljs-string">Limits</span>  <span class="hljs-string">AGE</span>
  <span class="hljs-string">---------</span>                   <span class="hljs-string">----</span>                                                               <span class="hljs-string">------------</span>  <span class="hljs-string">----------</span>  <span class="hljs-string">---------------</span>  <span class="hljs-string">-------------</span>  <span class="hljs-string">---</span>
  <span class="hljs-string">elk</span>                         <span class="hljs-string">elasticsearch-master-0</span>                                             <span class="hljs-number">1</span> <span class="hljs-string">(25%)</span>       <span class="hljs-number">1</span> <span class="hljs-string">(25%)</span>     <span class="hljs-string">2Gi</span> <span class="hljs-string">(26%)</span>        <span class="hljs-string">2Gi</span> <span class="hljs-string">(26%)</span>      <span class="hljs-string">13h</span>
  <span class="hljs-string">portainer</span>                   <span class="hljs-string">svclb-portainer-agent-9xssw</span>                                        <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>        <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>      <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>           <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>         <span class="hljs-string">3h46m</span>
  <span class="hljs-string">elk</span>                         <span class="hljs-string">svclb-logstash-logstash-47ksf</span>                                      <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>        <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>      <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>           <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>         <span class="hljs-string">13h</span>
  <span class="hljs-string">elk</span>                         <span class="hljs-string">svclb-kibana-kibana-8wp5z</span>                                          <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>        <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>      <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>           <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>         <span class="hljs-string">13h</span>
  <span class="hljs-string">kube-system</span>                 <span class="hljs-string">svclb-traefik-lqcr7</span>                                                <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>        <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>      <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>           <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>         <span class="hljs-string">3h54m</span>
  <span class="hljs-string">k3os-system</span>                 <span class="hljs-string">system-upgrade-controller-8bf4f84c4-dwmnv</span>                          <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>        <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>      <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>           <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>         <span class="hljs-string">78d</span>
  <span class="hljs-string">k3os-system</span>                 <span class="hljs-string">apply-k3os-latest-on-k3os-server-with-de0d67248001a3a3b02-8bppd</span>    <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>        <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>      <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>           <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>         <span class="hljs-string">12m</span>
<span class="hljs-attr">Allocated resources:</span>
  <span class="hljs-string">(Total</span> <span class="hljs-string">limits</span> <span class="hljs-string">may</span> <span class="hljs-string">be</span> <span class="hljs-string">over</span> <span class="hljs-number">100</span> <span class="hljs-string">percent</span>, <span class="hljs-string">i.e.</span>, <span class="hljs-string">overcommitted.)</span>
  <span class="hljs-string">Resource</span>           <span class="hljs-string">Requests</span>   <span class="hljs-string">Limits</span>
  <span class="hljs-string">--------</span>           <span class="hljs-string">--------</span>   <span class="hljs-string">------</span>
  <span class="hljs-string">cpu</span>                <span class="hljs-number">1</span> <span class="hljs-string">(25%)</span>    <span class="hljs-number">1</span> <span class="hljs-string">(25%)</span>
  <span class="hljs-string">memory</span>             <span class="hljs-string">2Gi</span> <span class="hljs-string">(26%)</span>  <span class="hljs-string">2Gi</span> <span class="hljs-string">(26%)</span>
  <span class="hljs-string">ephemeral-storage</span>  <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>     <span class="hljs-number">0</span> <span class="hljs-string">(0%)</span>
<span class="hljs-attr">Events:</span>              <span class="hljs-string">&lt;none&gt;</span>
</code></pre><p>And there it was "Taints:             node.kubernetes.io/unschedulable:NoSchedule"
Ok, I applied a fix I came up after reading an <a target="_blank" href="https://stackoverflow.com/questions/43147941/allow-scheduling-of-pods-on-kubernetes-master">stackoverflow article</a> and that was the result:</p>
<pre><code>k3os-<span class="hljs-keyword">server</span> [~]$ kubectl patch node k3os-<span class="hljs-keyword">server</span> -p "{\"spec\":{\"unschedulable\":false}}"
node/k3os-<span class="hljs-keyword">server</span> patched
k3os-<span class="hljs-keyword">server</span> [~]$ kubectl <span class="hljs-keyword">get</span> node
<span class="hljs-type">NAME</span>          STATUS   ROLES                  AGE    <span class="hljs-keyword">VERSION</span>
k3os-<span class="hljs-keyword">server</span>   Ready    control-plane,master   <span class="hljs-number">233</span>d   v1<span class="hljs-number">.19</span><span class="hljs-number">.15</span>+k3s1
</code></pre><p>And of course a reboot. After some distractions, it was my birthday after all, I checked again, and the update was done and apps worked again:</p>
<pre><code><span class="hljs-string">k3os-server</span> [<span class="hljs-string">~</span>]<span class="hljs-string">$</span> <span class="hljs-string">kubectl</span> <span class="hljs-string">get</span> <span class="hljs-string">node</span>
<span class="hljs-string">NAME</span>          <span class="hljs-string">STATUS</span>   <span class="hljs-string">ROLES</span>                  <span class="hljs-string">AGE</span>    <span class="hljs-string">VERSION</span>
<span class="hljs-string">k3os-server</span>   <span class="hljs-string">Ready</span>    <span class="hljs-string">control-plane,master</span>   <span class="hljs-string">233d</span>   <span class="hljs-string">v1.20.11+k3s1</span>
<span class="hljs-string">k3os-server</span> [<span class="hljs-string">~</span>]<span class="hljs-string">$</span> <span class="hljs-string">kubectl</span> <span class="hljs-string">get</span> <span class="hljs-string">pods</span> <span class="hljs-string">-A</span>
<span class="hljs-string">NAMESPACE</span>     <span class="hljs-string">NAME</span>                                        <span class="hljs-string">READY</span>   <span class="hljs-string">STATUS</span>    <span class="hljs-string">RESTARTS</span>   <span class="hljs-string">AGE</span>
<span class="hljs-string">elk</span>           <span class="hljs-string">elasticsearch-master-0</span>                      <span class="hljs-number">1</span><span class="hljs-string">/1</span>     <span class="hljs-string">Running</span>   <span class="hljs-number">0</span>          <span class="hljs-string">44m</span>
<span class="hljs-string">kube-system</span>   <span class="hljs-string">metrics-server-86cbb8457f-hnnr7</span>             <span class="hljs-number">1</span><span class="hljs-string">/1</span>     <span class="hljs-string">Running</span>   <span class="hljs-number">1</span>          <span class="hljs-string">42m</span>
<span class="hljs-string">kube-system</span>   <span class="hljs-string">local-path-provisioner-5ff76fc89d-jqsqt</span>     <span class="hljs-number">1</span><span class="hljs-string">/1</span>     <span class="hljs-string">Running</span>   <span class="hljs-number">2</span>          <span class="hljs-string">42m</span>
<span class="hljs-string">kube-system</span>   <span class="hljs-string">coredns-6488c6fcc6-v6zs2</span>                    <span class="hljs-number">1</span><span class="hljs-string">/1</span>     <span class="hljs-string">Running</span>   <span class="hljs-number">1</span>          <span class="hljs-string">42m</span>
<span class="hljs-string">k3os-system</span>   <span class="hljs-string">system-upgrade-controller-c6c9b4c5d-6l8wq</span>   <span class="hljs-number">1</span><span class="hljs-string">/1</span>     <span class="hljs-string">Running</span>   <span class="hljs-number">2</span>          <span class="hljs-string">42m</span>
<span class="hljs-string">kube-system</span>   <span class="hljs-string">traefik-7b6b5b8795-6jxpn</span>                    <span class="hljs-number">1</span><span class="hljs-string">/1</span>     <span class="hljs-string">Running</span>   <span class="hljs-number">0</span>          <span class="hljs-string">40m</span>
<span class="hljs-string">elk</span>           <span class="hljs-string">svclb-kibana-kibana-9n7xg</span>                   <span class="hljs-number">1</span><span class="hljs-string">/1</span>     <span class="hljs-string">Running</span>   <span class="hljs-number">0</span>          <span class="hljs-string">40m</span>
<span class="hljs-string">elk</span>           <span class="hljs-string">svclb-logstash-logstash-gsmnb</span>               <span class="hljs-number">1</span><span class="hljs-string">/1</span>     <span class="hljs-string">Running</span>   <span class="hljs-number">0</span>          <span class="hljs-string">40m</span>
<span class="hljs-string">portainer</span>     <span class="hljs-string">svclb-portainer-agent-rtq8g</span>                 <span class="hljs-number">1</span><span class="hljs-string">/1</span>     <span class="hljs-string">Running</span>   <span class="hljs-number">0</span>          <span class="hljs-string">40m</span>
<span class="hljs-string">kube-system</span>   <span class="hljs-string">svclb-traefik-rzz6w</span>                         <span class="hljs-number">2</span><span class="hljs-string">/2</span>     <span class="hljs-string">Running</span>   <span class="hljs-number">0</span>          <span class="hljs-string">40m</span>
<span class="hljs-string">portainer</span>     <span class="hljs-string">portainer-agent-5988b5d966-jdjvb</span>            <span class="hljs-number">1</span><span class="hljs-string">/1</span>     <span class="hljs-string">Running</span>   <span class="hljs-number">4</span>          <span class="hljs-string">48m</span>
<span class="hljs-string">elk</span>           <span class="hljs-string">logstash-logstash-0</span>                         <span class="hljs-number">1</span><span class="hljs-string">/1</span>     <span class="hljs-string">Running</span>   <span class="hljs-number">1</span>          <span class="hljs-string">44m</span>
<span class="hljs-string">elk</span>           <span class="hljs-string">kibana-kibana-54c46c54d6-84g5k</span>              <span class="hljs-number">1</span><span class="hljs-string">/1</span>     <span class="hljs-string">Running</span>   <span class="hljs-number">3</span>          <span class="hljs-string">4m14s</span>
<span class="hljs-string">node-red</span>      <span class="hljs-string">node-red-68fd7b8bdd-d9s88</span>                   <span class="hljs-number">1</span><span class="hljs-string">/1</span>     <span class="hljs-string">Running</span>       <span class="hljs-number">0</span>          <span class="hljs-string">42m</span>
</code></pre><p>To be honest I rather would have been spared by this "crisis", but it happened and I learned something from it. That's a good thing.And of course how valuable Stackoverflow is and it makes our live in I.T. so much easier.</p>
<p>But that brings me back to my love hate relationship. Why is it so hard to find the problems with k8s. I'm still not sure if what I did was ok, but it worked. That is what counts. But can I be sure it will not happen again, when the next update of k3os is released!? I don't know.</p>
<p>Of course it is k3s on a k3os, which is not the typical k8s environment, but I had a Pi and time and interest, so why not. And of course, the failure surely had something to do with <a target="_blank" href="https://blog.arjs.net/k8s-configs-not-my-cup-of-tea">me not liking how to configure k8s</a>. And hence I surely did something wrong when I configured auto upgrade for k3os. For my defense I can only say it worked before, because at some point auto upgrade had to work otherwise it would have not upgraded to "v1.19.15+k3s1".</p>
<p>Anyhow, I don't think it is k3s or k3os which caused the problem, but at this point, I don't care. I simply want to see my temperature. :-)</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1632596848100/8gvc7qRel.png" alt="Bildschirmfoto 2021-09-25 um 21.06.38.png" /></p>
<p>As always apply this rule: "Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."</p>
<p>Have a good one. Alex</p>
]]></content:encoded></item></channel></rss>