<?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 Riaan Nolan on Medium]]></title>
        <description><![CDATA[Stories by Riaan Nolan on Medium]]></description>
        <link>https://medium.com/@riaan.nolan?source=rss-6787fe1d57a5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*x7unm2VKdMYrZWPvX1q38A.jpeg</url>
            <title>Stories by Riaan Nolan on Medium</title>
            <link>https://medium.com/@riaan.nolan?source=rss-6787fe1d57a5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 20:52:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@riaan.nolan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Kubernetes Dev Container]]></title>
            <link>https://medium.com/@riaan.nolan/kubernetes-dev-container-88a777edc4b7?source=rss-6787fe1d57a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/88a777edc4b7</guid>
            <category><![CDATA[devcontainer]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[github-codespaces]]></category>
            <category><![CDATA[containerization]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Riaan Nolan]]></dc:creator>
            <pubDate>Thu, 06 Mar 2025 05:32:59 GMT</pubDate>
            <atom:updated>2025-03-06T20:55:40.294Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wpK8K5xHhvfszDTu.png" /><figcaption>Kubernetes in a Dev Container</figcaption></figure><p>Hi friends, today I’d like to share with you a Kubernetes Dev Container that I’ve been working on. <a href="https://github.com/star3am/k3s-devcontainer">https://github.com/star3am/k3s-devcontainer</a></p><p>So firstly, what is a Dev Container? Well, simply put, it’s your environment en dependencies that lives together with your code. One example could be, you have a Python project. Inside of this project you have a .devcontainer folder, and inside that a devcontainer,json file. This coupled together with docker-compose.yml and a Dockerfile installs all the dependencies you need, things like a particular Python version, a Virtual Environment and Python pip packages.</p><p>Another example is an Infra code repository, where, when you open this repository, you already have the appropriate Terraform version installed, and all the Cloud CLIs. There is no need to install anything locally on your laptop.</p><p>Kubernetes is no different, you can have a Dev Container running Kubernetes, with Helm, Kubectl and all the tools you need already installed.</p><p>Here’s a video you can watch and follow along.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F3ya9w2m6CLo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D3ya9w2m6CLo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F3ya9w2m6CLo%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/fac88c6d8ca6efc47ca5bc9eccb91834/href">https://medium.com/media/fac88c6d8ca6efc47ca5bc9eccb91834/href</a></iframe><p>So right off the bat, there are a few things to keep in mind,</p><ul><li>Architectures (Amd64 or Arm64)</li><li>Ease of use to get this going</li><li>Operating Systems (Basically Windows, Mac or Linux)</li><li>Different use cases (A Dev Container to develop in, but also using the same Docker Image as your Build runner)</li></ul><p>There are two ways to get started, basically, do you want to run this locally using VSCode or remotely using something like Github’s Codespaces?</p><p>Let’s explore these two options.</p><h3>Getting Started</h3><p>This project can be run Locally using a Dev Container in VSCode or in a Dev Container on Github Codespaces</p><h3>Running K3s On the Internet in Github Codespaces</h3><p>Create or login to your Github.com account</p><ul><li>Fork this repository <a href="https://github.com/star3am/k3s-devcontainer">https://github.com/star3am/k3s-devcontainer</a></li><li>Click on Code -&gt; Codespaces -&gt; Create Codespace on main</li></ul><p><em>K3s Dev Container Github Project </em><a href="https://github.com/star3am/k3s-devcontainer"><em>https://github.com/star3am/k3s-devcontainer</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Q4JnEPNizC_4foIi.png" /><figcaption>The K3s Dev Container Github repository</figcaption></figure><p><em>K3s Dev Container Github Project Create new Codespace </em><a href="https://codespaces.new/star3am/k3s-devcontainer?quickstart=1"><em>https://codespaces.new/star3am/k3s-devcontainer?quickstart=1</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5jxO94fewV5JXO9H.png" /><figcaption>Click create new Codespace on main branch</figcaption></figure><p><em>K3s Dev Container in Github Codespaces are now busy opening, pulling down the Docker image layers</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CZp48M7MrruEldmw.png" /><figcaption>Dev Container is starting. Pulling the layers of the Docker image</figcaption></figure><p><em>K3s Dev Container in Github Codespace has now launched and a helpful menu will be displayed with commands that you can copy and paste</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EYMr0LO01YeycGes.png" /><figcaption>A Helpful menu in the Dev Container</figcaption></figure><p><em>First we will install a Docker daemon inside of this Dev Container</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yurVgeAA9HxrCo2-.png" /><figcaption>Install Docker in the Dev Container</figcaption></figure><p><em>The Docker daemon has now been installed and you can now run docker commands like, docker ps or docker info</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ybPG-mzczocffrYn.png" /><figcaption>Docker has been successfully installed in the Dev Container</figcaption></figure><p><em>Docker info will show you some information on your system for example the Cgroups version 2 and that Cgroups driver which will be systemd</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qNdYqNFDFRrc6QqV.png" /><figcaption>Docker info command in the Dev Container</figcaption></figure><p><em>Now we can proceed to install K3s in the Dev Container</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-4b1yN0mPmWtaoRe.png" /><figcaption>Install K3s in the Dev Container</figcaption></figure><p><em>K3s has now been installed, along with the Kubernetes Dashboard. A token will be printed that you can use to login to the Kubernetes dashboard</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gHU4Jv3KFEW2lAVI.png" /><figcaption>K3s has been successfully installed and the Kubernetes dashboard login token is displayed</figcaption></figure><p><em>When you click on the Ports tab, you will see the ports available, 8001 is the Kubernetes dashboard and 8002 is the Helm dashboard</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3WlABZOK1Z0qP98o.png" /><figcaption>The ports tab in the Github Codespaces window</figcaption></figure><p><em>Copy the token and login to the Kubernetes dashboard</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kBGeKcVKV4d6LiEN.png" /><figcaption>Login to the Kubernetes dashboard using the token</figcaption></figure><p><em>Now select “All Namespaces” in the top left corner to display an overview of your Kubernetes cluster using the Kubernetes dashboard</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nBlt_bGuD6kAwu2H.png" /><figcaption>View all namespaces in the Kubernetes dashboard</figcaption></figure><p><em>You will now see all the resources created in your Kubernetes cluster being displayed on your Kubernetes dashboard</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tjXD1IVsJqjsNFPt.png" /><figcaption>The Kubernetes dashboard</figcaption></figure><p><em>You can also access the Helm dashboard on port 8002 and this will display all the Applications installed with Helm, additionally you can install other applications when you click on the repository tab</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L7M0kPP0zZl4Z1qK.png" /><figcaption>The Hrelm dashboard</figcaption></figure><h3>Running K3s Locally in a Dev Container using Visual Studio Code</h3><p>Install the following dependencies</p><ul><li>Docker or Docker Desktop <a href="https://www.docker.com/products/docker-desktop/">https://www.docker.com/products/docker-desktop/</a></li><li>Windows Only should create a .wslconfig see WSL Config below</li><li>Visual Studio Code <a href="https://code.visualstudio.com/download">https://code.visualstudio.com/download</a> (with Remote development in Containers extension) <a href="https://code.visualstudio.com/docs/remote/containers-tutorial">https://code.visualstudio.com/docs/remote/containers-tutorial</a></li><li>Clone this repository</li><li>Now Open VSCode and Open this repository (See screenshot below)</li></ul><p><em>Download and install Docker desktop</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GpA5O-uxXZCEPVdD.png" /><figcaption>Docker Website, download and install</figcaption></figure><p><em>Download and install Visual Studio Code</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k3NWeQIFjQoKmhZ-.png" /><figcaption>Download and install VSCode</figcaption></figure><p><em>Download and install Visual Studio Code Dev Containers extension</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GFwlO2zdHlccdTOQ.png" /><figcaption>Download and install VSCode Dev Containers extension</figcaption></figure><p><em>When you open the project in VScode, and pop-up will be displayed in the bottom-right corner prompting you to re-open the project inside a Dev Container</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ht-9LDS9CP8-_OPQ.png" /><figcaption>Re-Open this project in a Dev Container</figcaption></figure><p><em>Once the Dev Container is started a helpful menu will be printed with some commands that you can copy and paste to get you started</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DHwu_L_hgnqh1wiU.png" /><figcaption>Dev Container Menu with helpful commands</figcaption></figure><p><em>Install Docker inside the Dev Container</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*V_0qPQdica5qVSvY.png" /><figcaption>Install Docker inside the Dev Container</figcaption></figure><p><em>Docker has now been successfully installed inside the Dev Container</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IKxQwFITGRveeUdM.png" /><figcaption>Docker has been successfully installed</figcaption></figure><p><em>You can now use some Docker commands like docker ps and docker info</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JdCTkx4kcv_TmWdn.png" /><figcaption>Docker info</figcaption></figure><p><em>Now we can install K3s in the Dev Container</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zNDfaZlPQ5mlSpry.png" /><figcaption>Install K3s inside the Dev Container</figcaption></figure><p><em>K3s has now successfully installed a the Kubernetes dashboard login token will be displayed</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uKggtr3X9BQRHdoa.png" /><figcaption>K3s has been successfully installed and the Kubernetes dashboard login token will be displayed</figcaption></figure><p><em>The ports tab in the Dev Container. Port 8001 is the Kubernetes dashboard and 8002 is the Helm Dashboard</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*30mu5sU6WLYwLROF.png" /><figcaption>The ports tab in the Dev Container</figcaption></figure><p><em>Using the login token you can now login to the Kubernetes dashboard</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oLtOMxFAmxWS_Qwx.png" /><figcaption>Login to the Kubernetes dashboard</figcaption></figure><p><em>Select “All Namespaces” in the top-left corner of the Kubernetes dashboard to display all cluster resources</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RIrFb4MxEUSZwlHX.png" /><figcaption>All Namespaces</figcaption></figure><p><em>The Kubernetes dashboard will now show you all resources created in your Kubernetes cluster in all namespaces</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PhyZ8k88dQQRb8Mv.png" /><figcaption>Kubernetes dashboard</figcaption></figure><p><em>The Helm dashboard will show you all applications currently installed using Helm</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ylT8YHgfAhSGA8gH.png" /><figcaption>The Helm dashboard</figcaption></figure><h3>WSL Config (Windows only)</h3><p>In order to get Systemd running on Windows, you would need to se a Windows Subsystem for Linux WSL Config file called .wslconfig</p><p>Place the .wslconfig file inside your Windows user home directory, typically, C:\Users\YOUR_USER\.wslconfig Restart WSL with wsl --shutdown and start WSL again with wsl in an Administrator Powershell terminal.</p><pre># After updating this file run wsl --update<br># Settings apply across all Linux distros running on WSL 2<br>[wsl2]<br><br># Limits VM memory to use no more than 8 GB, this can be set as whole numbers using GB or MB<br>memory=8GB<br><br># Sets the VM to use 8 virtual processors<br>processors=8<br><br># Force Cgroup Version: 2<br>kernelCommandLine = cgroup_no_v1=all<br><br># https://learn.microsoft.com/en-us/windows/wsl/wsl-config<br>networkingMode=mirrored<br><br># Sets amount of swap storage space to 8GB, default is 25% of available RAM<br>swap=8GB<br><br># Sets swapfile path location, default is %USERPROFILE%\AppData\Local\Temp\swap.vhdx<br>swapfile=C:\\temp\\wsl-swap.vhdx<br><br># Disable page reporting so WSL retains all allocated memory claimed from Windows and releases none back when free<br>pageReporting=false<br><br># Turn on default connection to bind WSL 2 localhost to Windows localhost. Setting is ignored when networkingMode=mirrored<br>localhostforwarding=true<br><br># Disables nested virtualization<br>nestedVirtualization=false<br><br># Turns on output console showing contents of dmesg when opening a WSL 2 distro for debugging<br>debugConsole=false<br><br># Enable experimental features<br>[experimental]<br>sparseVhd=true<br>autoMemoryReclaim=dropcache # testing supposed to help WSL recover after laptops hibernated</pre><h3>Connecting Externally</h3><p>You can install kubectl on your laptop and connect to the K3s cluster using the Kube config file set in the .kube directory in the project folder.</p><p>kubectl get ns --kubeconfig=.kube/config</p><pre>NAME                   STATUS   AGE<br>default                Active   5m25s<br>kube-node-lease        Active   5m25s<br>kube-public            Active   5m25s<br>kube-system            Active   5m25s<br>kubernetes-dashboard   Active   5m15s</pre><p>kubectl get pods -n kube-system --kubeconfig=.kube/config</p><pre>NAME                                      READY   STATUS      RESTARTS   AGE<br>coredns-ccb96694c-f76tc                   1/1     Running     0          6m19s<br>helm-install-traefik-brtbd                0/1     Completed   1          6m19s<br>helm-install-traefik-crd-5nfpn            0/1     Completed   0          6m19s<br>local-path-provisioner-5b5f758bcf-wmmg6   1/1     Running     0          6m19s<br>metrics-server-7bf7d58749-jdpcm           1/1     Running     0          6m19s<br>svclb-traefik-3c9a52b4-h5m4m              2/2     Running     0          5m38s<br>traefik-5cbdcf97f4-fgc4l                  1/1     Running     0          5m38s</pre><h3>Closing Remarks</h3><p>Friends, I hope this post gave you good insight into the power and flexibility of Dev Containers and using the code provided gives you a starting point.</p><p>I hope you enjoyed this post as much as I did putting this together. Please shoot with some questions if anything is unclear.</p><p>Thank you for taking the time to read this post!</p><h3>Links</h3><ul><li><a href="https://k3s.io/">https://k3s.io/</a></li><li><a href="https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/introduction-to-dev-containers">https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/introduction-to-dev-containers</a></li><li><a href="https://code.visualstudio.com/docs/devcontainers/containers">https://code.visualstudio.com/docs/devcontainers/containers</a></li><li><a href="https://helm.sh/">https://helm.sh/</a></li><li><a href="https://github.com/komodorio/helm-dashboard">https://github.com/komodorio/helm-dashboard</a></li><li><a href="https://kubernetes.io/">https://kubernetes.io/</a></li><li><a href="https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/">https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/</a></li><li><a href="https://k9scli.io/">https://k9scli.io/</a></li><li><a href="https://www.linkedin.com/in/riaannolan/">https://www.linkedin.com/in/riaannolan/</a></li><li><a href="https://hashiqube.com/">https://hashiqube.com/</a></li></ul><h3>Inspiration</h3><p>This project was inspired by HashiQube — The Ultimate DevOps Lab in a Docker container, <a href="https://hashiqube.com/">https://hashiqube.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88a777edc4b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get started with HashiCorp tools in minutes, using HashiQube in a Github Codespace Dev Container]]></title>
            <link>https://medium.com/@riaan.nolan/get-started-with-hashicorp-tools-in-minutes-using-hashiqube-in-a-github-codespace-dev-container-e3df261b660d?source=rss-6787fe1d57a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3df261b660d</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[hashiqube]]></category>
            <category><![CDATA[github-codespaces]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[vault]]></category>
            <dc:creator><![CDATA[Riaan Nolan]]></dc:creator>
            <pubDate>Mon, 29 Jul 2024 00:25:24 GMT</pubDate>
            <atom:updated>2024-07-31T12:05:12.565Z</atom:updated>
            <content:encoded><![CDATA[<p>Friends today I’d like to help you get started with HashiCorp tools using the power of Dev Containers and today, in just a few minutes, you will have Vault, Nomad, Consul, Boundary up and running, live on the Internet, and you will have done your first terraform plan and apply!</p><p><strong><em>To set the stage, we will have Development versions of HashiCorp Vault, Nomad, Consul, Boundary and Terraform up and available on the Internet in less than 5 minutes!</em></strong></p><p>For a quick video, see below</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fok60ZxRKfgQ%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dok60ZxRKfgQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fok60ZxRKfgQ%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/35f00ff957c89cacd5fc0fe9b012f8a6/href">https://medium.com/media/35f00ff957c89cacd5fc0fe9b012f8a6/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F8uDfDnQZZoA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D8uDfDnQZZoA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F8uDfDnQZZoA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ee62010b1ffb074d7c88ca64f174184/href">https://medium.com/media/9ee62010b1ffb074d7c88ca64f174184/href</a></iframe><p><strong><em>For those of you unfamiliar with Dev Containers, it’s basically a Developer Environment inside a Docker container.</em></strong></p><p>A little bit of history, in 2020 I created HashiQube, a DevOps Lab that helps people learn and practice with DevOps tools, and in particular HashiCorp products and other popular Open Source integrations like Gitlab, AWX Ansible Tower, Apache Airflow, DBT (The Data Build Tool), Kubernetes, Docker and many others.</p><p>At first it was spun up using Vagrant and Virtualbox and you can read the article here: <a href="https://medium.com/@riaan.nolan/hashiqube-a-development-lab-using-all-the-hashicorp-products-82edf7a5830f">HashiQube — A DevOps Development Lab Using All the HashiCorp Products</a></p><p>With the arrival of the ARM Apple Chipsets, I extended HashiQube to run in a Docker Container, still using Vagrant and you can read more about that here: <a href="https://medium.com/@riaan.nolan/running-hashiqube-on-multi-arch-arm-and-x86-multi-os-linux-mac-windows-with-docker-desktop-4695e152cacb">Running HashiQube on Multi-Arch (Arm and x86)/ Multi-OS (Linux, Mac, Windows) with Docker Desktop and Vagrant</a></p><p>You can also run HashiQube on a Cloud VM like AWS EC2, GCP or Azure, or All of these 3 Clouds together using <a href="https://registry.terraform.io/modules/star3am/hashiqube/hashicorp/latest">HashiQube’s Terraform Registry Module</a></p><p>But today, I’d like to show you how to run HashiQube in a Dev Container and also show you how we can run it in Github’s Codespaces.</p><h3><strong>Github’s Codespaces</strong>:</h3><ul><li><a href="https://github.com/">A Github Account</a></li></ul><p><em>Follow the instructions below this screenshot of what it will look like</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jTFLhS0jPL_TmaywS0aMOw.png" /><figcaption>HashiQube running on the Internet in Github’s Codespaces</figcaption></figure><ol><li>Go to <a href="https://github.com/star3am/hashiqube">https://github.com/star3am/hashiqube</a></li><li>Create a Fork of the repository</li><li>Click on the Green Code button</li><li>Click on the Codespaces tab</li><li>Click on Create Codespace on master button</li></ol><p>HashiQube will now launch as a Github Codespace Dev Container, and you will see a VSCode IDE window similar to above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y1_8oBs8hwq1cKG5JQRxZw.png" /><figcaption>Follow the helpful on-screen commands or visit https://hashiqube.com</figcaption></figure><p>Now you can issue commands for example to get HashiCorp Vault up and running, type in: <strong><em>bash vault/vault.sh</em></strong></p><p>Your HashiCorp Vault instance will be available live for you to develop against or test your Vault policies</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A2CDhZe_2hGkxTX1-_llaQ.png" /><figcaption>Your HashiQube Codespace avilable ports</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AGfWKF8er2xNdn7KuBsDkQ.png" /><figcaption>Your HashiCorp Vault Instance</figcaption></figure><p>To get Terraform up and running using Localstack, type in:</p><p><strong><em>bash localstack/localstack.sh</em></strong></p><p>You can also run HashiCorp Consul by typing in</p><p><strong><em>bash consul/consul.sh</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*96Qy_0-qUD7iRlfXHoTwTw.png" /><figcaption>Your HashiCorp Consul Instance</figcaption></figure><p>Nomad: b<strong><em>ash nomad/nomad.sh</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cmuCyd0aj57HfAS-sGNcSA.png" /><figcaption>Your HashiCorp Nomad Instance</figcaption></figure><p>Boundary: <strong><em>bash boundary/boundary.sh</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2i8WS5KhwPQvs52og12mqw.png" /><figcaption>Your HashiCorp Boundary Instance</figcaption></figure><p>Keep in mind that I am running the small Codespaces Instance, and you might need to switch to the bigger instance if you want to run multiple services</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4oNMfeolV0U6ULAl5zcoVA.png" /><figcaption>Github’s Codespaces Instance Types</figcaption></figure><p>I hope that this will help you accelerate your Infra Coding maturity! As always, If you have any questions, please reach out to me on</p><p>Linkedin: <a href="https://www.linkedin.com/in/riaannolan/">https://www.linkedin.com/in/riaannolan/</a></p><p>HashiQube: <a href="https://hashiqube.com/">https://hashiqube.com/</a></p><h3>About Me</h3><p>My name is Riaan Nolan and I was born in South Africa. I started out as a Web Developer in 2000 and from there progressed into Systems Administration, with a strong focus on Automation, Infrastructure and Configuration as Code.</p><p>I have worked for Multi-National companies in Portugal, Germany, China, South Africa, United States and Australia.</p><p>Please connect with me on <a href="https://www.linkedin.com/in/riaannolan/">LinkedIn</a> or check out <a href="https://www.credly.com/users/riaan-nolan.e657145c">my Credly profile</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bzz3v1wbrvdc4Khz" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/0*sg1Ix0AdYN_szLqu" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3df261b660d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GIB — The Golden Image Builder]]></title>
            <link>https://medium.com/@riaan.nolan/gib-the-golden-image-builder-87090b720a89?source=rss-6787fe1d57a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/87090b720a89</guid>
            <category><![CDATA[devcontainer]]></category>
            <category><![CDATA[hashicorp-terraform]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[hashicorp-packer]]></category>
            <dc:creator><![CDATA[Riaan Nolan]]></dc:creator>
            <pubDate>Sat, 11 Nov 2023 22:18:23 GMT</pubDate>
            <atom:updated>2025-05-02T00:45:16.050Z</atom:updated>
            <content:encoded><![CDATA[<h3>Packer Ansible GIB The Golden Image Builder</h3><p>In this post I will help you go from Zero to Hero building Golden Images or Standard Operating Environments. This Topic is complex by nature, since it spans, multiple Operating Systems, Multiple Clouds and Multiple Technologies, but, if you walk this through, you will come out the other side a Top Gun Engineer, able to build Any Operating System, on Any Cloud with extreme confidence. If you get stuck, please reach out to me on my Linkedin profile <a href="https://www.linkedin.com/in/riaannolan/">https://www.linkedin.com/in/riaannolan/</a> and I will help you, just like others have helped me before.</p><p>Ok, let’s dive in.</p><p>The common theme across many DevOps / Infrastructure as Code / Configuration as Code / Automation projects is versioning.</p><p>We want to create a versioned artefact that we can deploy, and our Infrastructure or Golden images are no different.</p><p>Enter versioned artefacts.</p><p>Simply put, we want to move fast, develop fast, while keeping versioned checkpoints (artefacts) so to speak, that we can deploy, test and if necessary roll back or roll forward.</p><p>Golden images / Standard Operating Environments (SOEs) are much the same. Gone are the days of manualley maintaining Golden Images or Standard Operating Environments SOEs.</p><p>TL;DR The code can be found here:</p><p><a href="https://github.com/star3am/golden-image-builder">https://github.com/star3am/golden-image-builder</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/0*fCr89mXGXHjNPNq_" /><figcaption>GIB me Hooman!!! GIB is a good Doggo ❤</figcaption></figure><p>I’d like to introduce you to my take on this whole Golden Image thing, building versioned Standard Operating Environments SOEs.</p><p>But before I delve into it, there is a concept I’d like to run past you.</p><ul><li>Day 0 — Building an Image (SOE) This Image is not “live” or “running” yet.</li><li>Day 1 — The Image is now booted into a VM / Container. It is now live and needs to register to end points e.g Monitoring / Domain join / OU Transition for Group Policies to take place.</li><li>Day 2 onwards — Something needs to change in this running Image VM or Container e.g Yum, Apt or Windows Updates, configuration changes, Certificate rotations, anything at all.</li></ul><p>Candidates for this project are: Build Agent VMs, POS systems, Kubernetes Worker Nodes, VMs that run workloads, Point of Sale machines, really any VM or Container that has to be spun up in the 100s or 1000s of times.</p><p>In addition to this Day 0, Day 1 and Day 2 dilemma, we need to consider complexity. The more complex something is, the more error prone it becomes the harder it is to manage.</p><p>For that reason, we want to keep our development toolchain standardised and settle on the minimum languages to use, for that reason, I’ve picked:</p><ul><li>HCL — Hashicorp Configuration Language (With HCL you can write Terraform Modules and Packer Templates)</li><li>YAML — Yet Another Markup Language (With YAML you can write Automation Pipelines (Github Actions, Gitlab, Azure DevOps, Circle CI etc.) and Ansible Roles and Playbooks)</li></ul><p>Enter Automation Pipelines + Packer + Ansible + Terraform + AWX Ansible Tower.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gr0HDj1v7mtEgFpNcj3QFg.png" /><figcaption>Build RedHat 7.9 8.3, Windows 2016 2019 2022, Ubuntu 18.04 20.04 22.04 on Azure, GCP and AWS at once.</figcaption></figure><p>Packer, Ansible, Terraform — This Trio of Technology can configure and build any Operating System, on any Cloud, and can be used locally as a Top Gun Development Environment! (See my post about <a href="https://medium.com/@riaan.nolan/top-gun-terraform-development-environment-60ac00d49577">Top Gun Terraform Development Environments</a>)</p><p>So what is HashiCorp Packer?</p><p><a href="https://developer.hashicorp.com/packer/docs/intro">Introduction | Packer | HashiCorp Developer</a></p><p>Packer is an open source tool for creating identical machine images for multiple platforms from a single source configuration. Packer is lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel. Packer does not replace configuration management like Chef or Puppet. In fact, when building images, Packer is able to use tools like Chef or Puppet to install software onto the image.</p><p>A <em>machine image</em> is a single static unit that contains a pre-configured operating system and installed software which is used to quickly create new running machines. Machine image formats change for each platform. Some examples include <a href="https://en.wikipedia.org/wiki/Amazon_Machine_Image">AMIs</a> for EC2, VMDK/VMX files for VMware, OVF exports for VirtualBox, etc.</p><p>What is RedHat Ansible?</p><p><a href="https://www.ansible.com/">Ansible Collaborative</a></p><p>Red Hat® <strong>Ansible</strong>® Automation Platform is an end-to-end automation platform to configure systems, deploy software, and orchestrate advanced workflows.</p><p>What is HashiCorp Terraform?</p><p><a href="https://www.terraform.io/">Terraform | HashiCorp Developer</a></p><p>Terraform is an infrastructure-as-code software tool created by HashiCorp. Users define and provide data center infrastructure using a declarative configuration language known as HashiCorp Configuration Language.</p><p>Going back to our Day 0, Day 1 and Day 2 concept, let’s explain where we use what tool.</p><ul><li>Day 0 — Automation Pipelines + Packer + Ansible</li><li>Day 1 — Automation Pipelines + Terraform + Ansible</li><li>Day 2 onwards — Automation Pipelines + Terraform + AWX Ansible Tower</li></ul><p>For Autiditng, Compliance and Visibility I am using Terraform Cloud and AWX Ansible Tower. Let’s quickly address what those tools are.</p><p>What is Terraform Cloud</p><p><a href="https://app.terraform.io/">Terraform Cloud by HashiCorp</a></p><p>Terraform Cloud is a Web Interface for Terraform. It has great features such as Single Sign on, Remote AND ENCRYPTED state storage, Workspaces, Explorer (to see which workspaces failed, and which versions of modules the workspaces are using, and MUCH, MUCH more)</p><p>What is AWX Ansible Tower</p><p><a href="https://github.com/ansible/awx">GitHub - ansible/awx: AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.</a></p><p>AWX Ansible Tower is a Web Interface for Ansible. It has great features such as Single Sign on, a Web interface into your Ansible Jobs, Smart Inventories, Credentials, Projects and Secret Engines.</p><p><strong>Ok! So enough of the theory! Let’s Do this!</strong></p><ol><li>We Use VSCode Dev Containers (Meaning you don’t need to install Ansible, Packer and Terraform, it’s installed via a Dockerfile and VSCode will drop you into that container.)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h1HaWdh8LyU3sZmFvMVGBw.png" /><figcaption>Inside the DevContainer of our project</figcaption></figure><p>2. We use Github Actions for our CI/CD Automation Pipeline and you can see the whole pipeline file here: <a href="https://github.com/star3am/golden-image-builder/blob/master/.github/workflows/pipeline.yml">https://github.com/star3am/golden-image-builder/blob/master/.github/workflows/pipeline.yml</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*38JvpIkVei0vOf9lQAzTyw.png" /><figcaption>Our Gi0thub Actions Pipeline</figcaption></figure><p>3. We use the same Dockerfile for our Build Agent and Developer Environment, meaning, we get consistent results every time. You can view the Dockerfile here: <a href="https://github.com/star3am/golden-image-builder/blob/master/Dockerfile">https://github.com/star3am/golden-image-builder/blob/master/Dockerfile</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pjr_EOVTJJMhO4yd88liLg.png" /><figcaption>We use a EVERYTHING in CODE mentality.</figcaption></figure><p>4. Our Packer Templates can build a Golden Image / Standard Operating Environment SOE on any popular Cloud and you can see my Ubuntu 22.04 Packer Template here: <br><a href="https://github.com/star3am/golden-image-builder/blob/master/packer/linux/ubuntu/ubuntu-2204.pkr.hcl">https://github.com/star3am/golden-image-builder/blob/master/packer/linux/ubuntu/ubuntu-2204.pkr.hcl</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*gr0HDj1v7mtEgFpNcj3QFg.png" /></figure><p>5. Our Ansible Roles are “Pulled Down” or “Installed” with Ansible Galaxy</p><pre>      - name: Ansible Galaxy install roles<br>        run: ansible-galaxy install -f -r ansible/roles/requirements.yml -p ansible/roles/</pre><p>and the requirements.txt looks like</p><pre>---<br>- src: &#39;https://github.com/ansible-lockdown/RHEL8-CIS&#39;<br>  version: &#39;2.5.1&#39;<br>  scm: &#39;git&#39;<br><br>- src: &#39;https://github.com/ansible-lockdown/RHEL7-CIS&#39;<br>  version: &#39;1.2.3&#39;<br>  scm: &#39;git&#39;<br><br>- src: &#39;https://github.com/ansible-lockdown/UBUNTU22-CIS&#39;<br>  version: &#39;1.2.0&#39;<br>  scm: &#39;git&#39;<br><br>- src: &#39;https://github.com/ansible-lockdown/UBUNTU20-CIS&#39;<br>  version: &#39;2.1.1&#39;<br>  scm: &#39;git&#39;<br><br>- src: &#39;https://github.com/ansible-lockdown/UBUNTU18-CIS&#39;<br>  version: &#39;1.4.0&#39;<br>  scm: &#39;git&#39;<br><br>- src: &#39;https://github.com/ansible-lockdown/Windows-2016-CIS&#39;<br>  version: &#39;1.2.1&#39;<br>  scm: &#39;git&#39;<br><br>- src: &#39;https://github.com/ansible-lockdown/Windows-2019-CIS&#39;<br>  version: &#39;1.3.0&#39;<br>  scm: &#39;git&#39;<br><br>- src: &#39;https://github.com/ansible-lockdown/Windows-2022-CIS&#39;<br>  version: &#39;1.0.0&#39;<br>  scm: &#39;git&#39;<br><br>- src: &#39;https://github.com/star3am/ansible-role-win_openssh&#39;<br>  version: &#39;ssh-playbook-test&#39;<br>  scm: &#39;git&#39;<br><br>- src: &#39;https://github.com/star3am/ansible-role-example-role&#39;<br>  version: &#39;master&#39;<br>  scm: &#39;git&#39;</pre><p>6. My Ansible-role-example-role supports, Windows, Yum and Debian based systems, and basically just add an ansible user to the system and it writes a “Fingerprint” to the Image, meaning that running VMs can be tracked back to the original build and versions.</p><pre>ubuntu@hashiqube-aws:~$ cat /build-202311100026.json  | jq<br>{<br>  &quot;inventory_file&quot;: &quot;/tmp/packer-provisioner-ansible4259354685&quot;,<br>  &quot;inventory_dir&quot;: &quot;/tmp&quot;,<br>  &quot;ansible_host&quot;: &quot;127.0.0.1&quot;,<br>  &quot;ansible_user&quot;: &quot;ubuntu&quot;,<br>  &quot;ansible_port&quot;: 41081,<br>  &quot;inventory_hostname&quot;: &quot;none&quot;,<br>  &quot;inventory_hostname_short&quot;: &quot;none&quot;,<br>  &quot;group_names&quot;: [<br>    &quot;ungrouped&quot;<br>  ],<br>  &quot;ansible_facts&quot;: {<br>    &quot;system&quot;: &quot;Linux&quot;,<br>    &quot;kernel&quot;: &quot;6.2.0-1015-aws&quot;,<br>    &quot;kernel_version&quot;: &quot;#15~22.04.1-Ubuntu SMP Fri Oct  6 21:37:24 UTC 2023&quot;,<br>    &quot;machine&quot;: &quot;x86_64&quot;,<br>    &quot;python_version&quot;: &quot;3.10.12&quot;,<br>    &quot;fqdn&quot;: &quot;ip-172-31-5-254.ap-southeast-2.compute.internal&quot;,<br>    &quot;hostname&quot;: &quot;ip-172-31-5-254&quot;,<br>    &quot;nodename&quot;: &quot;ip-172-31-5-254&quot;,<br>    &quot;domain&quot;: &quot;ap-southeast-2.compute.internal&quot;,<br>    &quot;userspace_bits&quot;: &quot;64&quot;,<br>    &quot;architecture&quot;: &quot;x86_64&quot;,<br>    &quot;userspace_architecture&quot;: &quot;x86_64&quot;,<br>    &quot;machine_id&quot;: &quot;6f039c13c0ac4848a55d23f834de86b8&quot;,<br>    &quot;is_chroot&quot;: false,<br>    &quot;virtualization_type&quot;: &quot;xen&quot;,<br>    &quot;virtualization_role&quot;: &quot;guest&quot;,<br>    &quot;virtualization_tech_guest&quot;: [<br>      &quot;xen&quot;<br>    ],<br>    &quot;virtualization_tech_host&quot;: [],<br>    &quot;distribution&quot;: &quot;Ubuntu&quot;,<br>    &quot;distribution_release&quot;: &quot;jammy&quot;,<br>    &quot;distribution_version&quot;: &quot;22.04&quot;,<br>    &quot;distribution_major_version&quot;: &quot;22&quot;,<br>    &quot;distribution_file_path&quot;: &quot;/etc/os-release&quot;,<br>    &quot;distribution_file_variety&quot;: &quot;Debian&quot;,<br>    &quot;distribution_file_parsed&quot;: true,<br>    &quot;os_family&quot;: &quot;Debian&quot;,<br>....</pre><p>7. Once the Image has been built I use Terraform and Hashiqube’s Multi Cloud Terraform <a href="https://hashiqube.com/">https://hashiqube.com/</a> and <a href="https://registry.terraform.io/modules/star3am/hashiqube/hashicorp/latest">https://registry.terraform.io/modules/star3am/hashiqube/hashicorp/latest</a> module to spin up HashiQube on this new Base AMI (Our Golden Image) — I do this for a few reasons:</p><ul><li>I need AWX Ansible Tower to showcase some additional functionality and HashiQube already has AWX Ansible Tower running on top of Kubernetes (Minikube) see: <a href="https://hashiqube.com/ansible-tower/README">https://hashiqube.com/ansible-tower/README</a></li><li>I use Terraform to handle all my Infreastructure as Code projects and my main.tf can be found here <a href="https://github.com/star3am/golden-image-builder/tree/master/terraform/awx-ansible-tower-instance">https://github.com/star3am/golden-image-builder/tree/master/terraform/awx-ansible-tower-instance</a> and it looks like:</li></ul><pre>module &quot;awx_ansible_tower&quot; {<br>  source                     = &quot;star3am/hashiqube/hashicorp&quot;<br>  deploy_to_aws              = true<br>  aws_instance_type          = &quot;t2.large&quot;<br>  use_packer_image           = var.use_packer_image<br>  deploy_to_azure            = false<br>  deploy_to_gcp              = false<br>  debug_user_data            = true<br>  ssh_public_key             = var.ssh_public_key<br>  ssh_private_key            = var.ssh_private_key<br>  debug_allow_ssh_cidr_range = &quot;0.0.0.0/0&quot;<br>  whitelist_cidr             = &quot;101.189.198.17/32&quot;<br>  vagrant_provisioners       = &quot;basetools,docker,minikube,ansible-tower&quot;<br>}</pre><p>8. I use Terraform Cloud for my remote Terraform Runs, it’s free and blazing fast! <a href="https://app.terraform.io/">https://app.terraform.io</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UsAMivYpf9YdHW2KNw5jsw.png" /><figcaption>Terraform Cloud Workspace apply</figcaption></figure><p>9. I use AWX Ansible Tower to do my Ansible Runs and you can log into the AWX Ansible Tower web interface on the <a href="http://instance-ip:8043/">http://Instance-IP:8043</a> with the username: admin and the password which is outputted on the Terraform Run</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LEKXlutA9Wo9_EJyNSlqeA.png" /><figcaption>Your AWX Ansible Tower username and Password</figcaption></figure><p>And once we log in, we can see our AWX Ansible Tower Dashboard and our successful job run, which was triggered by Terraform</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xQYqPNma0E7-DPXojX4Kxg.png" /><figcaption>AWX Ansible Tower Job Output</figcaption></figure><p>Example Terraform Code to trigger an Ansible Run via a Null_Resource</p><pre>variable &quot;tower_cli_remote&quot; {<br>  type    = string<br>  default = &quot;~/.local/bin/awx&quot;<br>}<br><br>variable &quot;tower_cli_local&quot; {<br>  type    = string<br>  default = &quot;/Users/riaannolan/bin/awx&quot;<br>}<br><br>variable &quot;tower_host&quot; {<br>  type    = string<br>  default = &quot;https://10.9.99.10:8043/&quot;<br>}<br><br>data &quot;external&quot; &quot;tower_token&quot; {<br>  program = [&quot;/bin/bash&quot;, &quot;-c&quot;, &quot;${var.tower_cli_local} login --conf.host ${var.tower_host} --conf.insecure --conf.username admin --conf.password \&quot;password\&quot;&quot;]<br>}<br><br>locals {<br>  timestamp = timestamp()<br>}<br><br>resource &quot;null_resource&quot; &quot;awx_cli&quot; {<br>  triggers = {<br>    timestamp = local.timestamp<br>  }<br><br>  provisioner &quot;remote-exec&quot; {<br>    inline = [<br>      &quot;${var.tower_cli_remote} --conf.host ${var.tower_host} -f human job_templates launch 9 --monitor --filter status --conf.insecure --conf.token ${data.external.tower_token.result.token}&quot;,<br>    ]<br><br>    connection {<br>      type        = &quot;ssh&quot;<br>      user        = &quot;vagrant&quot;<br>      password    = &quot;vagrant&quot;<br>      host        = &quot;10.9.99.10&quot;<br>    }<br>  }<br>  <br>  provisioner &quot;local-exec&quot; {<br>    command = &quot;${var.tower_cli_local} --conf.host ${var.tower_host} -f human job_templates launch 9 --monitor --filter status --conf.insecure --conf.token ${data.external.tower_token.result.token}&quot;<br>  }<br>}</pre><p>10. You can now build <strong>Versioned</strong> Golden Images / Standard Operating Environments SOEs — ALL in CODE!!!</p><p>Thank you for your time, to go through this how-to, I hope that you have enjoyed it as much as I did putting it together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/0*oGowmzx_Ou1RaEKj" /></figure><p>You are welcome to connect with me on Linkedin <a href="https://www.linkedin.com/in/riaannolan/">https://www.linkedin.com/in/riaannolan/</a><br>Credly profile: <a href="https://www.credly.com/users/riaan-nolan.e657145c">https://www.credly.com/users/riaan-nolan.e657145c</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CeMgB3nq2OFyAVbE" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87090b720a89" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top Gun Terraform Development Environment]]></title>
            <link>https://medium.com/@riaan.nolan/top-gun-terraform-development-environment-60ac00d49577?source=rss-6787fe1d57a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/60ac00d49577</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[devcontainer]]></category>
            <category><![CDATA[hashiqube]]></category>
            <category><![CDATA[development-tools]]></category>
            <category><![CDATA[hashicorp-ambassador]]></category>
            <dc:creator><![CDATA[Riaan Nolan]]></dc:creator>
            <pubDate>Mon, 24 Jul 2023 04:36:40 GMT</pubDate>
            <atom:updated>2023-10-09T04:55:25.006Z</atom:updated>
            <content:encoded><![CDATA[<p>As a Hashicorp Certified Terraform Instructor, I get asked a lot of questions from beginners, and I decided to put together a “Best in Class” post with recommendations for Old and New Terraform Developers.</p><p>In this post we’ll cover, VSCode’s Dev/Remote containers for a portable (can run on your developers laptops, can run as a build agent, will run on Grannie’s laptop, God bless her soul ❤) all-in-code developer setup.</p><p>We’ll cover, TFEnv, TGEnv, TFSec, Terraform Docs, Terraform Format, TFLint, Terraform Validate, Terraform Plan, Pre Commit amongst other</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hgVk2qGe6l6-uYyD.jpg" /></figure><p>This post is a Buffet, you can pick what you want to eat or try everything, it’s up to you, <strong>Bon Appétit!</strong></p><h4>You can find all the code, ready to use here: <a href="https://github.com/star3am/terraform-modules-library">https://github.com/star3am/terraform-modules-library</a></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*YfoVtf3I3n0SVlrNEdYAFw.gif" /><figcaption>Terraform plan, format, lint, docs, tfsec and Pre Commit</figcaption></figure><p>This post will cover the following topics:</p><ul><li>Development Environment</li><li>Helpful Tools such as TFEnv, Terraform Docs, Terraform Format</li><li>Terraform Modules (Testing and Development for Multi-Cloud)</li><li>General Tips and Tricks</li><li>Links</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*ztjtzBpKz_nfyq5T.jpg" /><figcaption>Tank was probably a badass DevOps guy!</figcaption></figure><p>So let’s start with our Development Environment. We need a consistent Development Environment with a small Tool Chain.</p><ul><li>This Environment Should be quick and easy to install.</li><li>It should run all Operating Systems (Windows, Mac (Intel and Arm), Linux and of course our build agents)</li><li>In Code solution as far as possible.</li></ul><p>For our Development Environment, I use Docker Desktop, this gives us a consistent containerised environment which runs on all Operating Systems. <a href="https://www.docker.com/products/docker-desktop/">https://www.docker.com/products/docker-desktop/</a></p><p>As and IDE, I use VSCode <a href="https://code.visualstudio.com/">https://code.visualstudio.com/</a> and the Dev/Remote Containers Extension <a href="https://code.visualstudio.com/docs/devcontainers/tutorial">https://code.visualstudio.com/docs/devcontainers/tutorial</a></p><p>Now we have a pretty tiny Tool Chain, that runs consistently on All Operating Systems. This is important, because our colleagues might be on Windows while we are on a Mac, and we want to as far as possible work in the same way.</p><p>Our VSCode .devcontainer/devcontainer.json looks as follows <a href="https://github.com/star3am/terraform-modules-library/blob/main/.devcontainer/devcontainer.json">https://github.com/star3am/terraform-modules-library/blob/main/.devcontainer/devcontainer.json</a></p><pre>{<br>  &quot;dockerComposeFile&quot;: &quot;../docker-compose.yml&quot;,<br>  &quot;service&quot;: &quot;tools&quot;,<br>  &quot;workspaceFolder&quot;: &quot;/app&quot;,<br>  &quot;postStartCommand&quot;: &quot;git config --global --add safe.directory ${containerWorkspaceFolder}&quot;,<br>  &quot;customizations&quot;: {<br>    &quot;vscode&quot;: {<br>      &quot;extensions&quot;: [<br>        &quot;dbaeumer.vscode-eslint&quot;,<br>        &quot;hashicorp.terraform&quot;,<br>        &quot;nhoizey.gremlins&quot;,<br>        &quot;hashicorp.hcl&quot;<br>      ]<br>    }<br>  }<br>}</pre><p>The important bits are that it references a docker-compose file <a href="https://github.com/star3am/terraform-modules-library/blob/main/docker-compose.yml#L9">https://github.com/star3am/terraform-modules-library/blob/main/docker-compose.yml#L9</a> which launches our Dev Container from a Dockerfile <a href="https://github.com/star3am/terraform-modules-library/blob/main/Dockerfile">https://github.com/star3am/terraform-modules-library/blob/main/Dockerfile</a></p><p>The Dockerfile does most of the magic (It runs on Windows, Linux, Mac (Intel and Arm)) and it installs base tools such as wget, curl, nano, less etc. for Ubuntu 22.04 and it also installs our Developer tools such as:</p><ul><li>TFEnv <a href="https://github.com/tfutils/tfenv">https://github.com/tfutils/tfenv</a> Installs the appropriate Terraform Version as defined in a .terraform-version file</li><li>TGEnv <a href="https://github.com/cunymatthieu/tgenv">https://github.com/cunymatthieu/tgenv</a> Installs the appropriate Terragrunt Version as defined in a .terragrunt-version file</li><li>TFSec <a href="https://github.com/aquasecurity/tfsec">https://github.com/aquasecurity/tfsec</a> Which Scans our Terraform Code for potential security risks</li><li>Terraform Docs <a href="https://github.com/terraform-docs/terraform-docs">https://github.com/terraform-docs/terraform-docs</a> utility to generate documentation from Terraform modules in various output formats</li><li>Terraform Format <a href="https://developer.hashicorp.com/terraform/cli/commands/fmt">https://developer.hashicorp.com/terraform/cli/commands/fmt</a> is used to rewrite Terraform configuration files to a canonical format and style and correctly format our Terraform code</li><li>TFLint <a href="https://github.com/terraform-linters/tflint">https://github.com/terraform-linters/tflint</a> Linting our Terraform code</li><li>Terraform Validate <a href="https://developer.hashicorp.com/terraform/cli/commands/validate">https://developer.hashicorp.com/terraform/cli/commands/validate</a> validates the Terraform configuration files in a directory, referring only to the configuration and not accessing any remote services such as remote state, provider APIs, etc.</li><li>Terraform Plan <a href="https://developer.hashicorp.com/terraform/cli/commands/plan">https://developer.hashicorp.com/terraform/cli/commands/plan</a> run a Terraform Plan on all our Modules using Terragrunt `terragrunt run-all plan`</li><li>Pre Commit <a href="https://pre-commit.com/">https://pre-commit.com/</a> Git Pre Commit hooks to help us lint our code and detect common coding errors see: <a href="https://github.com/star3am/terraform-modules-library/blob/main/.pre-commit-config.yaml">https://github.com/star3am/terraform-modules-library/blob/main/.pre-commit-config.yaml</a></li></ul><p>Now that we know how our Development Environment is spun up, and what it does, let’s see a practical Demo.</p><p>If you install Docker Desktop, VSCode and the Dev/Remote containers extension. You can Clone <a href="https://github.com/star3am/terraform-modules-library">https://github.com/star3am/terraform-modules-library</a></p><p>Now Let’s open VSCode and open the project folder, you will see that VSCode notifies you that it has detected a Remote Dev Container and it will ask you if you want to open in a Dev Container.</p><h4>Click Reopen in Container</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L2Oned9usrt9XOqa4rrmPQ.png" /><figcaption>VSCode Reopen in Container</figcaption></figure><p>This will build the Dockerfile and drop you into a Terminal inside the container, with everything installed.</p><p><strong><em>Meaning that you don’t need to have Terraform, Terragrunt, TFEnv etc. installed on your laptop, all you need is Docker, Git and VSCode + The Dev / Remote Container extension for VSCode.. Everything is managed in Code!</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n9pVhP1uLeNo-u--N2Atdg.png" /><figcaption>You are now coding inside the container</figcaption></figure><p>If you look at the folders on the left, we have aws, azure, gcp and custom and and inside each of those a modules folder, I have added a few examples, and you can add more, this framework will scan, check, format all our modules, plan them and generate documentation for them.</p><p>You might not need al of this, and you are welcome to use parts of this repository to suite your own needs, for example you might only need the Dev Container part or just the Pre Commit component or just the Dockerfile, either way you are welcome to help yourself.</p><p>Be sure to checkout the .github/workflows/pipeline.yml file. Currently this builds an Arm64 and Amd64 container image on Github Container Registry using Github Actions.</p><pre>jobs:<br>  build-and-publish-latest:<br>    runs-on: ubuntu-latest<br>    # Running this job only for master branch<br>    # if: github.ref == &#39;refs/heads/main&#39;<br><br>    steps:<br>      # Checking out the repo<br>      - uses: actions/checkout@v2<br><br>      # https://github.com/docker/setup-qemu-action<br>      # https://blog.thesparktree.com/docker-multi-arch-github-actions<br>      - name: Setup QEMU<br>        uses: docker/setup-qemu-action@v2<br>        with:<br>          platforms: &#39;arm64,amd64&#39;<br><br>      # https://github.com/docker/setup-buildx-action<br>      - name: Set up Docker Buildx<br>        uses: docker/setup-buildx-action@v2<br><br>      # https://github.com/marketplace/actions/docker-build-push-action<br>      - uses: mr-smithers-excellent/docker-build-push@v6<br>        name: Build and Push Docker image<br>        with:<br>          image: terraform-modules-library-container<br>          tags: latest<br>          registry: ghcr.io<br>          multiPlatform: true<br>          platform: linux/amd64,linux/arm64<br>          username: ${{ github.actor }}<br>          password: ${{ secrets.GITHUB_TOKEN }}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E1MJGCN80NFMhZyWXbsE2w.png" /><figcaption>./run.sh</figcaption></figure><p>This Dockerfile can also be build into a container image and used as our build agent, because it uses Docker, you are able to easily install new software as you need without having to ask or log a ticket for it to be installed on the build agents, as long as your build agents has Docker installed you should be fine.</p><h4>Closing Remarks ❤</h4><p>Many thanks goes to the team at Gruntwork <a href="https://gruntwork.io/">https://gruntwork.io/</a> for their amazing effort and for selflessly sharing their code in the great spirit of Open Source. In fact <a href="https://github.com/gruntwork-io/terragrunt-infrastructure-modules-example">https://github.com/gruntwork-io/terragrunt-infrastructure-modules-example</a> inspired this repo and set the foundation for this repo.</p><p>So, that brings us to the end of how I setup my Terraform Development Environment, I hope you enjoyed this post, as much as I did writing it and setting it up.</p><h4>Next Steps…</h4><p>Sign up for a Terraform Cloud account <a href="https://app.terraform.io/public/signup/account">https://app.terraform.io/public/signup/account</a></p><p>You can read more about how I use Terraform Cloud for <a href="https://hashiqube.com/">Hashiqube</a>’s <a href="https://hashiqube.com/terraform/README?id=hashiqube-multi-cloud">Multi-Cloud Terraform Module</a></p><p>Thank you for reading to the end, I will now reward you with my Desktop Wallpaper from <a href="https://www.youtube.com/@purrplecatmusic/featured">https://www.youtube.com/@purrplecatmusic/featured</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1UQIjO10AWfhi2t78ivHFg.png" /><figcaption>Purple Cat</figcaption></figure><h4><a href="https://hashiqube.com/visual-studio-code/README?id=popular-vscode-extensions">Popular VSCode Extensions</a></h4><p>Also install these popular Extensions to help you get started:</p><ul><li>Azure Terraform Extension <a href="https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureterraform">https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureterraform</a></li><li>Terraform Extension <a href="https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform">https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform</a></li><li>Install Git History Extension <a href="https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory">https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory</a></li><li>Install GitLens Extension <a href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens">https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens</a></li><li>YAML Extension <a href="https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml">https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml</a></li><li>Docker Remote Extension (Dev Containers / Remote Containers) <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers">https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers</a></li><li>AWS Toolkit <a href="https://aws.amazon.com/visualstudiocode/">https://aws.amazon.com/visualstudiocode/</a></li><li>AWS CloudFormation Extension <a href="https://marketplace.visualstudio.com/items?itemName=aws-scripting-guy.cform">https://marketplace.visualstudio.com/items?itemName=aws-scripting-guy.cform</a></li><li>Dracula Dark Theme <a href="https://marketplace.visualstudio.com/items?itemName=dracula-theme.theme-dracula">https://marketplace.visualstudio.com/items?itemName=dracula-theme.theme-dracula</a></li><li>Live Share Extension <a href="https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare-pack">https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare-pack</a></li></ul><h4>Links</h4><ul><li><a href="https://cloud.google.com/docs/terraform/best-practices-for-terraform">https://cloud.google.com/docs/terraform/best-practices-for-terraform</a></li><li><a href="https://github.com/gruntwork-io/terragrunt-infrastructure-modules-example">https://github.com/gruntwork-io/terragrunt-infrastructure-modules-example</a></li><li><a href="https://hashiqube.com/">https://hashiqube.com/</a></li><li><a href="https://github.com/star3am/tools-container">https://github.com/star3am/tools-container</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/0*QEaUd7lR7o_801ej" /></figure><p>You are welcome to connect with me on Linkedin <a href="https://www.linkedin.com/in/riaannolan/">https://www.linkedin.com/in/riaannolan/</a><br>Credly profile: <a href="https://www.credly.com/users/riaan-nolan.e657145c">https://www.credly.com/users/riaan-nolan.e657145c</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6wyH3qiL0WEeR5rO" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60ac00d49577" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hashiqube — A Development Lab Using All the HashiCorp Products]]></title>
            <link>https://medium.com/@riaan.nolan/hashiqube-a-development-lab-using-all-the-hashicorp-products-82edf7a5830f?source=rss-6787fe1d57a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/82edf7a5830f</guid>
            <category><![CDATA[hashicorp]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[hashiqube]]></category>
            <dc:creator><![CDATA[Riaan Nolan]]></dc:creator>
            <pubDate>Wed, 05 Jul 2023 09:28:55 GMT</pubDate>
            <atom:updated>2023-12-14T01:30:40.980Z</atom:updated>
            <content:encoded><![CDATA[<h3>HashiQube — A DevOps Development Lab Using All the HashiCorp Products</h3><p>Hello friends! Today, I’d like to give you a brief introduction to <a href="https://hashiqube.com/">Hashiqube</a>.</p><p>HashiQube’s Youtube Channel — Please Subscribe <a href="https://www.youtube.com/@hashiqube">https://www.youtube.com/@hashiqube</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FsFiWzKbpEpU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DsFiWzKbpEpU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FsFiWzKbpEpU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/89848477d16303756e6cfb69a8dccd99/href">https://medium.com/media/89848477d16303756e6cfb69a8dccd99/href</a></iframe><p>This will be the first article in a set, that will help you use Hashiqube to learn and use <a href="https://hashiqube.com/hashicorp/README">Hashicorp</a> Products, Docker, Kubernetes, Grafana, Prometheus, Helm Charts and much much more… but let’s start the beginning…</p><p>3 years ago, I started learning about and using Hashicorp Terraform and Vault. First I installed it on my laptop, but since I was quite new on Vault, I frequently needed to “Reset” my Vault installation due to the many scenarios and use cases I was exploring.</p><p>I knew there was a better way, since I’ve used Vagrant before, with great success, I decided to make a Lab using Vagrant, that I could spin up and down, while keeping my configuration in code, which enabled me to commit my changes to version control. This worked great, because I could spin it up at home, and use my lab on the train without an Internet connection.</p><p>I was absolutely blown away by Hashicorp software and I participated in Hashitalks ANZ and you can view the blog post and video below.</p><p><a href="https://www.hashicorp.com/resources/hashiqube-a-development-lab-using-all-the-hashicorp-products">HashiQube - A Development Lab Using All the HashiCorp Products</a></p><p>As time went by, I needed to integrate services with Vault, such as MySQL, MS SQL, PostgreSQL, Ansible, and Hasiqube steadily grew with more and more integrations.</p><p>Fast forward 3 years and Hashiqube now runs the following integrations…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*Kan2rQBpGyW5o3gAhnPCBg.png" /><figcaption>HashiQube — A Development Lab using all the HashiCorp Products</figcaption></figure><ul><li><a href="https://hashiqube.com/multi-cloud/?id=terraform-hashicorp-hashiqube">Multi Cloud</a> — Hashiqube on AWS, GCP and Azure (Clustered) <a href="https://registry.terraform.io/modules/star3am/hashiqube/hashicorp/latest">https://registry.terraform.io/modules/star3am/hashiqube/hashicorp/latest</a></li><li><a href="https://hashiqube.com/hashicorp/?id=vagrant">Vagrant</a> — Vagrant is an open-source software product for building and maintaining portable virtual software development environments; e.g., for VirtualBox, KVM, Hyper-V, Docker containers, VMware, and AWS. It tries to simplify the software configuration management of virtualization in order to increase development productivity <strong>vagrant up --provision</strong></li><li><a href="https://hashiqube.com/hashicorp/?id=vault">Vault</a> — Secure, store and tightly control access to tokens, passwords, certificates, encryption keys for protecting secrets and other sensitive data using a UI, CLI, or HTTP API <strong>vagrant up --provision-with basetools,vault</strong></li><li><a href="https://hashiqube.com/hashicorp/?id=consul">Consul</a> — Consul uses service identities and traditional networking practices to help organizations securely connect applications running in any environment <strong>vagrant up --provision-with basetools,consul</strong></li><li><a href="https://hashiqube.com/hashicorp/?id=nomad">Nomad</a> — A simple and flexible scheduler and orchestrator to deploy and manage containers and non-containerized applications across on-prem and clouds at scale <strong>vagrant up --provision-with basetools,docker,nomad</strong></li><li><a href="https://hashiqube.com/hashicorp/?id=traefik-load-balancer-for-nomad">Traefik</a> — Traefik is a modern HTTP reverse proxy and load balancer that seamlessly integrates with Nomad <strong>vagrant up --provision-with basetools,docker,nomad</strong> or <strong>vagrant up --provision-with basetools,docker,minikube</strong></li><li><a href="https://hashiqube.com/hashicorp/?id=fabio-load-balancer-for-nomad">Fabio</a> — Fabio is an HTTP and TCP reverse proxy that configures itself with data from Consul <strong>vagrant up --provision-with basetools,docker,nomad</strong></li><li><a href="https://hashiqube.com/hashicorp/?id=terraform">Terraform</a> — Use Infrastructure as Code to provision and manage any cloud, infrastructure, or service <strong>vagrant up --provision-with basetools,docker,localstack,terraform</strong></li><li><a href="https://hashiqube.com/hashicorp/?id=packer">Packer</a> — Create identical machine images for multiple platforms from a single source configuration.</li><li><a href="https://hashiqube.com/hashicorp/?id=sentinel">Sentinel</a> — Sentinel is an embedded policy-as-code framework</li><li><a href="https://hashiqube.com/hashicorp/?id=waypoint">Waypoint</a> — Waypoint is an open source solution that provides a modern workflow for build, deploy, and release across platforms <strong>vagrant up --provision-with basetools,docker,waypoint</strong> or <strong>vagrant up --provision-with basetools,docker,waypoint-kubernetes-minikube</strong></li><li><a href="https://hashiqube.com/hashicorp/?id=boundary">Boundary</a> — Simple and secure remote access to any system from anywhere based on user identity <strong>vagrant up --provision-with basetools,boundary</strong></li><li><a href="https://hashiqube.com/docker/?id=docker">Docker</a> — Securely build, share and run any application, anywhere <strong>vagrant up --provision-with basetools,docker</strong></li><li><a href="https://hashiqube.com/localstack/?id=localstack">Localstack</a> — A fully functional local AWS cloud stack <strong>vagrant up --provision-with basetools,docker,localstack,terraform</strong></li><li><a href="https://hashiqube.com/ansible/?id=ansible">Ansible</a> — Ansible is a suite of software tools that enables infrastructure as code. It is open-source and the suite includes software provisioning, configuration management, and application deployment functionality.</li><li><a href="https://hashiqube.com/ldap/?id=ldap">LDAP</a> — Lightweight Directory Access Protocol <strong>vagrant up --provision-with basetools,vault,ldap</strong></li><li><a href="https://hashiqube.com/jenkins/?id=jenkins">Jenkins</a> — Jenkins is an open source automation server. It helps automate the parts of software development related to building, testing, and deploying, facilitating continuous integration and continuous delivery <strong>vagrant up --provision-with basetools,docker,vault,jenkins</strong></li><li><a href="https://hashiqube.com/database/?id=oracle-mysql">Oracle MySQL</a> — MySQL is an open-source relational database management system (RDBMS) <strong>vagrant up --provision-with basetools,docker,vault,mysql</strong></li><li><a href="https://hashiqube.com/database/?id=microsoft-sql-mssql-express">Microsoft MSSQL</a> — Microsoft SQL Server is a relational database management system developed by Microsoft <strong>vagrant up --provision-with basetools,docker,vault,mssql</strong></li><li><a href="https://hashiqube.com/database/?id=postgresql">PostgreSQL</a> — PostgreSQL, also known as Postgres, is a free and open-source relational database management system emphasizing extensibility and SQL compliance <strong>vagrant up --provision-with basetools,docker,vault,postgresql</strong></li><li><a href="https://hashiqube.com/minikube/?id=minikube">Minikube</a> — Minikube implements a local Kubernetes cluster on macOS, Linux, and Windows <strong>vagrant up --provision-with basetools,docker,minikube</strong></li><li><a href="https://hashiqube.com/newrelic-kubernetes-monitoring/?id=newrelic-kubernetes-monitoring">Newrelic Kubernetes Monitoring</a> — Monitor Kubernetes Clusters and Workloads with Newrelic</li><li><a href="https://hashiqube.com/docsify/?id=docsify">Docsify</a> — A magical documentation site generator <strong>vagrant up --provision-with basetools,docsify</strong></li><li><a href="https://hashiqube.com/mermaid/?id=mermaid">Mermaid</a> — Generation of diagram and flowchart from text in a similar manner as markdown</li><li><a href="https://hashiqube.com/prometheus-grafana/?id=prometheus-and-grafana">Prometheus</a> — Open-source monitoring system with dimensional data model, flexible query language, efficient time series database &amp; modern alerting <strong>vagrant up --provision-with basetools,docker,minikube,prometheus-grafana</strong></li><li><a href="https://hashiqube.com/prometheus-grafana/?id=prometheus-and-grafana">Grafana</a> — Grafana is the open source analytics &amp; monitoring solution for every database <strong>vagrant up --provision-with basetools,docker,minikube,prometheus-grafana</strong></li><li><a href="https://hashiqube.com/elasticsearch-kibana-cerebro/?id=elasticsearch-kibana-and-cerebro">Elasticsearch</a> — Elasticsearch is a search engine based on the Lucene library <strong>vagrant up --provision-with basetools,docker,elasticsearch-kibana-cerebro</strong></li><li><a href="https://hashiqube.com/elasticsearch-kibana-cerebro/?id=elasticsearch-kibana-and-cerebro">Kibana</a> — Kibana is an open source data visualization dashboard for Elasticsearch <strong>vagrant up --provision-with basetools,docker,elasticsearch-kibana-cerebro</strong></li><li><a href="https://hashiqube.com/elasticsearch-kibana-cerebro/?id=elasticsearch-kibana-and-cerebro">Cerebro</a> — Cerebro is the evolution of the previous Elasticsearch plugin Elasticsearch kopf <strong>vagrant up --provision-with basetools,docker,elasticsearch-kibana-cerebro</strong></li><li><a href="https://hashiqube.com/ansible-tower/?id=ansible-tower">AWX-Tower</a> — (AWX Tower is the Open Source version of Ansible Tower) Is a web-based solution that makes Ansible even more easy to use for IT teams of all kinds. It’s designed to be the hub for all of your automation tasks <strong>vagrant up --provision-with basetools,docker,minikube,ansible-tower</strong></li><li><a href="https://hashiqube.com/dbt/?id=dbt">Dbt</a> — Dbt is a data transformation tool that enables data analysts and engineers to transform, test and document data in the cloud data warehouse <strong>vagrant up --provision-with basetools,docker,postgresql,dbt</strong></li><li><a href="https://hashiqube.com/apache-airflow/?id=apache-airflow">Airflow</a> — Apache Airflow is an open-source workflow management platform for data engineering pipelines <strong>vagrant up --provision-with basetools,docker,docsify,postgresql,minikube,dbt,apache-airflow</strong></li><li><a href="https://hashiqube.com/visual-studio-code/?id=visual-studio-code">Visual-Studio-Code</a> — Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications <strong>vagrant up --provision-with basetools,docker,vscode-server</strong></li><li><a href="https://hashiqube.com/portainer/?id=portainer">Portainer</a> — A lightweight service delivery platform for containerized applications that can be used to manage Docker, Swarm, Kubernetes and ACI environments. It is designed to be as simple to deploy as it is to use <strong>vagrant up --provision-with basetools,docker,docsify,portainer</strong></li><li><a href="https://hashiqube.com/gitlab/?id=gitlab">Gitlab</a> — GitLab is a complete DevOps platform, delivered as a single application <strong>vagrant up --provision-with basetools,docker,docsify,minikube,gitlab</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TrGRULhh0yIxdNsB3RKEsA.png" /><figcaption>HashiQube runs many other Open Source Integrations</figcaption></figure><p>But how does it work? Well essentially Hashiqube is a Docker container (default) or a Virtual Machine.</p><p>Hashiqube has a Docker Daemon inside meaning we can run docker containers / pods inside Hashiqube using Kubernetes or Nomad or Docker run. So a docker container, with a docker daemon, running more docker containers… Inception!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O47Nc1pJeQVyfbrOeUCP4g.png" /></figure><p>Hashiqube runs on your local laptop, PC or a cloud instance.</p><p>Hashiqube runs all the Hashicorp products and other popular Open Source tools, such as Minikube, AWX Tower, Prometheus and Grafana and many, many more, See <a href="https://hashiqube.com/?id=hashiqube-integrations">Hashiqube Integrations</a></p><p>You can also run Hashiqube on AWS, GCP and Azure. This is called Hashiqube Multi-Cloud, see: <a href="https://hashiqube.com/multi-cloud/README">Multi-Cloud</a></p><p>Hashiqube is a Training / Development Lab for you to practise, learn or demo POC stuff with, it should not be run in production.</p><p>Hashiqube can be visualized with the diagrams below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WpA3mrHsKq4vb4Dl_0rg_A.png" /></figure><p>To get started is actually pretty easy!</p><p>We need to install Docker, Vagrant and Git! And that’s it!</p><ul><li>Docker — Download Docker from <a href="https://www.docker.com/products/docker-desktop">https://www.docker.com/products/docker-desktop</a> and install</li><li>Vagrant — Download Vagrant from <a href="https://www.vagrantup.com/downloads.html">https://www.vagrantup.com/downloads.html</a> and install</li><li>Using <strong>git</strong> - clone this repo <strong>git clone https://github.com/star3am/hashiqube.git</strong><a href="https://hashiqube.com/git/?id=git">What is Git?</a></li><li>Inside the local repo folder, do <strong>vagrant up --provision</strong> - This will setup, Vault, Nomad, Consul, Terraform, Localstack and Docker</li><li>Documentation locally available at <a href="http://localhost:3333/">http://localhost:3333</a></li></ul><p>In a follow-up article, I will go a bit deeper into the various integrations!</p><p>I hope Hashiqube helps you learn, test, debug and POC stuff in a quick and efficient way, and remember friends! Have fun while learning!</p><p>Thank you for your time, and I hope you have a great day!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*JyzsmgLm98cOApfsVwgL0g.png" /></figure><p>Hashicorp blog post: <a href="https://www.hashicorp.com/resources/hashiqube-a-development-lab-using-all-the-hashicorp-products">https://www.hashicorp.com/resources/hashiqube-a-development-lab-using-all-the-hashicorp-products</a><br>Hashiqube Website: <a href="https://hashiqube.com/">https://hashiqube.com</a><br>Hashiqube Github: <a href="https://github.com/star3am/hashiqube">https://github.com/star3am/hashiqube</a><br>Hashiqube Youtube: <a href="https://www.youtube.com/watch?v=6jGDAGWaFiw">https://www.youtube.com/watch?v=6jGDAGWaFiw</a><br>Hashiqube Medium: <a href="https://medium.com/search?q=hashiqube">https://medium.com/search?q=hashiqube</a><br>Hashiqube Terraform Registry module: <a href="https://registry.terraform.io/modules/star3am/hashiqube/hashicorp/latest">https://registry.terraform.io/modules/star3am/hashiqube/hashicorp/latest</a></p><p>About Riaan Nolan</p><p>My name is Riaan Nolan and I was born in South Africa. I started out as a Web Developer in 2000 and from there progressed into Systems Administration, with a strong focus on Automation, Infrastrtucture and Configuration as Code.</p><p>I have worked for Multi-National companies in Portugal, Germany, China, South Africa, United States and Australia.</p><p>I am a Hashicorp Ambassador, a Certified Terraform Instructor and a huge fan of DevOps!</p><p>You are welcome to connect with me on Linkedin <a href="https://www.linkedin.com/in/riaannolan/">https://www.linkedin.com/in/riaannolan/</a><br>Credly profile: <a href="https://www.credly.com/users/riaan-nolan.e657145c">https://www.credly.com/users/riaan-nolan.e657145c</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nz_BIBsWatEPgPWqIaGZUw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82edf7a5830f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running HashiQube on Multi-Arch (Arm and x86)/ Multi-OS (Linux, Mac, Windows) with Docker Desktop…]]></title>
            <link>https://medium.com/@riaan.nolan/running-hashiqube-on-multi-arch-arm-and-x86-multi-os-linux-mac-windows-with-docker-desktop-4695e152cacb?source=rss-6787fe1d57a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/4695e152cacb</guid>
            <category><![CDATA[hashiqube]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[weareservian]]></category>
            <category><![CDATA[multiarch]]></category>
            <category><![CDATA[hashicorp]]></category>
            <dc:creator><![CDATA[Riaan Nolan]]></dc:creator>
            <pubDate>Mon, 30 May 2022 02:21:38 GMT</pubDate>
            <atom:updated>2023-12-14T01:31:46.677Z</atom:updated>
            <content:encoded><![CDATA[<h3>Running HashiQube on Multi-Arch (Arm and x86)/ Multi-OS (Linux, Mac, Windows) with Docker Desktop and Vagrant</h3><p>With the arrival of the Apple Mac M1 Arm Chipsets, having a development environment that works for everyone became a little trickier.</p><p>First off, Virtualbox doesn’t run on Apple Mac M1 Arm Chipsets. That left me with just Docker, that can run somewhat consistently on Mac (Intel and Arm Chipsets), Windows and Linux.</p><p>But let’s see if we can run <a href="https://hashiqube.com/">Hashiqube</a> on Multi-Arch and Multi-OS consistently using a just Vagrant and Docker-Desktop ❤</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FsFiWzKbpEpU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DsFiWzKbpEpU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FsFiWzKbpEpU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/89848477d16303756e6cfb69a8dccd99/href">https://medium.com/media/89848477d16303756e6cfb69a8dccd99/href</a></iframe><p>A bit of history, 3 years ago I created <a href="https://hashiqube.com/">HashiQube</a> — A Development Lab Using All the HashiCorp Products.</p><ul><li><a href="https://github.com/star3am/hashiqube">https://github.com/star3am/hashiqube</a></li><li><a href="https://servian.dev/introducing-the-hashiqube-b84ab4d95a31">https://servian.dev/introducing-the-hashiqube-b84ab4d95a31</a></li><li><a href="https://www.hashicorp.com/resources/hashiqube-a-development-lab-using-all-the-hashicorp-products">https://www.hashicorp.com/resources/hashiqube-a-development-lab-using-all-the-hashicorp-products</a></li></ul><p>HashiQube has helped me and many others get to know HashiCorp products and how they work and how they integrate with many other services.</p><p>See:</p><ul><li><a href="https://adri-v.medium.com/just-in-time-nomad-configuring-hashicorp-nomad-vault-integration-on-hashiqube-388c14cb070a">https://adri-v.medium.com/just-in-time-nomad-configuring-hashicorp-nomad-vault-integration-on-hashiqube-388c14cb070a</a></li><li><a href="https://adri-v.medium.com/just-in-time-nomad-running-traefik-on-hashiqube-7d6dfd8ef9d8">https://adri-v.medium.com/just-in-time-nomad-running-traefik-on-hashiqube-7d6dfd8ef9d8</a></li></ul><p>HashiQube use <a href="http://vagrantup.com/docs/providers">Vagrant and it’s providers</a> such as, Docker, Virtualbox and Hyper-V to declare and run Virtual Machines or Docker Containers that have running, all the HashiCorp products, such as <a href="https://www.vaultproject.io/">Vault</a>, <a href="https://www.consul.io/">Consul</a>, <a href="https://www.nomadproject.io/">Nomad</a>, <a href="https://www.terraform.io/">Terraform</a>, <a href="https://www.hashicorp.com/sentinel">Sentinel</a>, <a href="https://www.packer.io/">Packer</a>, <a href="https://www.waypointproject.io/">Waypoint</a> and <a href="https://www.boundaryproject.io/">Boundary</a>.</p><figure><img alt="Hashiqube runs Vagrant, Packer, Terraform, Nomad, Consul, Vault, Waypoint and Boundary and as a bonus Sentinel." src="https://cdn-images-1.medium.com/max/1024/0*f1Cb-WNlnn3-P18v" /></figure><p>With the arrival of Mac ARM Apple chipset, I needed to run <a href="https://hashiqube.com/">HashiQube</a> on Multi-Arch and Multi-OS reliably. It took some time to figure it out lol.</p><p>My colleague, <a href="https://www.linkedin.com/in/greg-luxford/">Greg Luxford</a> send me a Medium article one day, and how that could possible be a solution <a href="https://betterprogramming.pub/managing-virtual-machines-under-vagrant-on-a-mac-m1-aebc650bc12c">https://betterprogramming.pub/managing-virtual-machines-under-vagrant-on-a-mac-m1-aebc650bc12c</a></p><p>And with some help from <a href="https://github.com/rofrano/vagrant-docker-provider">https://github.com/rofrano/vagrant-docker-provider</a></p><p>I was able to get a Dockerfile that worked on Mac ARM and Intel Chips. But I wanted to use Vagrant to orchestrate all of this for me, let’s see what we did to accomplish that.</p><pre># IMPORTANT:<br># <a href="https://developers.redhat.com/blog/2016/09/13/running-systemd-in-a-non-privileged-container">https://developers.redhat.com/blog/2016/09/13/running-systemd-in-a-non-privileged-container</a><br># <a href="https://github.com/containers/podman/issues/3295">https://github.com/containers/podman/issues/3295</a><br># --tmpfs /tmp : Create a temporary filesystem in /tmp<br># --tmpfs /run : Create another temporary filesystem in /run<br># --tmpfs /run/lock : Apparently having a tmpfs in /run isn’t enough – you ALSO need one in /run/lock<br># -v /sys/fs/cgroup:/sys/fs/cgroup:ro : Mount the CGroup kernel configuration values into the container<br># <a href="https://github.com/docker/for-mac/issues/6073">https://github.com/docker/for-mac/issues/6073</a><br># Docker Desktop now uses cgroupv2. If you need to run systemd in a container then:<br># * Ensure your version of systemd supports cgroupv2. It must be at least systemd 247. Consider upgrading any centos:7 images to centos:8.<br># * Containers running systemd need the following options: --privileged --cgroupns=host -v /sys/fs/cgroup:/sys/fs/cgroup:rw.# <a href="https://betterprogramming.pub/managing-virtual-machines-under-vagrant-on-a-mac-m1-aebc650bc12c">https://betterprogramming.pub/managing-virtual-machines-under-vagrant-on-a-mac-m1-aebc650bc12c</a></pre><pre>config.vm.provider &quot;docker&quot; do |docker, override|<br>  override.vm.box        = nil<br>  docker.build_dir       = &quot;.&quot;<br>  docker.remains_running = true<br>  docker.has_ssh         = true<br>  docker.privileged      = true<br>  # BUG: <a href="https://github.com/hashicorp/vagrant/issues/12602">https://github.com/hashicorp/vagrant/issues/12602</a><br>  # moved to create_args<br>  # docker.volumes         = [&#39;/sys/fs/cgroup:/sys/fs/cgroup:rw&#39;]<br>  docker.create_args     = [&#39;-v&#39;, &#39;/sys/fs/cgroup:/sys/fs/cgroup:rw&#39;, &#39;--cgroupns=host&#39;, &#39;--tmpfs=/tmp:exec&#39;, &#39;--tmpfs=/var/lib/docker:mode=0777,dev,size=15g,suid,exec&#39;, &#39;--tmpfs=/run&#39;, &#39;--tmpfs=/run/lock&#39;] # &#39;--memory=10g&#39;, &#39;--memory-swap=14g&#39;, &#39;--oom-kill-disable&#39;<br>}<br>end</pre><p>Let’s get our tools together, we will need</p><ul><li>Vagrant <a href="https://www.vagrantup.com/downloads.html">https://www.vagrantup.com/downloads.html</a></li><li>Docker Desktop <a href="https://www.docker.com/products/docker-desktop">https://www.docker.com/products/docker-desktop</a></li><li>Git to clone <a href="https://github.com/star3am/hashiqube">https://github.com/star3am/hashiqube</a></li></ul><p>Vagrant is really the “Scaffolding in Code”, so we are able to use Vagrant to:</p><ul><li>Entirely define a machine’s state in code</li><li>Utilize provisioners to modularize a solution</li><li>Utilize providers on different Operating Systems and Architectures</li></ul><p>Consider being able to run the following commands on Mac Intel, Linux, Windows, Mac ARM machines.</p><ul><li>vagrant up — provision-with basetools — provider docker</li><li>vagrant up — provision-with vault— provider docker</li><li>vagrant up — provision-with docker — provider docker</li><li>vagrant up — provision-with nomad — provider docker</li><li>vagrant up — provision-with consul — provider docker</li><li>vagrant up — provision-with terraform — provider docker</li></ul><p>As you can probably tell by now, we want to run a Docker daemon on our Laptop or personal computer (that runs HashiQube), but also want to run a Docker daemon inside of the Container or VM (that is used by Nomad or Minikube to run containers)</p><p>Let’s Check our Docker Client and Server versions on our Mac</p><pre><strong>➜  hashiqube</strong> <strong>git:(master) </strong>docker info</pre><pre>Client:<br>Context:    default<br>Debug Mode: false<br>Plugins:<br>buildx: Docker Buildx (Docker Inc., v0.8.2)<br>compose: Docker Compose (Docker Inc., v2.5.0)<br>sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)<br>scan: Docker Scan (Docker Inc., v0.17.0)</pre><pre>Server:<br>Containers: 3<br>Running: 2<br>Paused: 0<br>Stopped: 1<br>Images: 74<br>Server Version: 20.10.14<br>Storage Driver: overlay2<br>Backing Filesystem: extfs<br>Supports d_type: true<br>Native Overlay Diff: true<br>userxattr: false<br>Logging Driver: json-file<br>Cgroup Driver: cgroupfs<br>Cgroup Version: 2</pre><p>Let’s list our containers using docker ps</p><pre><strong>➜  hashiqube</strong> <strong>git:(master)</strong> docker ps</pre><pre>CONTAINER ID   IMAGE          COMMAND            CREATED        STATUS        PORTS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  NAMES</pre><pre>a37c18acc230   01d990ee1dba   &quot;/usr/sbin/init&quot;   44 hours ago   Up 16 hours   0.0.0.0:1433-&gt;1433/tcp, 0.0.0.0:3000-&gt;3000/tcp, 0.0.0.0:3306-&gt;3306/tcp, 0.0.0.0:3333-&gt;3333/tcp, 0.0.0.0:4566-&gt;4566/tcp, 0.0.0.0:4646-&gt;4646/tcp, 0.0.0.0:5001-5002-&gt;5001-5002/tcp, 0.0.0.0:5432-&gt;5432/tcp, 0.0.0.0:5580-&gt;5580/tcp, 0.0.0.0:5601-5602-&gt;5601-5602/tcp, 0.0.0.0:8043-&gt;8043/tcp, 0.0.0.0:8088-&gt;8088/tcp, 0.0.0.0:8200-&gt;8200/tcp, 0.0.0.0:8500-&gt;8500/tcp, 0.0.0.0:8800-&gt;8800/tcp, 0.0.0.0:8888-8889-&gt;8888-8889/tcp, 0.0.0.0:9000-9002-&gt;9000-9002/tcp, 0.0.0.0:9011-&gt;9011/tcp, 0.0.0.0:9022-&gt;9022/tcp, 0.0.0.0:9080-9081-&gt;9080-9081/tcp, 0.0.0.0:9090-&gt;9090/tcp, 0.0.0.0:9093-&gt;9093/tcp, 0.0.0.0:9200-&gt;9200/tcp, 0.0.0.0:9333-&gt;9333/tcp, 0.0.0.0:9443-&gt;9443/tcp, 0.0.0.0:9702-&gt;9702/tcp, 0.0.0.0:9998-9999-&gt;9998-9999/tcp, 0.0.0.0:10888-&gt;10888/tcp, 0.0.0.0:18888-&gt;18888/tcp, 0.0.0.0:19200-&gt;19200/tcp, 0.0.0.0:19702-&gt;19702/tcp, 0.0.0.0:31506-&gt;31506/tcp, 0.0.0.0:32022-&gt;32022/tcp, 0.0.0.0:8600-&gt;8600/udp, 0.0.0.0:2255-&gt;22/tcp, 0.0.0.0:33389-&gt;389/tcp, 0.0.0.0:4443-&gt;443/tcp, 0.0.0.0:5005-&gt;50001/tcp   hashiqube_hashiqube0serviceconsul_1653711358</pre><p>And finally let’s check our Docker Client and Server versions inside that container, using Vagrant.</p><pre><strong>➜  hashiqube</strong> <strong>git:(master)</strong> vagrant ssh -c &quot;docker info&quot;</pre><pre>Client:<br>Context:    default<br>Debug Mode: false<br>Plugins:<br>app: Docker App (Docker Inc., v0.9.1-beta3)<br>buildx: Docker Buildx (Docker Inc., v0.8.2-docker)<br>scan: Docker Scan (Docker Inc., v0.17.0)</pre><pre>Server:<br>Containers: 2<br>Running: 2<br>Paused: 0<br>Stopped: 0<br>Images: 7<br>Server Version: 20.10.16<br>Storage Driver: overlay2<br>Backing Filesystem: tmpfs<br>Supports d_type: true<br>Native Overlay Diff: true<br>userxattr: false<br>Logging Driver: json-file<br>Cgroup Driver: systemd<br>Cgroup Version: 2</pre><p>and Docker Exec</p><pre><strong>➜  hashiqube</strong> <strong>git:(master)</strong> docker exec -it a37c18acc230 /bin/bash -c &quot;docker info&quot;</pre><pre>Client:<br>Context:    default<br>Debug Mode: false<br>Plugins:<br>app: Docker App (Docker Inc., v0.9.1-beta3)<br>buildx: Docker Buildx (Docker Inc., v0.8.2-docker)<br>scan: Docker Scan (Docker Inc., v0.17.0)</pre><pre>Server:<br>Containers: 2<br>Running: 2<br>Paused: 0<br>Stopped: 0<br>Images: 7<br>Server Version: 20.10.16<br>Storage Driver: overlay2<br>Backing Filesystem: tmpfs<br>Supports d_type: true<br>Native Overlay Diff: true<br>userxattr: false<br>Logging Driver: json-file<br>Cgroup Driver: systemd<br>Cgroup Version: 2</pre><p>What made this all work was the TempFs and cgroup volumes we mount inside the container using TempFs and mount arguments, without this line, the Storage driver inside the container was VFS (Painfully slow) — with this config I was able to get OverlayFs on top of TempFs, for info see: <a href="https://docs.docker.com/storage/storagedriver/select-storage-driver/">https://docs.docker.com/storage/storagedriver/select-storage-driver/</a></p><pre>--tmpfs=/var/lib/docker:mode=0777,dev,size=15g,suid,exec</pre><p>I was unable to boot the container without this line</p><pre>-v /sys/fs/cgroup:/sys/fs/cgroup:rw</pre><p>Let’s bring it up and see what it looks like, we will start with bringing up the image: <strong>generic/ubuntu2004</strong></p><pre>vagrant up --provision-with basetools --provider docker<br>vagrant up --provision-with docker --provider docker<br>vagrant up --provision-with docsify --provider docker<br>vagrant up --provision-with vault --provider docker<br>vagrant up --provision-with consul --provider docker<br>vagrant up --provision-with nomad --provider docker</pre><p>and this will allow you to ssh into the container like so:</p><pre>vagrant ssh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GpuWiOaTqrntnKl1mMOhQQ.png" /></figure><p>Access Documentation on <a href="http://localhost:3333/">http://localhost:3333/</a></p><pre>vagrant up --provision-with docsify --provider docker</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CFTR5o_Yj5GDIEKNvLqpNw.png" /></figure><pre>vagrant up --provision-with consul --provider docker</pre><p>Access Consul on <a href="http://localhost:8500/">http://localhost:8500/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X74yOiAAtoHgw7o0VVBFGw.png" /></figure><pre>vagrant up --provision-with vault --provider docker</pre><p>Access Vault on <a href="http://localhost:8200/">http://localhost:8200/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LTBShN3p_j8L17yFYfHzQA.png" /></figure><pre>vagrant up --provision-with nomad --provider docker</pre><p>Access Nomad on <a href="http://localhost:4646/">http://localhost:4646/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R18R_RodJ1o8hjhryY2Zdw.png" /></figure><pre>vagrant up --provision-with waypoint --provider docker</pre><p>Access Waypoint on <a href="https://localhost:9702/">https://localhost:9702/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cjcl8bwaSrmg8n0MOv0FrQ.png" /></figure><p>Things that tripped me up while trying to get this to work was:</p><ul><li>WSL2 wrong volume mounts and unable to boot Ubuntu 20.04</li><li>Vagrant Box that supports, Virtualbox, Hyper-V and Docker</li><li>OOM Killed Containers</li><li>OverlayFS on top of OverlayFS (Docker daemon running inside docker container)</li><li>Cgroups</li></ul><p>Links that helped me throughout this project</p><ul><li><a href="https://betterprogramming.pub/managing-virtual-machines-under-vagrant-on-a-mac-m1-aebc650bc12c">https://betterprogramming.pub/managing-virtual-machines-under-vagrant-on-a-mac-m1-aebc650bc12c</a></li><li><a href="https://developers.redhat.com/blog/2016/09/13/running-systemd-in-a-non-privileged-container">https://developers.redhat.com/blog/2016/09/13/running-systemd-in-a-non-privileged-container</a></li><li><a href="https://github.com/containers/podman/issues/3295">https://github.com/containers/podman/issues/3295</a></li><li><a href="https://github.com/docker/for-mac/issues/6073">https://github.com/docker/for-mac/issues/6073</a></li><li><a href="https://github.com/hashicorp/vagrant/issues/12602"><em>https://github.com/hashicorp/vagrant/issues/12602</em></a></li><li><a href="https://docs.docker.com/buildx/working-with-buildx/">https://docs.docker.com/buildx/working-with-buildx/</a></li></ul><p>As a BONUS! While testing Waypoint, I had the opportunity to bring up Minikube as well, let’s see how that works.</p><pre>vagrant up --provision-with minikube --provider docker</pre><p>Access Minikube Dashboard on <a href="http://localhost:10888/">http://localhost:10888</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mabzZZaqKDgxNjsr51gyMw.png" /></figure><pre><strong>vagrant@hashiqube0</strong>:<strong>~</strong>$ kubectl get po,svc -A</pre><pre>NAMESPACE              NAME                                            READY   STATUS      RESTARTS      AGE<br>default                pod/hello-minikube-7bc9d7884c-2sjk9             1/1     Running     0             12m<br>ingress-nginx          pod/ingress-nginx-admission-create-wj4n9        0/1     Completed   0             14m<br>ingress-nginx          pod/ingress-nginx-admission-patch-2p9rt         0/1     Completed   0             14m<br>ingress-nginx          pod/ingress-nginx-controller-cc8496874-2hm9g    1/1     Running     0             14m<br>kube-system            pod/coredns-64897985d-j6r5t                     1/1     Running     0             14m<br>kube-system            pod/etcd-minikube                               1/1     Running     0             14m<br>kube-system            pod/kube-apiserver-minikube                     1/1     Running     0             14m<br>kube-system            pod/kube-controller-manager-minikube            1/1     Running     0             14m<br>kube-system            pod/kube-proxy-4t86q                            1/1     Running     0             14m<br>kube-system            pod/kube-scheduler-minikube                     1/1     Running     0             14m<br>kube-system            pod/registry-88qj5                              1/1     Running     0             13m<br>kube-system            pod/registry-proxy-nd78l                        1/1     Running     0             13m<br>kube-system            pod/storage-provisioner                         1/1     Running     1 (14m ago)   14m<br>kubernetes-dashboard   pod/dashboard-metrics-scraper-58549894f-kzsv6   1/1     Running     0             12m<br>kubernetes-dashboard   pod/kubernetes-dashboard-ccd587f44-962t5        1/1     Running     0             12m</pre><pre>NAMESPACE              NAME                                         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE<br>default                service/hello-minikube                       NodePort    10.100.135.91   &lt;none&gt;        8080:30559/TCP               12m<br>default                service/kubernetes                           ClusterIP   10.96.0.1       &lt;none&gt;        443/TCP                      15m<br>ingress-nginx          service/ingress-nginx-controller             NodePort    10.96.220.171   &lt;none&gt;        80:30342/TCP,443:32452/TCP   14m<br>ingress-nginx          service/ingress-nginx-controller-admission   ClusterIP   10.99.54.83     &lt;none&gt;        443/TCP                      14m<br>kube-system            service/kube-dns                             ClusterIP   10.96.0.10      &lt;none&gt;        53/UDP,53/TCP,9153/TCP       15m<br>kube-system            service/registry                             ClusterIP   10.97.119.219   &lt;none&gt;        80/TCP,443/TCP               13m<br>kubernetes-dashboard   service/dashboard-metrics-scraper            ClusterIP   10.97.74.188    &lt;none&gt;        8000/TCP                     12m<br>kubernetes-dashboard   service/kubernetes-dashboard                 ClusterIP   10.96.193.213   &lt;none&gt;        80/TCP                       12m</pre><p>Having a consistent Developer Lab defined in code enables you to:</p><ul><li>Get Developer started and setup in a short time</li><li>Consistent Environments creates less surprises in Production</li><li>Being able to test many different versions with other integrations quickly</li></ul><p>And that’s a wrap for now folks, hope you enjoyed this as much as I did, and I hope it helps you to create a consistent Developer Lab, that runs on Multi-Arch and Multi OS environments.</p><p>For more information see <a href="https://hashiqube.com/">https://hashiqube.com</a> or <a href="https://github.com/star3am/hashiqube">https://github.com/star3am/hashiqube</a> and my Linkedin profile <a href="https://www.linkedin.com/in/riaannolan/">https://www.linkedin.com/in/riaannolan/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/0*l4qOtbVzozM67_Yr" /></figure><p>#weareservian #hashicorp #hashiqube #vault #nomad #consul #waypoint #kubernetes</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4695e152cacb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>