<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Digitalis.io Blog - Medium]]></title>
        <description><![CDATA[Digitalis delivers bespoke cloud-native and data solutions to help organisations navigate regulations and move at the speed of innovation. - Medium]]></description>
        <link>https://medium.com/digitalis-io-blog?source=rss----1634edd45521---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Digitalis.io Blog - Medium</title>
            <link>https://medium.com/digitalis-io-blog?source=rss----1634edd45521---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 06:53:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/digitalis-io-blog" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to run Kubernetes on premises for beginners]]></title>
            <link>https://medium.com/digitalis-io-blog/how-to-run-kubernetes-on-premises-for-beginners-6bcfef634f75?source=rss----1634edd45521---4</link>
            <guid isPermaLink="false">https://medium.com/p/6bcfef634f75</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[europe]]></category>
            <category><![CDATA[cloud-sovereignty]]></category>
            <category><![CDATA[baremetal]]></category>
            <dc:creator><![CDATA[Sergio Rua]]></dc:creator>
            <pubDate>Sun, 13 Apr 2025 03:30:57 GMT</pubDate>
            <atom:updated>2025-04-14T07:36:20.713Z</atom:updated>
            <content:encoded><![CDATA[<p>It is easier than you thought</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*kO37eXip7MRCQXi3_0udnQ.png" /></figure><h3>So you have taken my advice…</h3><p>and decided to migrate your Kubernetes cluster to a <a href="https://medium.com/digitalis-io-blog/future-proof-your-cloud-considering-european-options-beyond-the-hyperscalers-d8d8affd64ac">European bare-metal </a>provider, but you don’t know where to start. Let me give you a few tips.</p><h3>Bare-metal or virtual machines</h3><p>The first decision to make is whether you want to run the Kubernetes cluster on bare-metal or virtual machines. At Digitalis, we have been steadily moving away from virtual machines toward bare-metal, so bear in mind I may be a bit biased.</p><h4>Bare-Metal Kubernetes</h4><p>✅ <strong>Pros:</strong></p><ul><li><strong>Better performance</strong> (no virtualization overhead)</li><li><strong>Direct hardware access</strong> (ideal for latency-sensitive workloads)</li><li><strong>More control</strong> over resources and configurations</li><li><strong>Higher pod density</strong> — Can run <strong>more than 110 pods per node</strong> (unlike many VM-based setups, which hit limits due to virtualization overhead).</li></ul><p>❌ <strong>Cons:</strong></p><ul><li><strong>Higher maintenance</strong> (manual hardware provisioning, updates, and scaling)</li><li><strong>Less flexibility</strong> (harder to migrate workloads or resize clusters)</li></ul><h4>Virtual Machines (VMs) for Kubernetes</h4><p>✅ <strong>Pros:</strong></p><ul><li><strong>Easier scalability</strong> (quick VM provisioning and resizing)</li><li><strong>Simpler maintenance</strong> (hypervisors handle hardware abstraction)</li></ul><p>❌ <strong>Cons:</strong></p><ul><li><strong>Performance overhead</strong> (due to virtualization layer)</li><li><strong>Less control</strong> over underlying hardware</li><li><strong>Higher cost</strong></li></ul><h3>Deployment phase</h3><p>You have made your decision and you’re sticking to it. Now, it’s time to start deploying but you don’t know how. Let’s explore some of the most popular options available.</p><h4>Rancher</h4><p><a href="https://rancher.com/">Rancher</a> is a complete software stack for Kubernetes that addresses the need to manage multiple clusters. It can provision to all the hypervisors, and it does a pretty good job for on-premises too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*E_NVJvjsdrmnEzk7.png" /></figure><p>If you’ve gone the VMs route, their <a href="https://registry.terraform.io/providers/rancher/rancher2/latest/docs">Terraform provider</a> is solid, and you can orchestrate the entire cluster creation with Terraform. In my book, that’s a huge plus.</p><p>Another interesting thing is you can choose between <a href="https://rke.docs.rancher.com/">RKE</a> and k3s. See below.</p><p>What I don’t like about Rancher is their UI. It’s very slow and clunky. Also, upgrading Rancher versions is sometimes difficult. There are quite a few bugs, and the team is <a href="https://github.com/rancher/rancher/issues">slow to fix them</a>.</p><h4>K3s</h4><p><a href="https://k3s.io/">K3s</a> is a lightweight, production-ready Kubernetes distribution certified for high availability. It’s ideal for resource-constrained environments, remote locations, and IoT appliances, even in unattended scenarios.</p><p>Because of its simplicity, it is straightforward to install and maintain. You can have a cluster up and running in no time from Rancher or from the command line using:</p><pre>curl -sfL https://get.k3s.io | sh -</pre><blockquote>Remember, this is not recommended for large production workloads but for IoT or development environments.</blockquote><h4>Kubespray</h4><p><a href="https://github.com/kubernetes-sigs/kubespray">Kubespray</a> is a set of Ansible playbooks designed to deploy a production-ready Kubernetes cluster. They are well-maintained and relatively easy to use, especially if you have experience with Ansible.</p><p>For Virtual Machines, you’ll still need to use either your own Ansible playbooks or terraform code to create and manage them.</p><p>Like any other Ansible code, it’s not hard to create pipelines to run it and automate the process.</p><h4>Kops</h4><p>I haven’t used <a href="https://kops.sigs.k8s.io/">Kops</a> in years, but this was how I started deploying Kubernetes clusters. It’s very powerful and flexible. The downside is it has no support for bare-metal.</p><h4>Kubeadm</h4><p><a href="https://kubernetes.io/docs/reference/setup-tools/kubeadm/">Kubeadm</a> is essentially the official way to install Kubernetes. It’s the method taught in CNCF’s Kubernetes certifications, and for good reason — it works reliably and efficiently. That said, while you can find approaches using Ansible or Terraform to automate cluster creation, these methods aren’t as straightforward or well-integrated.</p><h3>Bonus tip</h3><p>If you need a Web UI for managing the clusters, you can still use <a href="https://rancher.com/">Rancher</a> or the <a href="https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/">Kubernetes Dashboard</a> though I recommend having a look at <a href="https://kubesphere.io/">https://kubesphere.io/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*krQmyFyLiUxrlC3m.png" /><figcaption>KubeSphere</figcaption></figure><h3>Final words</h3><p>You have many options and many decisions to make. It all boils down to your level of commitment to the project, your skills and how much you would to have it automated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*TLyp1qvmyVHehpmLuJob-g.png" /></figure><p>Since I’m the type who would automate even beer opening if I could, I prefer solutions like <strong>Kubespray</strong> or <strong>Rancher</strong> that offer full orchestration capabilities. As for bare-metal versus virtual machines, both are viable, but bare-metal wins every time when it comes to raw power and cost efficiency.</p><p><a href="https://digitalis.io/contact">Contact our team</a> for a free consultation to discuss how we can tailor our approach to your specific needs and challenges.</p><p><em>I, for one, welcome our new robot overlords</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bcfef634f75" width="1" height="1" alt=""><hr><p><a href="https://medium.com/digitalis-io-blog/how-to-run-kubernetes-on-premises-for-beginners-6bcfef634f75">How to run Kubernetes on premises for beginners</a> was originally published in <a href="https://medium.com/digitalis-io-blog">Digitalis.io Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Future-Proof Your Cloud: Considering European Options Beyond the Hyperscalers]]></title>
            <link>https://medium.com/digitalis-io-blog/future-proof-your-cloud-considering-european-options-beyond-the-hyperscalers-d8d8affd64ac?source=rss----1634edd45521---4</link>
            <guid isPermaLink="false">https://medium.com/p/d8d8affd64ac</guid>
            <category><![CDATA[tariffs]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[baremetal]]></category>
            <category><![CDATA[onshoring]]></category>
            <dc:creator><![CDATA[Sergio Rua]]></dc:creator>
            <pubDate>Thu, 10 Apr 2025 09:47:51 GMT</pubDate>
            <atom:updated>2025-04-10T09:47:51.713Z</atom:updated>
            <content:encoded><![CDATA[<p>Make Europe Great Again</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*AB8DhCgUidIocN2mj7ASbg.png" /></figure><h4>Introduction</h4><p>It has come as a surprise to us that the political tensions in the US, along with the new administration and tariffs, appear to be affecting organisations’ decisions on where to host services outside of the dominant global companies. In recent days, we have had several inquiries asking for help to migrate services to other providers.</p><p>At <a href="https://digitalis.io/">Digitalis</a>, we have been advocates for years for moving away from expensive global cloud providers to smaller ones, and even better, for bare metal as opposed to virtual machines. Perhaps it’s time to revisit our reasons for this.</p><h4>The big three</h4><p>Amazon Web Services, Google Cloud and Microsoft Azure dominate the market as you can see from the chart below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VDKmr5fMDNfMACFL.jpeg" /></figure><p>There are some smaller players as well, but the US is by far the largest owner, followed by China. We do not have any cloud providers of this size in Europe, but we do have many small providers that can be suitable for the majority of companies.</p><p>Some notable European cloud providers include:</p><ul><li>OVHcloud (France)</li><li>Scaleway (France)</li><li>IONOS (Germany)</li><li>Hetzner (Germany)</li><li>UpCloud (Finland)</li><li>Exoscale (Switzerland)</li><li>Cleura (Sweden)</li><li>T-Systems (Germany, a subsidiary of Deutsche Telekom)</li></ul><p>For a large number of businesses, especially those operating primarily within Europe or with strong data privacy concerns, these European providers can offer suitable infrastructure and services. They might not have the exact same breadth of services as the hyperscalers, but they can be cost-effective and aligned with European values.</p><h4>Services</h4><p>The hyperscalers are very good at providing IaS, PaS, DBaaS, etc. They have been building this into their offering over the years with large quantities of investments.</p><p>From my own personal experience, I see that many corporations prefer to buy, let’s say, a Database as a Service (DBaaS) such as PostgreSQL instead of running it themselves for lack of expertise in the company or simplicity.</p><p>This is probably where the smaller European clouds fail the test as managed services of this quality are either not available or not good enough.</p><p>If you move out of the hyperscalers you are likely to need to bring in the skills into the organization or hire a third-party company like <a href="https://digitalis.io/">Digitalis</a> to do it for you.</p><h4>Cost</h4><p>While hyperscalers like AWS, Azure, and GCP offer vast capabilities, their pricing models can become significantly expensive, particularly at scale. Exploring smaller, specialised cloud providers can sometimes yield <strong>substantial cost savings</strong>, especially for organisations with specific needs that don’t require the full suite of services offered by the giants.</p><p>The cost depends on many factors so it’s not easy for me to provide you with a figure.</p><ul><li><strong>Specific workload requirements:</strong> Smaller providers might offer more competitive pricing for certain types of workloads, but not others.</li><li><strong>Service parity:</strong> Hyperscalers offer a broad range of managed services that can reduce operational overhead, which might not be available or as mature as smaller providers. Migrating and managing these services independently can introduce new costs.</li><li><strong>Scalability and reliability needs:</strong> Hyperscalers are renowned for their massive scalability and robust reliability. Smaller providers might have limitations in these areas, potentially impacting business continuity and requiring additional investment for redundancy.</li><li><strong>Contractual agreements:</strong> The pricing and discount structures of both hyperscalers and smaller providers can vary significantly based on usage commitments and contract terms.</li><li><strong>Migration costs:</strong> Switching providers involves significant effort and potential costs related to migration, testing, and retraining.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b3-UB0_-CGdWtPO2" /></figure><h4>The case for bare metal</h4><p>I have <a href="https://blog.digitalis.io/the-case-for-bare-metal-and-hybrid-cloud-6a30d44951eb">discussed in the past</a> the merits of a bare-metal infrastructure so I’m not going to expand much in this area, just a few lines.</p><p>Building upon the discussion about hyperscaler costs, it’s worth highlighting the compelling advantages that smaller providers often offer in the realm of bare metal infrastructure. In my opinion, this is an area where they genuinely excel. You can frequently find powerful and cost-effective bare metal servers that outperform comparable cloud virtual machines in both price and performance. This is particularly attractive for those looking to deploy applications on <strong>Kubernetes</strong>, as running container orchestration directly on bare metal eliminates virtualisation overhead, leading to enhanced resource utilisation and speed.</p><blockquote>The same can be said of any data-intensive application such as a Database that would benefit greatly from faster disks.</blockquote><p>However, while the performance and cost benefits of bare metal from smaller providers are significant, especially for consistent and demanding workloads, it’s crucial to acknowledge the trade-offs. Organisations need to carefully consider potential limitations in scalability compared to the cloud, the increased operational responsibilities associated with managing the underlying infrastructure, and the absence of the extensive suite of managed services offered by hyperscalers.</p><h4>Final words</h4><p>It may be time to give some love ❤️ to the small cloud and bare metal providers, especially those located in Europe. They offer good value for money and truthfully many organisations would benefit from the savings in these uncertain times.</p><p>Many companies go straight into the hyperscalers without considering alternatives to then be saddled up with large bills wasting money that could be better employed in growing the company.</p><p>Don’t let inertia dictate your cloud strategy. Explore the power and value that European cloud and bare metal providers can offer — it might be the smartest move you make for your business.</p><p><a href="https://digitalis.io/contact">Contact our team</a> for a free consultation to discuss how we can tailor our approach to your specific needs and challenges.</p><p><em>I, for one, welcome our new robot overlords</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*gNYJxWRE1DuqkEwJRB5Y1w.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8d8affd64ac" width="1" height="1" alt=""><hr><p><a href="https://medium.com/digitalis-io-blog/future-proof-your-cloud-considering-european-options-beyond-the-hyperscalers-d8d8affd64ac">Future-Proof Your Cloud: Considering European Options Beyond the Hyperscalers</a> was originally published in <a href="https://medium.com/digitalis-io-blog">Digitalis.io Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The importance of synchronised time in a distributed Cassandra cluster.]]></title>
            <link>https://medium.com/digitalis-io-blog/the-importance-of-synchronised-time-in-a-distributed-cassandra-cluster-7b55b1369dfd?source=rss----1634edd45521---4</link>
            <guid isPermaLink="false">https://medium.com/p/7b55b1369dfd</guid>
            <category><![CDATA[ntp]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[chrony]]></category>
            <category><![CDATA[cassandra]]></category>
            <dc:creator><![CDATA[Brian Stark]]></dc:creator>
            <pubDate>Wed, 02 Apr 2025 09:06:35 GMT</pubDate>
            <atom:updated>2025-04-02T09:06:35.668Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*khP0TxlVbYVsrE3cjyh4vQ.jpeg" /></figure><p>On a daily basis most of us don’t notice a phenomenon called “time drift”.</p><h4>What is Time Drift?</h4><p>“Time drift” also referred to as “Clock drift” refers to where a computer’s internal clock deviates from actual time.</p><h4>How does it happen?</h4><p>Most computers released since the early 80’s have a built in Real Time Clock (RTC) that are based on a quartz crystal. With changes in temperature and aging components the quartz crystal can oscillate at a different frequency and introduce imperfections in the clock mechanism.</p><h4>How does it impact Cassandra?</h4><blockquote>“Last Write Wins” principal:</blockquote><p>In a Cassandra cluster data is accepted by the coordinator node and then distributed to each of the replicas based on the replication strategy.</p><p>When reading or writing data, if any timestamps on a Cassandra node are inconsistent, the node might return outdated data or apply updates in the wrong order, compromising the reliability of the data and the database. Data can appear or disappear depending on the coordinator queried and the timestamp of the data being written. Data inconsistencies, stale or missing data, and unexpected query results are common symptoms of clock skew.</p><p>Having consistent data also makes it easy to correlate log entries and troubleshoot issues across different nodes.</p><p>Cassandra’s log-based storage is timestamp-driven. It is absolutely critical that all nodes in a cluster have synchronized clocks. This setup uses timestamp versioning to guarantee eventual consistency of data, preventing inconsistent reads and writes, and also preventing write conflicts from occurring in multi-node or multi-datacenter clusters where data is distributed.</p><p>Timestamps are provided in 2 ways to a row of data at write time:</p><ul><li>By the client or software application clock that is writing to Cassandra.</li><li>By the Cassandra coordinator node when distributing the data to the other nodes in the cluster.</li></ul><p>If the timestamp is set by the client or application clock the Cassandra coordinator node will pass it to the rest of the cluster at write time.</p><p>If it is not set by the client or application the Cassandra coordinator node will add the timestamp based on its clock and pass that to the rest of the cluster at write time.</p><h4>How to remedy “time drift”?</h4><p>The best way to ensure that you time is accurate is to setup NTP or Network Time Protocol service on each of the Cassandra nodes.</p><p>NTP Servers can be configured in multiple ways depending on your Cassandra deployment environment.</p><p>Cloud Deployments like AWS, GCP or Azure:</p><ul><li>AWS uses “time.aws.com” to access their Amazon Time Sync Service.</li><li>GCP uses “time.google.com” for their public NTP service.</li><li>Azure primarily leverages the standard NTP servers available on the internet while also allowing configuration to use specific time sources within the Azure network depending on your needs.</li></ul><p>On-Premise Deployments:</p><p>By leveraging a dedicated quorum of NTP servers for on-premise deployments you ensure that Cassandra has the best possible chance of keeping track of time and eliminating time-drift.</p><h4>Final words</h4><p>Time keeping is a critically important part of Cassandra. It keeps data consistent and improves reliability. It prevents potential data loss of your data.</p><p>To monitor time drift you can use the NTP Offset graphs which are part of the System monitoring page in AxonOps. To see what your time drift could be sign up for a free account.</p><p><a href="https://axonops.com/free/">Free | AxonOps</a></p><p>You can <a href="https://digitalis.io/contact-us/">contact us</a> for a free consultation to discuss how we can tailor our approach to your specific needs and challenges.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b55b1369dfd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/digitalis-io-blog/the-importance-of-synchronised-time-in-a-distributed-cassandra-cluster-7b55b1369dfd">The importance of synchronised time in a distributed Cassandra cluster.</a> was originally published in <a href="https://medium.com/digitalis-io-blog">Digitalis.io Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What are Tombstones in Cassandra and Why Are There Too Many?]]></title>
            <link>https://medium.com/digitalis-io-blog/what-are-tombstones-in-cassandra-and-why-are-there-too-many-4dd071ef3ac0?source=rss----1634edd45521---4</link>
            <guid isPermaLink="false">https://medium.com/p/4dd071ef3ac0</guid>
            <category><![CDATA[apache-cassandra]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[system-administration]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Mario Nugnes]]></dc:creator>
            <pubDate>Wed, 19 Mar 2025 16:41:03 GMT</pubDate>
            <atom:updated>2025-03-19T16:41:03.051Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cRBTVKaw8QLF0-ncHB4fyA.jpeg" /></figure><p>I have been asked about tombstones in cassandra, often from users who suddenly are experiencing a slow cluster, some nasty timeouts, a large number of tombstones, and a complex problem to sort. So I decided to put together some of my lengthy answers and write a blog about it.</p><p>Apache Cassandra is a powerful NoSQL database designed for high availability and scalability. However, its architecture and data management come with certain complexities, one of which is tombstones. In this blog post, we will delve into what tombstones are, why having too many is problematic, what creates them, how are they cleared, and the role of the gc_grace_seconds parameter.</p><h3>What are tombstones?</h3><p>In Cassandra, a tombstone is a marker indicating that a piece of data (row, column, or cell) has been deleted. Rather than immediately removing data upon deletion, Cassandra writes a tombstone to mark the data as deleted. This approach supports Cassandra’s eventual consistency model and ensures that deletions are propagated across all replicas while improving performance.</p><p>Tombstones are not permanent and are eventually cleared through a process called compaction. Compaction in Cassandra has several types, but the key point is that during this process, Cassandra merges SSTables and discards data that is no longer needed, including tombstones older than a certain threshold.</p><h3>Why are too many tombstones bad?</h3><p>Having an excessive number of tombstones can severely impact the performance and stability of a Cassandra cluster. Here are the key reasons why:</p><ol><li><strong>Read Performance Degradation</strong>: During read operations, Cassandra must check tombstones to determine if a piece of data has been deleted. If there are many tombstones, read latency increases as Cassandra scans through them.</li><li><strong>Compaction Overhead</strong>: Compaction is a process in Cassandra that merges SSTables and removes unnecessary tombstones. If there are too many tombstones, compaction becomes more resource-intensive and frequent, leading to higher CPU and I/O load.</li><li><strong>Increased Disk Usage</strong>: Tombstones occupy disk space. Although they are smaller than the actual data, a large number of tombstones can lead to significant disk usage.</li><li><strong>Write Amplification</strong>: The presence of tombstones means that more data needs to be managed and compacted, increasing the overall write amplification in the system.</li><li><strong>Increased Memory Usage</strong>: During scans, Cassandra needs to keep tombstones in memory to ensure all replicas are aware of deletions. Workloads generating a lot of tombstones can lead to high memory consumption, potentially exhausting the server heap and causing performance issues.</li></ol><h3>What Creates Tombstones?</h3><p>Tombstones can be generated through various operations in Cassandra:</p><ul><li><strong>Deletes:</strong> Any delete operation, whether it is a row delete, a range delete, or a column delete, will create a tombstone.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C4Os1QAH0U802Vs9p_mMCA.png" /><figcaption>In our first example, we inserted a value in a table, flushed it on disk, and deleted it.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JM_R0j27iWTyRPnbgbPQ3A.png" /><figcaption>We Just created a nice tombstone.</figcaption></figure><ul><li><strong>TTL (Time-to-Live)</strong>: Data with a TTL will be automatically treated like a tombstone once the TTL expires.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q524xdecNWQloybd_qqAww.png" /><figcaption>In this example, we created a table with a TTL of 300 seconds and added a record.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nqKPq_5sVsxPsMX37YFCyQ.png" /><figcaption>We created a tombstone.</figcaption></figure><ul><li><strong>Updates</strong>: Updating a column with a new value can create a tombstone for the old value, depending on the conditions of the update e.g: if an update to a column sets its value to null, a tombstone is created. This marks the column for deletion, similar to an explicit delete operation.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Ipws_ubwNF1XYt6YL5HBg.png" /><figcaption>In this example, we inserted a value in the table, flushed it on disk, and updated it with a null value.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*ZsVBm27RvlyBZkx4hGMMYA.png" /><figcaption>As we can see on the disk, the update created a tombstone for the null value just inserted.</figcaption></figure><ul><li><strong>Range Deletes</strong>: When a range of rows is deleted using DELETE ... WHERE with a range condition, tombstones are created for all the affected rows.</li><li><strong>Insert: </strong>Inserting a null value can create tombstones, this is an easy mistake to make, see the example of good and bad null insert query.</li></ul><figure><img alt="Insert that create null value and insert that doesn’t" src="https://cdn-images-1.medium.com/max/1024/1*iocug6JPjCNdanZH46IVNA.png" /><figcaption>In this example, we did a bad insert where the second column is null, which created the tombstone. We also did a good insert for comparison.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nnEPva9cRLX8KZKEJScVTw.png" /><figcaption>We can see the tombstone directly from the SSTable</figcaption></figure><ul><li><strong>Collection column</strong>: while Cassandra collections (list, set, map) are convenient, they do indeed generate tombstones, especially during deletions and updates, because of Cassandra’s distributed, immutable data storage model.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ybNvjzgdobBxy8ShjBvVeg.png" /><figcaption>In this example, we create a table with a list, a set and a map, then we insert some value to see how those will be written once flushed on disk.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_PP07Zlwx1jA67mPnxktag.png" /><figcaption>Now we can see the tombstones that we just created.</figcaption></figure><h3>The Role of gc_grace_seconds</h3><p>The gc_grace_seconds parameter in Cassandra plays a crucial role in managing tombstones. It specifies the time period during which tombstones are kept before they are eligible for garbage collection (i.e., permanent removal during compaction). The default value is 10 days (864,000 seconds).</p><p>Something to remember regardinggc_grace_seconds : is that it is a balancing act, setting gc_grace_seconds too low can lead to data resurrection (AKA zombie data) if replicas haven&#39;t fully synced. Setting it too high can result in an accumulation of tombstones.</p><h3>Best Practices to Manage Tombstones</h3><p>To manage tombstones effectively, there are some best practices that we can keep in mind.</p><ol><li><strong>Be careful when you create your data model</strong>: as in part shown above, how you choose to create your schema, can put you on the right path or put your cluster in an unmanageable state.</li><li><strong>Tune </strong><strong>gc_grace_seconds</strong>: Adjust gc_grace_seconds according to your replication strategy and workload to balance consistency and performance if the default 10 days is not good for you.</li><li><strong>Good Compaction</strong>: Ensure that compaction processes are running smoothly and frequently to effectively manage tombstones. Use strategies like SizeTieredCompactionStrategy (STCS) or LeveledCompactionStrategy (LCS) based on your data model and workload.</li><li><strong>Monitor Metrics</strong>: Use Cassandra’s monitoring tools like AxonOps to keep an eye on tombstone creation and compaction performance.</li><li><strong>Avoid Large Deletes</strong>: Large deletions can create many tombstones. Where possible, avoid bulk deletes or spread them out over time.</li><li><strong>Repair: </strong>Make sure your data is always repaired within the gc_grace_seconds .</li></ol><h3>Tombstones thresholds</h3><p>As described above, a high number of tombstones can cause issues in your cluster. To mitigate this issue, Apache Cassandra has a tombstone counter: During read operations, as part of merging data from different SSTables to fulfill a query, Cassandra counts all the tombstones encountered. If the number of tombstones exceeds warning or failure thresholds, Cassandra will warn you and, for the failure limit, will also stop the query.</p><h4>Here’s how each threshold operates:</h4><ul><li><strong>tombstone_warn_threshold</strong><br><strong>Purpose:</strong> This threshold acts as a warning indicator. It defines the number of tombstones that, if encountered during a single query, will log a warning in the Cassandra logs.<br><strong>Default Value:</strong> Set to 1,000 tombstones per read query.<br><strong>Function:</strong> When a query hits this threshold, Cassandra logs a warning (often seen in system.log) to alert administrators that the query is encountering a high volume of tombstones. This warning is useful for identifying potential issues before they escalate into severe performance problems.<br><strong>Action:</strong> This is a non-fatal threshold. Cassandra simply logs the occurrence without interrupting the query execution. Administrators are advised to review these warnings and assess the queries or data models generating excessive tombstones to prevent further issues.<br><strong>Example of log:</strong></li></ul><pre>&#39;SELECT * FROM data WHERE dtype=7 AND dposition=15 AND dnumber=-8349 <br>AND measuredtime&gt;=&#39;2024-06-06T00:00:00.000Z&#39; <br>AND measuredtime&lt;=&#39;2024-06-26T23:59:00.000Z&#39; <br>ORDER BY measuredtime DESC&#39; generated server side warning(s): <br>Read 1703 live rows and 19085 tombstone cells for query <br>SELECT * FROM db.data WHERE dtype, dposition, dnumber = 7, 15, -8349 <br>AND measuredtime &lt;= 2024-06-26T23:59:00.000Z <br>AND measuredtime &gt;= 2024-06-06T00:00:00.000Z <br>LIMIT 5000; token -2455708300064992048 (see tombstone_warn_threshold)</pre><ul><li><strong>tombstone_failure_threshold</strong><br><strong>Purpose:</strong> This threshold is more critical than the warning threshold and is designed to prevent severe performance issues from excessive tombstone reads.<br><strong>Default Value:</strong> Set to 100,000 tombstones per read query.<br><strong>Function:</strong> When a query encounters a number of tombstones equal to or greater than this threshold, Cassandra will abort the query and return an error instead of completing it. The error message usually indicates a tombstone overflow, which highlights that the query would be too resource-intensive to complete without risking node stability.<br><strong>Action:</strong> When this threshold is hit, Cassandra will throw an error to prevent overloading nodes with a potentially excessive read workload. This behavior helps maintain cluster stability, as high tombstone counts can lead to long read latencies, excessive memory usage, and even OutOfMemory (OOM) errors.<br><strong>Example of log:</strong></li></ul><pre>Scanned over 100000 tombstones; query aborted</pre><h4>How to Adjust Tombstone Thresholds</h4><p>Both tombstone_warn_threshold and tombstone_failure_threshold can be configured in the configuration file cassandra.yaml:</p><pre><br>tombstone_warn_threshold: 1000<br>tombstone_failure_threshold: 100000</pre><p>Adjusting these values may be necessary for workloads where certain read paths naturally generate many tombstones, though it is usually better to review the data model and query patterns first. Lowering these thresholds can increase sensitivity to tombstone issues (helping catch problems sooner) while raising them can accommodate specific use cases with high deletion rates. This should be done cautiously.</p><h3>Conclusion</h3><p>Tombstones are essential to Cassandra’s architecture, enabling its robust deletion mechanism while maintaining eventual consistency. However, managing tombstones is crucial for maintaining cluster performance and stability. By understanding what creates tombstones, how they are cleared, and how to fine-tune related settings, you can optimise your Cassandra clusters to handle tombstones effectively and maintain optimal performance.</p><p>By following these best practices, you can ensure that your Cassandra clusters remain healthy and performant, even as they scale to meet the demands of your applications.</p><p>If you are struggling with this or other issues, <a href="https://digitalis.io/contact">Contact our team</a> for a free consultation to discuss how we can tailor our approach to your specific needs and challenges.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4dd071ef3ac0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/digitalis-io-blog/what-are-tombstones-in-cassandra-and-why-are-there-too-many-4dd071ef3ac0">What are Tombstones in Cassandra and Why Are There Too Many?</a> was originally published in <a href="https://medium.com/digitalis-io-blog">Digitalis.io Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Collecting metrics, traces and logs]]></title>
            <link>https://medium.com/digitalis-io-blog/collecting-metrics-traces-and-logs-15fa00bcb4e8?source=rss----1634edd45521---4</link>
            <guid isPermaLink="false">https://medium.com/p/15fa00bcb4e8</guid>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[logging]]></category>
            <dc:creator><![CDATA[Sergio Rua]]></dc:creator>
            <pubDate>Tue, 18 Mar 2025 10:27:42 GMT</pubDate>
            <atom:updated>2025-03-18T10:27:42.029Z</atom:updated>
            <content:encoded><![CDATA[<p>Simplicity is better</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*YFBmR2xoEdH8RiZSzzNzkA.png" /><figcaption>Log Keeping</figcaption></figure><h4>Introduction</h4><p>A few days ago, <a href="https://medium.com/@serg-digitalis/why-and-how-we-collect-logs-8f54889100c0">I wrote an article</a> about why we need to collect logs. I wrote it because I’ve been working lately on designing a new internal standard for my company, <a href="https://digitalis.io/">Digitalis</a>, on how we’re upgrading the way we monitor.</p><h4>The legacy model</h4><p>When we engage a new managed services customer, we deploy a monitoring stack at the customer’s premises to monitor the applications for which we become responsible. If the application in question is Kafka or Cassandra, we use <a href="https://axonops.com/">AxonOps</a>. Otherwise, we use a Prometheus-based monitoring.</p><p>If deploying a monitoring stack to Kubernetes, Helm charts are commonly used to install <strong>Grafana</strong>, <strong>Mimir</strong>, <strong>Prometheus</strong>, and <strong>Alertmanager</strong>. These tools form the backbone of monitoring and observability in Kubernetes environments:</p><ul><li><a href="https://grafana.com/"><strong>Grafana</strong></a>: A powerful visualization tool for creating dashboards and analyzing metrics.</li><li><a href="https://grafana.com/oss/mimir/"><strong>Mimir</strong></a>: A scalable time-series database integrated with Grafana for storing metrics.</li><li><a href="https://prometheus.io/"><strong>Prometheus</strong></a>: A widely-used metrics collection system for monitoring Kubernetes clusters.</li><li><a href="https://prometheus.io/docs/alerting/latest/alertmanager/"><strong>Alertmanager</strong></a>: Used for managing alerts generated by Prometheus.</li></ul><p>Once the stack is deployed, <strong>Prometheus exporters</strong> are employed to monitor applications, whether running inside or outside of Kubernetes. Exporters provide metrics in a format that Prometheus can scrape. Examples include:</p><ul><li><strong>Node Exporter</strong>: Collects resource utilization data from nodes (<a href="https://github.com/prometheus/node_exporter">details</a>).</li><li><strong>Kube-State-Metrics</strong>: Exposes Kubernetes API object metrics (<a href="https://github.com/kubernetes/kube-state-metrics">details</a>).</li><li>Custom application exporters can be configured using libraries like <a href="https://prometheus.io/docs/instrumenting/clientlibs/">Prometheus Client Libraries</a>.</li></ul><p>For streamlined deployment, the <a href="https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack">kube-prometheus-stack Helm chart</a> provides an integrated solution that includes Prometheus, Grafana, and Alertmanager along with pre-configured dashboards and alerting rules.</p><p>For logs, we prefer Grafana Loki and these are sent over from the clients using <a href="https://grafana.com/docs/loki/latest/send-data/promtail/">promtail</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*ZWLJ27rJA6oeLdJQ7_GQQQ.png" /></figure><p>However, if we’re deploying to Virtual Machines or baremetal we use a slightly different approach. We are using standard Grafana (not Mimir) and Elasticsearch for logs. At the client side, we use <a href="https://www.elastic.co/beats/filebeat">filebeat</a>.</p><p>We currently deploy a single Prometheus server that scrapes metrics from application-specific exporters. For example, we use the <a href="https://prometheus.io/">Prometheus Node Exporter</a> for OS metrics and the <a href="https://prometheus.io/docs/instrumenting/exporters/">Prometheus Elasticsearch Exporter</a> for Elasticsearch metrics.</p><p>Everything is installed and managed with <a href="https://ansible.com/">Ansible</a>.</p><h4>Why the discrepancy?</h4><p>It’s simple: the tech stack we use in Kubernetes and Kubernetes itself hasn’t been around for that long. Grafana Loki was launched only in 2022 and Elasticsearch is at least 10 years older.</p><p>Furthermore, we use Grafana Mimir and Loki because most of the Kubernetes deployments we manage are in the cloud and we can take advantage of the S3, GCS and Azure that are cheaper and more resilient for storage.</p><p>This is why I’m unifying the monitoring stack into a new solution.</p><h4>Why do we need to change</h4><p>Aside from unifying Kubernetes with VMs and baremetal, there are some other important reasons for the change.</p><ul><li><strong>Dynamic environments</strong>: dynamic environments are now the norm. Most companies deploying to the cloud are using dynamic DNS, dynamic IPs, etc. Whilst it is possible to configure prometheus to discover services using plugins, it has security implications. <a href="https://aws.amazon.com/blogs/mt/automating-amazon-ec2-instance-monitoring-with-prometheus-ec2-service-discovery-and-aws-distro-for-opentelemetry/">See this example for AWS</a>.</li><li><strong>Security</strong>: as per the above point, in dynamic environments, the prometheus server will need additional permissions to perform discovery. This is not a security problem per se but it adds up to the overall security profile.</li><li><strong>Complexity</strong>: we use more vendors than we need, this adds complexity to our own monitoring stack.</li><li><strong>Cost</strong>: this level of complexity also implies higher cost: time-to-market, virtual machines costs and maintenance time</li></ul><h4>The new model</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*CbVESW9RWtNwDPhNS-_g8Q.png" /></figure><p>The highlights are:</p><ul><li>Remove ElasticSearch in favour of <a href="https://grafana.com/oss/loki/">Grafana Loki</a></li><li>Change the direction of metrics from pull to push</li><li>Use <a href="https://grafana.com/docs/alloy/latest/">Grafana alloy </a>to push metrics, logs and if available, telemetry</li><li>Retain Prometheus and Alertmanager</li></ul><p><strong>Grafana vs. Grafana Mimir: Choosing the Right Tool for Your Needs</strong></p><p>When comparing Grafana and Grafana Mimir, it’s essential to understand their unique strengths. Grafana is renowned for its versatile data visualization capabilities, supporting various data sources and offering customizable dashboards, alerting, and notifications. It is user-friendly and widely adopted, making it an excellent choice for small deployments where simplicity and ease of use are paramount.</p><p>On the other hand, Grafana Mimir is a scalable, Prometheus-compatible time series database designed for large-scale environments. It excels in handling massive amounts of data with features like multi-tenancy, longer retention, and faster queries.</p><p>However, for small deployments, the complexity and resource requirements of Grafana Mimir may be unnecessary. You’ll have to asses your individual needs and decide on one or the other.</p><h4>Grafana Loki</h4><p>When <a href="https://grafana.com/oss/loki/">Grafana Loki</a> first launched, I have to admit I didn’t like it. I found the Grafana UI for querying logs slow and cumbersome compared to Elastic with Kibana. However, it has improved since then, and I’ve learned to use it better.</p><p>Loki’s architecture is designed to scale by separating readers and ingesters when the volume is high. Additionally, you can choose more cost-effective storage options such as Amazon Simple Storage Service (S3), Google Cloud Storage (GCS), and Azure Blob Storage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*1FDt64o6PkB1loUOzwvLyQ.png" /></figure><h4>Prometheus and Alertmanager</h4><p>Grafana Mimir can replace Prometheus and Alertmanager. However, I’m still not too keen on it. Personally, I find it much easier to use and manage Prometheus, and both applications are simple and well-understood by the entire team.</p><p>Furthermore, the <a href="https://github.com/prometheus-operator/prometheus-operator">Prometheus Operator</a> running in Kubernetes is excellent, making alert management very straightforward from an automation perspective (think Ansible, Terraform, GitOps, etc.).</p><p>Additionally, I find the Grafana query manager quite challenging to use compared to the <a href="https://grafana.com/docs/grafana/latest/datasources/prometheus/query-editor/">Prometheus query browser</a>.</p><h4>Grafana Alloy</h4><p>The cherry in the cake is <a href="https://grafana.com/docs/alloy/latest/">Grafana Alloy</a>. Until now, for metrics, we’ve been using different prometheus exporters running in the node and exposed over https with authentication to the prometheus server to be scraped.</p><p>Then, for logs, we use different tools. We have servers running <a href="https://grafana.com/docs/loki/latest/send-data/promtail/">promtail</a> (which by the way, if you haven’t heard, it deprecated since Feb 2025), some others, <a href="https://www.elastic.co/beats/filebeat">filebeat</a>… It depends on when they were set up and whether they use Elastic or Loki.</p><p>What I like the most about <a href="https://grafana.com/docs/alloy/latest/set-up/install/">Alloy</a> is that it excels in both performance and ease of installation and configuration. There is a good <a href="https://grafana.com/docs/alloy/latest/set-up/install/ansible/">Ansible role</a> for it, and there is also a well-maintained <a href="https://grafana.com/docs/alloy/latest/configure/kubernetes/">Helm chart</a> available.</p><p>The other important change is the direction. Until now, prometheus is responsible for connecting to the exporters to gather the metrics. With Grafana Alloy, however, the logs and metrics are pushed to Grafana and Prometheus using the <a href="https://prometheus.io/docs/specs/prw/remote_write_spec/">remote-write option</a> or via the Mimir push API.</p><p>The other advantage is that Alloy has a core set of exporters ready to use. For example, we always install the <a href="https://github.com/prometheus/node_exporter">prometheus node exporter</a> and with Alloy we no longer need it as we can use the <a href="https://grafana.com/docs/alloy/latest/reference/components/prometheus/prometheus.exporter.unix/"><em>prometheus.exporter.unix</em></a> that it provides.</p><p>Although not discussed in this blog post, another great feature in Grafana Alloy is the support for <a href="https://opentelemetry.io/">OpenTelemetry</a>. Grafana Alloy operates as an OpenTelemetry (OTEL) agent, enabling the collection and transmission of telemetry data from diverse sources to monitoring systems for analysis and visualisation.</p><h4>Final words</h4><p>Essentially, I’m responsible for ensuring the smooth operation of numerous client platforms. My primary objectives are twofold: firstly, to maintain a consistent 100% uptime for these platforms, and secondly, to minimise the need for after-hours incident response, specifically, to avoid disruptive PagerDuty alerts that have a knack for ruining perfectly good dreams. 😄</p><p>To achieve these goals, a robust and reliable monitoring platform is indispensable. It’s about proactive management, preventing issues before they escalate, and ensuring a stable environment for our clients.</p><p><a href="https://digitalis.io/contact">Contact our team</a> for a free consultation to discuss how we can tailor our approach to your specific needs and challenges.</p><p><em>I, for one, welcome our new robot overlords</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15fa00bcb4e8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/digitalis-io-blog/collecting-metrics-traces-and-logs-15fa00bcb4e8">Collecting metrics, traces and logs</a> was originally published in <a href="https://medium.com/digitalis-io-blog">Digitalis.io Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The risks of AI to your data]]></title>
            <link>https://medium.com/digitalis-io-blog/the-risks-of-ai-to-your-data-f34097516100?source=rss----1634edd45521---4</link>
            <guid isPermaLink="false">https://medium.com/p/f34097516100</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[dáta]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[data-protection]]></category>
            <dc:creator><![CDATA[Sergio Rua]]></dc:creator>
            <pubDate>Mon, 10 Mar 2025 12:33:50 GMT</pubDate>
            <atom:updated>2025-03-10T12:33:50.886Z</atom:updated>
            <content:encoded><![CDATA[<p>Is your company at risk?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*wQok8bC6hkhtDZG8EzJU6A.png" /></figure><h4>Introduction</h4><p>Last week I met with a couple of good friends I haven’t seen in ages. They both work in IT and we worked together in the past at different companies. We were talking about the impact the AI and LLM is having in our work life and the discussion moved into how many enterprises, including theirs, are blocking access to ChatGPT, Copilot and friends.</p><h4>Why?</h4><p>In a few words: data privacy and security. It is probably harmless to access your favourite chat platform and ask for help with a shell script or more information on an error log. However, things can be more difficult to contain once you start using agents that can read your code (think of <a href="https://code.visualstudio.com/docs/copilot/overview">Copilot</a>, <a href="https://github.com/RooVetGit/Roo-Code">Roo-Code</a>, etc), for example, and share it with the LLM models for analysis.</p><p>Then there are the accidents, like copying and pasting credentials or God forbid, customers’ data.</p><p>Remember, anything you send to the AI models is used to train the next models. So if you want everyone to know your password is <em>asdf1234</em>, be careful not to type it in!</p><h4>What’s the solution?</h4><p>Most if not all of the large platforms provide an “enterprise” edition designed for enterprises that want to take advantage of AI without compromising their data. If you’re adopting one of these solutions, be very careful and read the small print to ensure your data is not going to be used for training and that the models do not learn from your chat inputs.</p><p>The second option is to run your own in-house LLM. If you haven’t tried it this is a lot easier than you probably thought. There are some caveats:</p><ul><li>The responses are not as fast as with commercial models</li><li>The best models in terms of quality of responses remain commercial</li><li>You will need to host the AI service in servers with GPU, and this can be expensive</li></ul><h4>How?</h4><p>The solution below is based on using <a href="https://ollama.com/download">Ollama</a>. It’s very easy to install and run. Get to the <a href="https://ollama.com/">Ollama</a> website and download the server for your platform.</p><p>Next, create a service to ensure <strong>ollama</strong> runs in the background. For example, you can add this to <em>/etc/systemd/system/ollama.service</em></p><pre>[Unit]<br>Description=Ollama Service<br>After=network.target<br><br>[Service]<br>Type=simple<br>Environment=OLLAMA_HOST=127.0.0.1:11434<br>ExecStart=/opt/ollama/bin/ollama serve<br>Restart=always<br>RestartSec=10<br><br># Optional security measures<br>PrivateTmp=true<br>ProtectSystem=full<br>NoNewPrivileges=true<br><br>[Install]<br>WantedBy=multi-user.target</pre><p>If you prefer to run Ollama in docker, ensure you have the <a href="https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html">nvidia toolkit</a> installed and run it with</p><pre>docker run --rm -d \<br>  -v ollama:/root/.ollama -p 11434:11434 \<br>  --gpus=all \<br>  --name ollama ollama/ollama</pre><p>You will need to download a LLM model to use. Try different ones and see which ones work better for you. I’m currently using <em>qwen2.5:32b-instruct</em></p><pre>ollama pull qwen2.5:32b-instruct</pre><p>Unless you’re happy with the command line, you probably want a web UI for the chat interactions. <a href="https://github.com/open-webui/open-webui">Open WebUI</a> is brilliant, I especially adore their code formatting and syntax highlighting.</p><p>It is simple to run in a container:</p><pre>docker run -d -p 3000:8080 \<br>  --add-host=host.docker.internal:host-gateway \<br>  -v open-webui:/app/backend/data --name open-webui \<br>  --restart always -e WEBUI_AUTH=true \<br>  ghcr.io/open-webui/open-webui:main</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E1-3YQZN0hHy9XRvwPcJEg.png" /></figure><h4>Final words</h4><p>We all love cool tools, and AI is revolutionising the way we work. However, it’s crucial not to lose sight of what’s important: <strong>security and your data</strong>. Be very careful with what you share. If you have concerns, consider using an enterprise edition that provides isolation and ensures your data won’t be used to train future LLMs. If this option isn’t feasible for you, try running the chat models locally, as demonstrated in this example.</p><p><a href="https://digitalis.io/contact">Contact our team</a> for a free consultation to discuss how we can tailor our approach to your specific needs and challenges.</p><p><em>I, for one, welcome our new robot overlords</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f34097516100" width="1" height="1" alt=""><hr><p><a href="https://medium.com/digitalis-io-blog/the-risks-of-ai-to-your-data-f34097516100">The risks of AI to your data</a> was originally published in <a href="https://medium.com/digitalis-io-blog">Digitalis.io Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why and how we collect logs]]></title>
            <link>https://medium.com/digitalis-io-blog/why-and-how-we-collect-logs-8f54889100c0?source=rss----1634edd45521---4</link>
            <guid isPermaLink="false">https://medium.com/p/8f54889100c0</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[logging-and-monitoring]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Sergio Rua]]></dc:creator>
            <pubDate>Thu, 06 Mar 2025 09:47:31 GMT</pubDate>
            <atom:updated>2025-03-06T09:47:31.300Z</atom:updated>
            <content:encoded><![CDATA[<p>Crash dump collected</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HspV3uL40i5jLRkbC0aOqw.png" /><figcaption>https://axonops.com</figcaption></figure><h4>Why?</h4><p>We collect logs for a variety of reasons. While some organizations view log collection merely as a regulatory checkbox, others recognise the inherent value. These companies actively leverage log data to gain actionable insights, driving improvements in security, performance, and overall operational efficiency.</p><p>The utility of logs extends broadly, facilitating both reactive and proactive measures. Developers can efficiently debug application errors by scouring through logs, while security teams can preemptively detect and respond to security threats by analysing log patterns for suspicious behavior.</p><h4>How?</h4><p>Before addressing the methods for collecting you will need to consider a few questions:</p><ul><li>How much value do you assign to your logs</li><li>What retention do you want (30 days, 3 months, etc)</li><li>How sensitive are they? Can they leave your data centre?</li><li>Are you willing to put on the work to keep them in-house or would you consider a SaaS solution?</li></ul><p>Once you’ve answered these foundational questions, you can start exploring the “how.” Let’s break down some common and effective log collection methods.</p><p><strong>Cloud-Based Log Management: SaaS Solutions</strong></p><p>For organizations that prefer a hands-off approach, cloud-based log management services are a great option. These services handle log collection, storage, and analysis, allowing you to focus on your core business.</p><p>You deploy lightweight agents on your servers and applications. These agents then gather logs and forward them to a central log management system.</p><p><strong>Pros:</strong></p><ul><li><strong>Minimal overhead</strong>: No need to manage infrastructure.</li><li><strong>Scalability</strong>: Cloud providers can handle massive volumes of log data.</li><li><strong>Advanced analytics</strong>: Many cloud services offer powerful log analysis and visualization tools.</li></ul><p><strong>Cons:</strong></p><ul><li><strong>Cost</strong>: Cloud services can be expensive, especially for large volumes of log data.</li><li><strong>Data security</strong>: You’re entrusting your log data to a third-party provider. This is where your sensitivity question from above becomes very important.</li><li><strong>Compliance</strong>: Some compliance regulations require that data does not leave your datacenter.</li></ul><p><strong>On-premises log collection</strong></p><p>If you decide against a SaaS solution due to cost, security concerns or data locality, you can set up your own log collection platform. Options range from the traditional syslog server, commercial solutions like <a href="https://www.splunk.com/en_us/products/splunk-enterprise.html">Splunk</a> or free alternatives such as <a href="https://opensearch.org/">Opensearch</a>, <a href="https://elastic.co/">Elasticsearch</a> and <a href="https://grafana.com/oss/loki/">Grafana Loki</a>.</p><p>You first need to install and configure your chosen server. Then, you deploy lightweight agents on your servers and applications. These agents then gather logs and forward them to a central log management system. Tools like Fluentd, Logstash, Promtail or even the <a href="https://axonops.com/">AxonOps agent, if you’re working with Cassandra and Kafka</a>, fall into this category.</p><p><strong>Pros:</strong></p><ul><li><strong>Highly configurable</strong>: You can tailor the agents to collect specific logs and filter out noise.</li><li><strong>Real-time collection</strong>: Logs are typically sent as they’re generated, providing immediate visibility.</li><li><strong>Scalable</strong>: Well-designed agents can handle large volumes of log data.</li></ul><p><strong>Cons:</strong></p><ul><li><strong>Server management</strong>: Requires time and expertise to deploy and support the log collection server</li><li><strong>Agent management</strong>: Requires overhead for deployment, maintenance, and updates.</li><li><strong>Resource usage</strong>: Agents consume system resources, which can be a concern in resource-constrained environments.</li></ul><p><strong>Making the Right Choice</strong></p><p>The best log collection method depends on your specific needs and requirements. Consider your budget, technical expertise, and security requirements when making your decision. For example, in the financial sector, security and reliability are paramount. Choose a solution that provides the necessary level of protection and performance.</p><p><a href="https://digitalis.io/contact">Contact our team</a> for a free consultation to discuss how we can tailor our approach to your specific needs and challenges.</p><p><em>I, for one, welcome our new robot overlords”</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f54889100c0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/digitalis-io-blog/why-and-how-we-collect-logs-8f54889100c0">Why and how we collect logs</a> was originally published in <a href="https://medium.com/digitalis-io-blog">Digitalis.io Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scaling New Heights: Modernising Your Application with Kubernetes]]></title>
            <link>https://medium.com/digitalis-io-blog/scaling-new-heights-modernising-your-application-with-kubernetes-641a558048f5?source=rss----1634edd45521---4</link>
            <guid isPermaLink="false">https://medium.com/p/641a558048f5</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Sergio Rua]]></dc:creator>
            <pubDate>Thu, 27 Feb 2025 11:42:34 GMT</pubDate>
            <atom:updated>2025-02-27T11:42:34.393Z</atom:updated>
            <content:encoded><![CDATA[<p>One step at a time</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*PzUey-hIEFqQDTgDq41g1w.png" /></figure><h3>Introduction</h3><p>Remember when cloud computing felt like something only the big players could afford? Well, Kubernetes is going through that same transition right now. What was once the playground of tech giants is now accessible to companies of all sizes.</p><p>If you’re running applications that still rely on traditional deployment methods, you’re probably familiar with the headaches: inconsistent environments, deployment failures, and that dreaded 3 AM call when something breaks. Kubernetes might sound complex (and yes, it has its learning curves), but it’s becoming increasingly accessible as a solution to these everyday problems.</p><h3>What’s Kubernetes Anyway? (The Non-Technical Explanation)</h3><p>Let’s cut through the jargon. At its heart, Kubernetes is a system that helps you manage containerised applications. Think of containers as standardised packages for your software — they contain everything needed to run your application, regardless of where they’re deployed.</p><p>Kubernetes (or K8s as the cool kids call it) acts like an orchestra conductor, making sure all these containers work together smoothly. It handles things like:</p><ul><li>Starting up your application when needed</li><li>Making more copies when there’s high demand</li><li>Healing itself when things go wrong</li><li>Moving workloads around to use your resources efficiently</li></ul><p>Kubernetes automates these processes, freeing your team to focus on more strategic work rather than putting out fires.</p><h3>Consistency Across Environments</h3><p>Have you ever heard developers say, “But it works on my machine”? With containerization and Kubernetes, that phrase becomes extinct. Your application runs the same way in development, testing, and production environments.</p><h3>Resource Efficiency</h3><p>If your servers are running at 20% capacity because you’ve overprovisioned to handle peak loads, Kubernetes can help. It packs applications more efficiently onto your infrastructure, potentially reducing your cloud bill significantly.</p><h3>Faster Recovery from Failures</h3><p>When (not if) something goes wrong, Kubernetes can automatically restart failed components or redirect traffic away from troubled instances. This often happens before your monitoring system even has time to alert your team.</p><h3>Gradual Modernization</h3><p>A common misconception is that adopting Kubernetes means rewriting everything at once. The reality? You can start small, perhaps with just one application or service, and expand from there.</p><p>The only thing I would recommend you take on from day one is automation. For some small companies that manage just a few servers and are used to doing things manually, it may sound like it adds a lot of complexity but the initial headache pays off when you try to scale up.</p><p>If you are already using automation, see if your existing tools support Kubernetes. You do not want to add more complexity when you’re starting. Stick to what you know. For example, <a href="https://ansible.com/">Ansible</a> does a pretty good job of it. It has roles and collections for all the most common tasks such as <a href="https://docs.ansible.com/ansible/latest/collections/kubernetes/core/index.html">managing configurations</a>, <a href="https://helm.sh/docs/topics/charts/">helm charts</a>, etc.</p><p>For robust automation, <a href="https://terraform.io/">Terraform</a> stands out. With its Kubernetes, Helm, and numerous other providers, you can orchestrate your entire infrastructure as code. If you’re not already leveraging an automation tool, Terraform’s versatility and declarative approach make it a compelling choice for managing your Kubernetes deployments and beyond.</p><h3>Start with Managed Services</h3><p>Cloud providers offer managed Kubernetes services (like EKS from AWS, GKE from Google, or AKS from Microsoft) that handle much of the underlying complexity. These services take care of the cluster management heavy lifting while giving you the benefits. Shop around before you commit. There are plenty of small players with very competitive prices.</p><p>If you prefer to stay on-premises, be it due to budget constraints, stringent regulatory compliance, low latency requirements, or the need to maintain legacy systems, you could consider user-friendly alternatives such as <a href="https://www.rancher.com/">Rancher</a>.</p><h3>Identify a Suitable First Project</h3><p>Not every application should be your Kubernetes guinea pig. Look for something important enough to matter but not so critical that downtime would be catastrophic. New projects or applications already experiencing deployment issues are good candidates.</p><h3>Build Skills Incrementally</h3><p>Your team won’t become Kubernetes experts overnight, and that’s okay. Start with the basics — deploying simple applications and understanding core concepts. Complexity can come later as your comfort level increases.</p><p>Technical considerations aside, the human element often determines whether a Kubernetes initiative succeeds or fails. Change can be scary, especially for teams comfortable with existing processes.</p><p>Creating a culture that embraces experimentation and learning is crucial. Celebrate small wins, share knowledge openly, and expect some stumbles along the way. Remember that Kubernetes expertise is increasingly valuable in the job market — your team members may actually appreciate the opportunity to develop these skills.</p><h3>When Kubernetes Might Not Be the Answer</h3><p>It’s worth noting that Kubernetes isn’t always the right solution. If you’re running simple applications with predictable loads and minimal complexity, the overhead of Kubernetes might outweigh its benefits. Be honest about your actual needs rather than adopting technology for technology’s sake.</p><h3>Final words</h3><p>Whether you embrace Kubernetes now or later, containerisation is the future of application deployment. The consistency, portability, and automation it enables are too valuable to ignore in an increasingly competitive landscape.</p><p>We work with organisations of all sizes — from startups to enterprise-level companies — to adopt Kubernetes through a proven, step-by-step process:</p><ul><li><strong>Containerization</strong>: Converting traditional applications into container-ready workloads and establishing best practices for image management</li><li><strong>Kubernetes Migration</strong>: Planning and executing safe transitions from legacy infrastructure to Kubernetes orchestration</li><li><strong>Lifecycle Management</strong>: Implementing robust monitoring, scaling, and maintenance processes to ensure long-term success</li><li><strong>Automation and GitOps</strong>: Streamlining operations through CI/CD pipelines and infrastructure-as-code principles</li></ul><p>Ready to start your Kubernetes journey? <a href="https://digitalis.io/contact">Contact our team</a> for a free consultation to discuss how we can tailor our approach to your specific needs and challenges.</p><p><em>I, for one, welcome our new robot overlords”</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=641a558048f5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/digitalis-io-blog/scaling-new-heights-modernising-your-application-with-kubernetes-641a558048f5">Scaling New Heights: Modernising Your Application with Kubernetes</a> was originally published in <a href="https://medium.com/digitalis-io-blog">Digitalis.io Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to mount a Google bucket to a Kubernetes pod]]></title>
            <link>https://medium.com/digitalis-io-blog/how-to-mount-a-google-bucket-to-a-kubernetes-pod-4f022d6d28d6?source=rss----1634edd45521---4</link>
            <guid isPermaLink="false">https://medium.com/p/4f022d6d28d6</guid>
            <category><![CDATA[cost]]></category>
            <category><![CDATA[gke]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Sergio Rua]]></dc:creator>
            <pubDate>Fri, 15 Nov 2024 10:06:07 GMT</pubDate>
            <atom:updated>2024-11-15T10:06:07.752Z</atom:updated>
            <content:encoded><![CDATA[<p>And save a few dollars</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kDHK8H3A2-QZbTC0" /></figure><h3>Why?</h3><p>GCS offer quite a few benefits over traditional block storage. To highlight a few (thanks ChatGPT):</p><ul><li><strong>Scalability:</strong> GCS buckets are highly scalable, allowing you to store virtually unlimited amounts of data.</li><li><strong>Durability:</strong> GCS is designed for long-term storage and offers robust data durability with automatic replication and redundancy.</li><li><strong>Cost-Effective:</strong> GCS offers flexible pricing models, including tiered storage classes, making it cost-effective for various data storage needs.</li><li><strong>Security and Access Control:</strong> GCS provides strong security features, including encryption, access controls, and identity and access management (IAM).</li><li><strong>Versioning and Lifecycle Management:</strong> GCS provides built-in versioning and lifecycle management features, allowing you to manage data retention policies and recover previous versions of files.</li></ul><p>Common use cases for these buckets include storing application data, such as static HTML files and images for websites. Since the bucket can be mounted by multiple pods simultaneously, it also facilitates data sharing among them.</p><p>You cannot, however, use GCS buckets for applications requiring extremely low latency and high IOPS (Input/Output Operations Per Second), databases or any other application design for object storage.</p><h3>How?</h3><p>There are three parts to this section:</p><ul><li>enable the fuse plugin</li><li>create the bucket</li><li>mount the bucket.</li></ul><h4>Enable CSI Fuse</h4><p>Assuming you’ve done the smart thing and you built the GKE cluster using <a href="https://registry.terraform.io/modules/terraform-google-modules/kubernetes-engine/google/latest">this terraform module</a>, it should be as simple as adding the option</p><pre>gcs_fuse_csi_driver           = true</pre><h4>Create</h4><pre>locals {<br>  app_namespace = &quot;my-k8s-app-namespace&quot;<br>  app_sa        = &quot;my-cool-app-service-account&quot;<br>}<br><br>resource &quot;google_storage_bucket&quot; &quot;app&quot; {<br>  name                        = &quot;my-app-bucket-${var.project}&quot;<br>  location                    = &quot;EU&quot;<br>  uniform_bucket_level_access = true<br>}<br><br>resource &quot;google_storage_bucket_iam_binding&quot; &quot;bucket_access&quot; {<br>  bucket   = google_storage_bucket.app.name<br>  role     = &quot;roles/storage.admin&quot;<br>  members = [<br>    &quot;principal://iam.googleapis.com/projects/${google_storage_bucket.app.project_number}/locations/global/workloadIdentityPools/${google_storage_bucket.app.project}.svc.id.goog/subject/ns/${local.app_namespace}/sa/${local.app_sa}&quot;<br>  ]<br>}</pre><p>You’ll need to know in advance the namespace where you will be deploying the application and the name of the service account it’s going to use.</p><h4>Mount</h4><p>Finally, we just need a couple of tweaks to the application for it to work.</p><ul><li>Annotation</li></ul><pre>gke-gcsfuse/volumes: &quot;true&quot;</pre><p>Add the following annotation to the deployment or statefulset:</p><ul><li>Volume</li></ul><p>Add the volume confg like</p><pre>    - name: gcs-fuse-csi-ephemeral<br>      csi:<br>        driver: gcsfuse.csi.storage.gke.io<br>        readOnly: false<br>        volumeAttributes:<br>          bucketName: my-app-bucket-PROJECT<br>          mountOptions: &quot;implicit-dirs&quot;<br>          gcsfuseLoggingSeverity: warning</pre><ul><li>Mount the volume to the pods</li></ul><pre>volumeMounts:<br>  - name: gcs-fuse-csi-ephemeral<br>    mountPath: /data<br>    readOnly: false</pre><p>Full Example</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  creationTimestamp: null<br>  labels:<br>    app: website<br>  name: website<br>spec:<br>  replicas: 1<br>  selector:<br>    matchLabels:<br>      app: website<br>  strategy: {}<br>  template:<br>    metadata:<br>      annotations:<br>        gke-gcsfuse/volumes: &quot;true&quot;<br>      labels:<br>        app: website<br>    spec:<br>      containers:<br>      - image: ubuntu:24.04<br>        name: ubuntu<br>        command: [&quot;sleep&quot;, &quot;infinity&quot;]<br>        resources: {}<br>        volumeMounts:<br>          - name: gcs-fuse-csi-ephemeral<br>            mountPath: /data<br>            readOnly: false<br>      - name: gcs-fuse-csi-ephemeral<br>        csi:<br>          driver: gcsfuse.csi.storage.gke.io<br>          readOnly: false<br>          volumeAttributes:<br>            bucketName: my-app-bucket-PROJECT<br>            mountOptions: &quot;implicit-dirs&quot;<br>            gcsfuseLoggingSeverity: warning</pre><h3>Conclusion</h3><p>If you want to know more, have a look at the Google Docs:</p><p><a href="https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/cloud-storage-fuse-csi-driver">Access Cloud Storage buckets with the Cloud Storage FUSE CSI driver | Google Kubernetes Engine (GKE) | Google Cloud</a></p><p>And if you can’t read, <a href="https://digitalis.io/contact-us/">get in touch</a>, and we’ll read it for you. 😄</p><p>I hope you enjoy it. Stay safe.</p><p><em>I for one welcome our robot overlords</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f022d6d28d6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/digitalis-io-blog/how-to-mount-a-google-bucket-to-a-kubernetes-pod-4f022d6d28d6">How to mount a Google bucket to a Kubernetes pod</a> was originally published in <a href="https://medium.com/digitalis-io-blog">Digitalis.io Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Podman User Namespace Mapping Basics and How podman unshare Can Help]]></title>
            <link>https://medium.com/digitalis-io-blog/podman-user-namespace-mapping-basics-and-how-podman-unshare-can-help-edca9ebfa9c5?source=rss----1634edd45521---4</link>
            <guid isPermaLink="false">https://medium.com/p/edca9ebfa9c5</guid>
            <category><![CDATA[podman]]></category>
            <dc:creator><![CDATA[Karl Sorensen]]></dc:creator>
            <pubDate>Tue, 29 Oct 2024 09:10:47 GMT</pubDate>
            <atom:updated>2024-10-29T09:10:47.893Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I’ve been using rootless Podman instead of Docker, and for the most part, it’s been a drop-in replacement.</p><p>However, I have encountered some situations when using volume mounts where non-root users within the container write files that end up on the host with permissions I can’t access as my standard user!</p><p>I’ve generally been using sudo commands on the host to work on these files but there is a better way, <strong>podman unshare</strong></p><p>Let me show you an example. On the host, I start up a simple container with a volume mount:</p><pre>podman run -it --rm -v /tmp/mnttest:/mnt/foo debian:bookworm</pre><p>Once inside the container:</p><ol><li>Create a new user,</li><li>Grant write permissions to the mount,</li><li>Write a file as the new user, and</li><li>Restrict ownership of the file to that user.</li></ol><pre>useradd -m testuser<br>chmod 777 /mnt/foo<br>su testuser -c &quot;touch /mnt/foo/testfile1.txt&quot;<br>chmod 600 /mnt/foo/testfile1.txt<br>ls -l /mnt/foo/<br>total 0<br>-rw------- 1 testuser testuser 0 Oct 28 12:16 testfile1.txt</pre><p>If I quit out of the container and look at the file that was created from my host user</p><pre>ls -l /tmp/mnttest/<br>total 0<br>-rw------- 1 166535 166535 0 Oct 28 12:16 testfile1.txt</pre><p>I can see that it is owned by user id 166535 and if I try and view the file it won’t let me!</p><pre>cat /tmp/mnttest/testfile1.txt <br>cat: /tmp/mnttest/testfile1.txt: Permission denied</pre><h4>So what is going on here?</h4><p>By default, Podman maps the root user inside the container with the user ID (UID) 0 to the UID of the current user on the host system.</p><p>This means that if you create a file as the root user within the container it will be created with your permissions however when you switch to another user in the container Podman performs a user and group mapping within the namespace.</p><p>You can see how the mapping is configured in the host’s /etc/subuid and /etc/subgid files.</p><p>The file contains a list of local system users:</p><pre>...<br>localUser:165535:65536<br>...</pre><p>The format shows that the user localUser has access to 65,536 UID mappings, starting from the host’s UID 165536.</p><p>So, if testuser within the container has a User ID of 1000, the corresponding file on the host will have a User ID of 166535, as we see above.</p><p>There is a <a href="https://www.redhat.com/en/blog/rootless-podman-user-namespace-modes">good description of how the mapping works here</a> if you want do dive further into the different mapping options</p><h4><strong>Privileged Operations Without Root</strong></h4><p>Fortunately, Podman provides a simple way to access these files on the host without requiring root privileges: the podman unshare command.</p><p>The podman unshare command allows you to <strong>enter the user namespace</strong> of a rootless container. In this environment, even regular users can perform actions that would typically require root access, like creating files with root ownership or modifying permissions, because <strong>inside the namespace, they are treated as root</strong>.</p><h4>Syntax and Basic Usage</h4><ul><li>If no command is specified, podman unshare will open an interactive shell session within the container’s namespace.</li><li>If a command is provided, it will execute the command directly within the namespace and return to the host environment.</li></ul><p><strong>Interactive Shell Session:</strong></p><pre>localUser@myhost ~ $podman unshare<br>root@myhost ~ $<br>root@myhost ~ $ls -l /tmp/mnttest/<br>total 0<br>-rw------- 1 1000 1000 0 Oct 28 12:16 testfile1.txt</pre><p>Note that after you enter the shell, the prompt changes from localUser to root, and the permissions for the file now reflect the User ID mapped from your container user.</p><p>As we are not in the container itself however it doesn’t know what the user details are which is why it shows up as the user id rather than the user name</p><p><strong>Provided command:</strong></p><pre>podman unshare rm /tmp/mnttest/testfile1.txt</pre><p>Hopefully, this article has shown you how to use the podman unshare tool to better manage your Podman environments and provided insight into how Podman handles user and group mapping on the host system.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=edca9ebfa9c5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/digitalis-io-blog/podman-user-namespace-mapping-basics-and-how-podman-unshare-can-help-edca9ebfa9c5">Podman User Namespace Mapping Basics and How podman unshare Can Help</a> was originally published in <a href="https://medium.com/digitalis-io-blog">Digitalis.io Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>