<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Petr Moravek on Medium]]></title>
        <description><![CDATA[Stories by Petr Moravek on Medium]]></description>
        <link>https://medium.com/@petr1moravek?source=rss-d495852f580a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*xinrijHVJSYszCVdu6_SMw@2x.jpeg</url>
            <title>Stories by Petr Moravek on Medium</title>
            <link>https://medium.com/@petr1moravek?source=rss-d495852f580a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 06:38:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@petr1moravek/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Podman playground VM]]></title>
            <link>https://medium.com/@petr1moravek/podman-playground-vm-708f80b2e252?source=rss-d495852f580a------2</link>
            <guid isPermaLink="false">https://medium.com/p/708f80b2e252</guid>
            <category><![CDATA[libvirt]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[vagrant]]></category>
            <category><![CDATA[buildah]]></category>
            <category><![CDATA[podman]]></category>
            <dc:creator><![CDATA[Petr Moravek]]></dc:creator>
            <pubDate>Sun, 01 Sep 2019 09:25:05 GMT</pubDate>
            <atom:updated>2019-09-01T11:09:23.683Z</atom:updated>
            <content:encoded><![CDATA[<p>To take some summer inspiration, I have decided to check the podman family on my <strong>Ubuntu 16.04</strong> machine. Moreover, it was not that easy as it first looked.</p><h3>Fail fast</h3><p>The podman family (the other siblings are buildah and skopeo) has its repo and install guide at <a href="https://github.com/containers/libpod/blob/master/install.md">https://github.com/containers/libpod/blob/master/install.md</a>. However, trying that on my ageing <strong>Ubuntu 16.04</strong> distro was nothing you might like to exercise. In a few words, an attempt to install the packages led to the failure of other packages. The ultimate final step was to remove all that which fortunately fixed the world.</p><p>Yes, my computer is my <strong>pet</strong>, and I wanna maintain that state.</p><p>Yes, I do want to make distro update :-).</p><h3>Second thought</h3><p>Ok, back to point zero. What is the next option?</p><ul><li>All right, the containers do not pose many requirements of the layers below</li><li>Decently up to date Linux kernel is OK</li></ul><p>So what about a virtual machine? I want to have it portable and eventually hosted. Then some standard <strong>stock VM image</strong>. A <strong>cloud image</strong> of some distro. Well, to reduce the number of possible distros the is simple guidance: take what it creators use. The company behind is the Red Hat. There are at the moment few options <strong>RHEL7</strong>, <strong>RHEL8</strong> those require at least developer license. Eventually, I could turn to <strong>Centos7</strong> or <strong>Fedora</strong> line. There is a clear trade-off with the <strong>Centos7</strong> is close to end-of-life besides that its future is unclear. Considering all that, the only option that remains is <strong>Fedora</strong> and at the time of writing its release 30.</p><p>So I have the cloud image <a href="https://alt.fedoraproject.org/cloud/">https://alt.fedoraproject.org/cloud/</a>.</p><p>The adjective <strong>cloud</strong> suggests that it should run pretty well in any VM fabric. Further, it even has the <strong>Amazon AMI</strong> ready. However, let me start small then grow. The initial exercise would be my elderly <strong>Ubuntu 16.04</strong>. To expedite the bootstrap, I wanted to use the <strong>Vagrantfile</strong> based. The Vagrantfile brings the great all in one and infrastructure as a code to your desktop.</p><p><strong>Nothing is perfect :-(</strong> Vagrant is powered by ruby, but the <strong>Ubuntu 16.04</strong> does not have the decent version by default. To release me from the circular dependencies (RVM also considered), I did the same already couple times. Run the tricky part in the separation and separation in its tinnies and robust forms means container. That brought me to the point of having vagrant running in a container. <strong>Docker container</strong> if you are asking.</p><p><strong>Wait!</strong> The container is meant to prevent from accessing the hardware. Yes, you are right! However, as I want to use the <strong>libvirt/KVM</strong> provider, there is a way of doing it. The libvirt daemon communicates with the client via socket (or even ssh pipe). That socket can be mapped into the container!</p><p>So now I have all the ingredients ready:</p><ul><li>Vagrant in docker (with vagrant-libvirt plugin)</li><li>Cloud image of Fedora 30</li><li>libvirt working on the host with Intel VT-X</li></ul><p>Let me connect those by the Vagrantfile.</p><p>I have put those ingredients to the repo at Github <a href="https://github.com/PexMor/fedora-container-in-vm">https://github.com/PexMor/fedora-container-in-vm</a>.</p><p>All the rest are just two simple commands: vagrant up and vagrant ssh and there you are, command line with podman, buildah and skopeo at your service.</p><h3>Ubuntu side note</h3><p>IaaS in a box (Ubuntu), running VM in the course of minutes. My past great experience with uvtools and uvt-simplestreams-libvirt.</p><pre>sudo apt -y install uvtool<br>uvt-simplestreams-libvirt sync release=bionic arch=amd64<br>uvt-kvm create secondtest release=bionic<br>uvt-kvm ssh secondtest --insecure</pre><p><em>Originally published at </em><a href="https://blog.xlinux.cz/post/2019/09/01/podman-playground-vm/"><em>https://blog.xlinux.cz</em></a><em> on September 1, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=708f80b2e252" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ansible no.4: Operator SDK]]></title>
            <link>https://medium.com/prgcont/pexmor-blog-af3c3b510ff7?source=rss-d495852f580a------2</link>
            <guid isPermaLink="false">https://medium.com/p/af3c3b510ff7</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[operators]]></category>
            <dc:creator><![CDATA[Petr Moravek]]></dc:creator>
            <pubDate>Wed, 17 Apr 2019 08:25:05 GMT</pubDate>
            <atom:updated>2019-04-18T08:08:37.999Z</atom:updated>
            <content:encoded><![CDATA[<p>The recent meetup held at MSD on Monday 2019/04/15 brought elementary insight into the ansible as an operator and in particular ansible <a href="https://docs.ansible.com/ansible/latest/modules/k8s_module.html">K8s</a> module.</p><p>The story has begun with reference requirement to deploy <a href="https://nextcloud.com/install/">NextCloud</a> which is a rebirth of NAS software for Linux.</p><p>The first step was apply Ansible role <a href="https://github.com/rbicker/ansible-nextcloud">nextcloud</a> to an existing server. The server could be acquired in the cloud at AWS, DigitalOcean or at own premises via virsh, Vagrant/virsh, MaaS, Openstack whichever applies to your setup.</p><blockquote><strong><em>Big Fat Warning:</em></strong><em> Software downloaded from internet might contain bugs, features, malware, ransomware and other </em>goodies<em> of today. Do not trust anything you download without own check, scans or review. Please take care of your safety and security!</em></blockquote><p>And as we are K-native aka geeks willing to take any cloud as long as it is based on Kubernetes then the straight next step was let us do it via operator and on K8s.</p><p>The original option has quite a few potential flaws like:</p><ul><li>no backup</li><li>no scaling</li><li>no upgrade path</li><li>no rollback</li><li>no layers</li></ul><p>Those concerns should be pretty much handled by any orchestration, automation and monitoring. So we are container-minded thus we follow that path.</p><p>For all necessary steps please have look at <a href="https://github.com/prgcont/workshop-k8s/blob/master/07_ansible_operator/README.org">README</a> in the meetup folder.</p><p>The principle is pretty simple. We use CRDs to extend the K8s which in turn gets processed (consumed) by the ansible operator. This operator takes the CRD yaml and makes an ansible value tree out of it. These values are passed into the <strong>ansible playbook</strong>. The playbook utilizes ansible templates to make K8s definitions of required resources (deployment, service and ingress). These resources are fed back to the K8s to setup and run necessary containers and respective routing.</p><p>That is in short all the <strong>magic</strong>. During the session the original and simple <strong>NextCloud</strong> was scalled little bit up by adding <strong>MySQL</strong> option instead of <strong>SQLite</strong>.</p><blockquote><em>Note: for the simplicity the </em><strong><em>Persistent Volume Claims</em></strong><em> and </em><strong><em>Persistent Volumes</em></strong><em> for the actual </em><strong><em>NextCloud</em></strong><em> storage were completely omitted.</em></blockquote><p>Jakub has also mentioned that he was thinking of intermediate step which should have done the start of bare OS container and installing <strong>NextCloud</strong> using the original ansible role. Unfortunately the use of <strong>ssh</strong> into k8s was not viable.</p><blockquote>Could it be even done, could other mean of attaching to container used like<em> </em><strong><em>exec</em></strong><em>?</em></blockquote><p>And the last thing to mention during the workshop also topic of re-using the existing playbooks surfaced (which Jakub has tried to unsuccessfully exploit).</p><p>There was also a short note on <strong>immutable infrastructure</strong> vs. <strong>flexible deployments</strong>. The issue of immutable infrastructure is that every change requires new <strong>snapshot</strong> of the installed software and there is a little room for modifications and/or <strong>debugging</strong>. While <strong>flexible deployment</strong> taken to the extreme means that you start with bare OS image and configure and setup everything upon every start of the container. The second approach sounds like VMish way and also could remarkably slowdown the bootstrap of running app (time to use/login). Therefore each and everybody be warned, there is no Holly Grail and as many consultants say <strong>It depends</strong> ( <strong>before issuing invoice for consulting services</strong>).</p><p>Some past K8s operator related talks or workshops:</p><ul><li><a href="https://github.com/prgcont/workshop-k8s/tree/master/06_operator_sdk">06_operator_sdk</a> - the into (golang)</li><li><a href="https://github.com/prgcont/workshop-k8s/tree/master/07_ansible_operator">07_ansible_operator</a> - this talk in code</li><li><a href="https://github.com/prgcont/pycont-demo">pycont-demo</a> - Python way</li></ul><p><em>Originally published at </em><a href="https://blog.xlinux.cz/post/2019/04/17/ansible-no.4-operator-sdk/"><em>https://blog.xlinux.cz</em></a><em> on April 17, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af3c3b510ff7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/prgcont/pexmor-blog-af3c3b510ff7">Ansible no.4: Operator SDK</a> was originally published in <a href="https://medium.com/prgcont">Prague Containers Meetup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ansible no.3: ansible-bender]]></title>
            <link>https://medium.com/prgcont/ansible-no-3-ansible-bender-fff68851689a?source=rss-d495852f580a------2</link>
            <guid isPermaLink="false">https://medium.com/p/fff68851689a</guid>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[buildah]]></category>
            <category><![CDATA[podman]]></category>
            <category><![CDATA[meetup]]></category>
            <category><![CDATA[containers]]></category>
            <dc:creator><![CDATA[Petr Moravek]]></dc:creator>
            <pubDate>Thu, 21 Mar 2019 00:00:00 GMT</pubDate>
            <atom:updated>2019-03-25T08:24:30.554Z</atom:updated>
            <content:encoded><![CDATA[<p>[2019/03/21] This time we have come together to talk about containers or their images managed by <strong>ansible</strong>. We have spoken about <strong>buildah</strong> and <strong>podman</strong> in concert with above mentioned system management tool.</p><h3>Initial rehearsal</h3><p>Actually before you begin you are expected to be familiar with some buzz-words. Let us try to associate their meaning with the context throughout the session.</p><h3>Ansible</h3><p>Our old friend thus not need for further details <a href="https://www.ansible.com/">https://www.ansible.com/</a> and <a href="https://github.com/ansible/ansible">https://github.com/ansible/ansible</a>.</p><h3>Podman</h3><blockquote><strong><em>Podman</em></strong><em> is a fully-featured container engine. It provides a Docker-compatible command line to ease the transition from other container engines. Most Podman commands can be run as a regular user, without requiring additional privileges. Furthermore, all of this is accomplished </em><strong><em>without a daemon</em></strong><em>!</em></blockquote><blockquote><em>— Podman 1.0 release</em></blockquote><p>Well it is worth to say that podman is written in <strong>golang</strong> the magic ingredient of today’s fancy and successful projects. It comes from Red Hat and but is has been released into public domain (Apache-2.0 license, Github: <a href="https://github.com/containers/libpod/blob/master/docs/tutorials/podman_tutorial.md">tutorial/install</a>).</p><blockquote>Our original goal with Podman was to provide a fully-featured debugging experience for CRI-O, but it has become so much more.</blockquote><p><strong>Note-podman:</strong> Ubuntu users ~ at 16.04LTS you are out of luck :-( Debian, Ubuntu 18.04? Fedora/RHEL family welcome. <em>Do you really want me to build from source and enjoy the hell of dependencies?</em></p><h3>Buildah</h3><p><strong>Buildah</strong> is an efficient way to create OCI images. It has a home at Github (Github:<a href="https://github.com/containers/buildah">Containers/buildah</a>). This is the second piece of puzzle. It is again made with golang. Again born in Red Hat (<a href="https://www.redhat.com/en/blog/daemon-haunted-container-world-no-longer-introducing-buildah-10">A daemon-haunted (container) world no longer: …</a>).</p><p>Those two pieces has established a new wave of container management tools that are trying to get rid of old mistakes and undesired vulnerabilities. With all that in mind we can say: “The <strong>$king</strong> is dead, long live the <strong>$king</strong>!” Where let the variables be: Docker and Podman+Buildah (at this moment ;-)).</p><p><strong>Note-buildah:</strong> Even Ubuntu 16.04 (Xenial) can build images. But cannot run containers as it lacks CRI-O by default. But can make it by PPA :-)</p><pre>sudo add-apt-repository ppa:projectatomic/ppa sudo apt-get update</pre><h3>The session</h3><p><strong>Dockerfile is wrong ! However…</strong></p><p>(brought by <a href="https://github.com/TomasTomecek">Tomáš Tomeček</a>)</p><p>(<a href="https://tomastomecek.github.io/speaks/2019-prgcont-ansible-bender/">slides</a> / their <a href="https://github.com/TomasTomecek/speaks/tree/master/2019-prgcont-ansible-bender">source</a>)</p><h4>Buildah</h4><ul><li>Dockerfile reborn (buildah bud . saves your life)</li><li>From scratch (of course be minimalist)</li><li>Bash copy (container image mounted)</li></ul><p>then marry it with <strong>ansible</strong> though ~ <strong>ansible_bender</strong></p><ul><li>interface between ansible and buildah (stdin/out/err) it is <strong>just</strong> another -c buildah like ssh or local</li><li>you decide which layers are cached (up to apt upgrade or install ~ slow parts fast)</li><li>turn ansible playbook from <strong>SSH+VM</strong> to <strong>buildah-inside-container</strong> (without modifying the playbook!!!)</li><li>Docker take on the same topic: docker build -&gt; Buildkit (after few years of stagnation)</li></ul><p><strong>plans</strong> ~ future is bright</p><p>kNative ~ k8s integration (build part by ansible-bender)</p><h4>Hands-on warm-up</h4><p>Let’s start in shell</p><pre>export BASE_IMAGE=fedora:29</pre><pre>export CONT_NAME=prgcont</pre><p>buildah unshare ‘…’ for unprivileged user — still buggy, so become root for now…</p><pre>buildah pull $BASE_IMAGE</pre><pre>buildah from --name $CONT_NAME $BASE_IMAGE</pre><pre>printf &quot;$CONT_NAME \<br>  ansible_connection=buildah \<br>  ansible_python_interpreter=/usr/bin/python3&quot; &gt;inventory-container</pre><pre>ansible-playbook -i inventory-container -c buildah ./recipe.yaml </pre><pre>buildah commit --cmd &#39;/entrypoint.sh&#39; $CONT_NAME my-fancy-image </pre><pre>buildah rm $(CONT_NAME)</pre><p>push it among local docker images:</p><pre>buildah push prgcont docker-daemon:prgcont:some-name</pre><h4>Hands on second part</h4><p><a href="https://github.com/prgcont/workshop-ansible-containers">Sources</a></p><p>We’ll do two common use cases in this workshop:</p><ol><li>Containerizing a test suite. (done)</li><li>Running a web app in a container. (done)</li></ol><pre>ansible-bender push docker-daemon:hugo:latest</pre><p><strong>Tip:</strong> use <strong>sen</strong> (Github:<a href="https://github.com/TomasTomecek/sen">TomasTomecek/sen</a>) — a terminal UI for docker</p><h3>QA Part</h3><p><strong>Question:</strong> How does the ansible interface with the buildah?</p><p><strong>Answer:</strong> stdin/out/err, but the cousin project <strong>podman</strong> uses structured API called varlink (<a href="https://varlink.org/FAQ">see FAQ of varlink</a>).</p><h3>One more thing</h3><ul><li><a href="https://quarkus.io/">Quarkus</a> — Red Hat’s take on Java Fast™</li><li><a href="https://www.drools.org/">Drools</a> (BPML) — slow java -&gt; graalvm (AOT) made fast (from Red Hat blog <a href="https://developers.redhat.com/blog/2019/03/14/quarking-drools-how-we-turned-a-13-year-old-java-project-into-a-first-class-serverless-component/">Quarking Drools…</a>)</li><li><a href="https://www.optaplanner.org/">OptaPlanner</a> — a path optimizer (path for your VMs towards right hypervisor)</li></ul><h3>Off-topic</h3><p><strong>Question:</strong> How to replace legacy of <strong>Mirantis Openstack</strong> with something fresh?</p><p><strong>Answer:</strong> Well there is a couple of other projects doing the same thing (deploy and manage Openstack). The well known are <strong>TripleO</strong> and its commercial cousin <strong>Redhat Director</strong> but what about to consider shrinking the problem into <strong>just</strong> making the <strong>VM</strong> behave like a <strong>container</strong>? Then it is worth to check the idea behind Container Native Virtualization (aka CNV see <a href="https://www.redhat.com/files/summit/session-assets/2018/Introducing-Container-native-Virtualization.pdf">as preseneted on Red Hat Summit — May 2018</a>).</p><p><em>Originally published at </em><a href="https://blog.xlinux.cz/post/2019/03/21/ansible-no.3-ansible-bender/"><em>blog.xlinux.cz</em></a><em> on March 21, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fff68851689a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/prgcont/ansible-no-3-ansible-bender-fff68851689a">Ansible no.3: ansible-bender</a> was originally published in <a href="https://medium.com/prgcont">Prague Containers Meetup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>