<?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 David van der Spek on Medium]]></title>
        <description><![CDATA[Stories by David van der Spek on Medium]]></description>
        <link>https://medium.com/@vanderspek-david?source=rss-993e094daf71------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fOlveQAy9tSkNRLpaN1dVw.jpeg</url>
            <title>Stories by David van der Spek on Medium</title>
            <link>https://medium.com/@vanderspek-david?source=rss-993e094daf71------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 01:11:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vanderspek-david/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[Deploying Kubeflow 1.3 RC with Argo CD]]></title>
            <link>https://medium.com/data-science/deploying-kubeflow-1-3-rc-with-argo-cd-ca98606b98eb?source=rss-993e094daf71------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca98606b98eb</guid>
            <category><![CDATA[kubeflow]]></category>
            <category><![CDATA[argo]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[argo-cd]]></category>
            <dc:creator><![CDATA[David van der Spek]]></dc:creator>
            <pubDate>Sun, 04 Apr 2021 16:00:24 GMT</pubDate>
            <atom:updated>2021-04-15T20:48:06.970Z</atom:updated>
            <content:encoded><![CDATA[<h4>Simplifying and automating the deployment of Kubeflow with GitOps</h4><p>Kubeflow is a popular open-source Machine Learning platform that runs on Kubernetes. Kubeflow streamlines many valuable ML workflows i.e. it allows users to easily deploy development environments, scalable ML workflows with Kubeflow Pipelines, automated hyper-parameter tuning and neural architecture search with Katib, easy collaboration within teams and much more. With a such a large number of features also comes complexity. A full Kubeflow deployment contains many services and dependencies, making it difficult for users to customize, manage and install Kubeflow using the legacy <a href="https://github.com/kubeflow/kfctl">kfctl</a> CLI tool and a KfDef YAML file. For this reason, the upcoming Kubeflow 1.3 release has stopped using <a href="https://github.com/kubeflow/kfctl">kfctl</a> and instead is using standard <a href="https://kustomize.io/">Kustomize</a>, making it easier to deploy Kubeflow with GitOps tools such as <a href="https://argoproj.github.io/argo-cd/">Argo CD</a>.</p><p><a href="https://argoproj.github.io/projects/argo-cd/">Argo CD</a> is “a declarative, GitOps continuous delivery tool for Kubernetes”. The <a href="https://argoproj.github.io/">Argo Project</a> is already closely related to Kubeflow, as Kubeflow Pipelines uses <a href="https://argoproj.github.io/projects/argo">Argo Workflows</a> behind the scenes, making <a href="https://argoproj.github.io/projects/argo-cd">Argo CD</a> a natural choice for deploying Kubeflow. A quick description of GitOps is the use of a Git repository as the source of truth for the desired state of a deployment. A Continuous Delivery tool such as <a href="https://argoproj.github.io/projects/argo-cd">Argo CD</a> then monitors the Git repository for changes and updates deployment if needed.</p><p>The code and manifests needed to follow this guide can be found at <a href="https://github.com/argoflow/argoflow">https://github.com/argoflow/argoflow</a>. The deployment should be compatible with any Kubernetes cluster both on-premises and in the cloud. Note - While some extra manifests are included to make on-premises deployments a bit easier, such as <a href="https://metallb.universe.tf/">MetalLB</a> and <a href="https://rook.io/">Rook Ceph</a>, these are disabled by default.</p><h3>Preparation</h3><p>The first step is to fork the <a href="https://github.com/argoflow/argoflow">ArgoFlow</a> repository and clone it locally. Next, you will need to have <a href="https://github.com/mikefarah/yq">yq</a> version 4 installed to use the scripts that allows you to easily setup your fork and <a href="https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize%2Fv4.0.5">Kustomize v4.0.5</a> to install Argo CD with the provided manifests. Access to a Kubernetes cluster is of course also a requirement. This can be done locally with tools such as <a href="https://minikube.sigs.k8s.io/docs/start/">minikube</a>, <a href="https://kind.sigs.k8s.io/">kind</a> or <a href="https://microk8s.io/">MicroK8s</a>, with VMs or in the cloud. However, setting up a Kubernetes cluster is out of the scope of this article.</p><h3>Installing Argo CD</h3><p>For the sake of simplicity, Argo CD will be installed on the same cluster as Kubeflow. The release candidate of <a href="https://blog.argoproj.io/argo-cd-v2-0-rc1-is-here-f7d21ff1aa64">Argo CD 2.0</a> in HA mode is used as I like to stay up to date with software. A few optimizations were done to the Argo CD configuration along with including the v4.0.5 of Kustomize, the latest version at the time of writing.</p><p>After cloning your fork of <a href="https://github.com/argoflow/argoflow">ArgoFlow</a> locally, you can install Argo CD by executing the following command from within the <a href="https://github.com/argoflow/argoflow">ArgoFlow</a> folder:</p><p>kustomize build argocd/ | kubectl apply -f -</p><p>Next install the Argo CD <a href="https://github.com/argoproj/argo-cd/releases/latest">CLI</a> tool locally. To access the Argo CD UI, you can expose its service using a LoadBalancer, Ingress or connect to it using kubectl and port forwarding. The Argo CD <a href="https://argoproj.github.io/argo-cd/getting_started/">getting started page</a> has more instructions on how to do this.</p><p>Next, get the default password for the admin user by executing the following command:</p><p>kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath=”{.data.password}” | base64 -d</p><p>You can now login with the Argo CD CLI tool and change the default password as follows:</p><p>argocd login &lt;ARGOCD_SERVER&gt; # e.g. localhost:8080 or argocd.example.com</p><p>argocd account update-password</p><p>You should now be able to login to the Argo CD UI with your new password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6QKYGIiOUjo3XlexMjab3g.png" /><figcaption>Argo CD Web Interface</figcaption></figure><h3>Customizing the Kubeflow deployment</h3><p>The manifests have been setup with some default values to help new users get started, but should be changed by most people. For example, users should change the password for the default user and setup an issuer in cert-manager to create proper certificates for the Istio ingress gateway. Another thing many people will likely need to change is the ingress gateway service, which is setup to use a LoadBalancer by default. In the spirit of keeping this article clear and to the point, I will not go into details how to change these settings here as it would involve a lot of links to files. The <a href="https://github.com/argoflow/argoflow/blob/master/README.md">README</a> in the <a href="https://github.com/argoflow/argoflow">ArgoFlow</a> repository provides instructions for changing these aspects of the deployment.</p><h4>Getting ready to deploy Kubeflow</h4><p>Along with the Kustomize manifests for the different Kubeflow components, the <a href="https://github.com/argoflow/argoflow">ArgoFlow</a> repository also contains Argo CD application specifications for each one of the Kubeflow components. To make it easier for people to select and deploy the components they want, a kustomization.yaml file located in the root repository is used to define which Argo CD applications should be deployed. In turn, the kubeflow.yaml file in the root of the repository is an Argo CD application for the previously mentioned kustomization.yaml file. Simply put, it is an Argo CD application that deploys other Argo CD applications.</p><p>Next, the Argo CD application specifications need to be edited so they point to your fork of the <a href="https://github.com/argoflow/argoflow">ArgoFlow</a> repository. A script is included to make this easier. In the root of the repository, simply run the following command to update all the application specs to point to your fork of the repository:</p><p>./setup_repo.sh &lt;your_repo_fork_url&gt;</p><p><strong>Bonus: Extending the Volumes Web App with a File Browser</strong></p><p>A large problem for many people is how to easily upload or download data to and from the PVCs mounted as their workspace volumes for Notebook Servers. To make this easier a simple PVCViewer Controller was created (a slightly modified version of the tensorboard-controller). The PVC Viewer will work with ReadWriteOnce PVCs, even when they are mounted to an active Notebook Server. This feature was not ready in time for 1.3, and thus I am only documenting it here as an experimental feature as I believe many people would like to have this functionality. It is not (yet) part of upstream Kubeflow and might change in the future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*alybnF3dDIZZTvubroiBiw.gif" /><figcaption>Demo of the PVC Viewer in action</figcaption></figure><p>If you would like to deploy this feature, you need to comment out the argocd-applications/volumes-web-app.yaml entry in the root kustomization.yaml file and uncomment the following two lines:</p><pre>- argocd-applications/experimental-pvcviewer-controller.yaml</pre><pre>- argocd-applications/experimental-volumes-web-app.yaml</pre><p>Once you are done customizing the deployment, simply commit and push your changes to your fork of the <a href="https://github.com/argoflow/argoflow">ArgoFlow</a> repository.</p><h3>Deploying Kubeflow</h3><p>After committing and pushing your changes you can install Kubeflow by executing:</p><p>kubectl apply -f kubeflow.yaml</p><p>It is also possible to install the components manually. For example:</p><p>kubectl apply -f argocd-applications/kubeflow-roles-namespaces.yaml</p><p>You should now start seeing applications appear in the Argo CD UI, and if all goes well they should be “Healthy” and “Synced”. Due to the large amount of resources in a Kubeflow deployment and some chicken &amp; egg scenarios some applications might stay “Out of Sync” for a bit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DMK-5RqsaZaEl8xWA_c-Ww.png" /><figcaption>Kubeflow Component Applications in Argo CD</figcaption></figure><p>By clicking on an application Argo CD presents you with an overview of all the resources created by this application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MivJLVFlLISnTr805a6TKw.png" /><figcaption>Overview of the Jupyter Web App resources in Argo CD</figcaption></figure><p>By clicking on any of the resources Argo CD will show you useful information such as the diff between the currently deployed YAML and what is declared in the Git repository or the logs of a pod.</p><h4>Updating your deployment</h4><p>To update or change your deployment, simply commit and push your changes to your repository and Argo CD will automatically detect and change the deployment in your Kubernetes cluster.</p><h3>Conclusion</h3><p>As the upcoming release of Kubeflow 1.3 uses standard Kustomize, this makes it easier to use tools such as Argo CD to manage its deployment. Furthermore, due to the size and complexity of Kubeflow, a declarative approach using GitOps and Argo CD should make it easier for users to customize and deploy Kubeflow suited to their needs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca98606b98eb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/deploying-kubeflow-1-3-rc-with-argo-cd-ca98606b98eb">Deploying Kubeflow 1.3 RC with Argo CD</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy OpenStack Ussuri on Focal with MAAS 2.8 and Juju]]></title>
            <link>https://vanderspek-david.medium.com/deploy-openstack-ussuri-on-focal-with-maas-2-8-and-juju-9812a3f75a37?source=rss-993e094daf71------2</link>
            <guid isPermaLink="false">https://medium.com/p/9812a3f75a37</guid>
            <category><![CDATA[juju]]></category>
            <category><![CDATA[canonical]]></category>
            <category><![CDATA[openstack-private-cloud]]></category>
            <category><![CDATA[openstack]]></category>
            <dc:creator><![CDATA[David van der Spek]]></dc:creator>
            <pubDate>Thu, 03 Sep 2020 11:32:46 GMT</pubDate>
            <atom:updated>2021-02-10T12:24:43.782Z</atom:updated>
            <content:encoded><![CDATA[<p>Due to the global pandemic my internship for my Master’s Degree in Bio-Pharmaceutical Sciences was abruptly interrupted. In an effort to find a project that be compatible in today’s remote working environment I turned to my life long hobby of computers and IT. The journey started with <a href="https://www.kubeflow.org/">Kubeflow</a> which is a platform for “making deployments of machine learning workflows on <a href="https://kubernetes.io/">Kubernetes</a> simple, portable and scalable” and centers around Jupyter Notebooks which are used by the computational scientists at the faculty were I was doing my internship. However, due to the limited memory capacity I have in my home server I was facing issues when trying to run a somewhat production ready <a href="https://kubernetes.io/">Kubernetes</a> cluster for deploying <a href="https://www.kubeflow.org/">Kubeflow</a> setup for multiple users. After going out and buying 3 used Dell R620 servers for a very good price I investigated what platform would allow me to get the most out of my new servers in terms of deployment flexibility and deploying a production ready Kubernetes cluster for Kubeflow. <a href="https://xcp-ng.org/">XCP-ng</a> and <a href="https://www.proxmox.com/en/">Proxmox</a> came to mind, however, I stumbled on a blog by <a href="https://www.2stacks.net/blog/bare-metal-to-kubernetes-part-1/">2stacks</a> which encouraged me to look into <a href="https://www.openstack.org/">OpenStack</a>. While following his guides I decided to do things slightly differently from the start, as I chose to use the latest <a href="https://jaas.ai/openstack-base/bundle/70">official bundle </a>of charmed OpenStack and Ubuntu 20.04 (Focal Fossa). Needless to say, this came with it’s own difficulties and learning curve. Especially once I took a look at the <a href="https://www.dellemc.com/resources/en-us/asset/technical-guides-support-information/solutions/canonical-charmed-openstack-on-dellemc-hardware.pdf">reference OpenStack architecture</a> by Dell and Canonical and decided I wanted to try and achieve a similar type of deployment, although lacking the high availability. This led me to Dimiter Naydenov’s excellent <a href="http://blog.naydenov.net/2015/11/deploying-openstack-on-maas-1-9-with-juju-network-setup/">blog</a> where he goes into great detail of the more advanced VLAN setup seen in the reference OpenStack architecture from <a href="https://www.delltechnologies.com/en-us/index.htm">Dell</a> and <a href="https://canonical.com/">Canonical</a>. After spending countless hours with digging through documentation and bug reports while referencing the previously mentioned blogs and the reference OpenStack architecture by Dell and Canonical I’ve come to the point where I would like to give back to the community with my findings and an updated and expanded guide for deploying OpenStack using <a href="https://maas.io/">MAAS</a> 2.8.1 and <a href="https://juju.is/">Juju</a>.</p><h4>Objective</h4><p>Provide an easy to follow and complete guide for deploying a more production ready version of charmed OpenStack while continuing to use the official OpenStack bundles. Just like the reference OpenStack architecture by Dell and Canonical, the MAAS node will be used as a KVM host managed by MAAS. This enables us to deploy the Juju controller needed for deploying OpenStack to a VM on the MAAS node. At a later point we will also look at deploying logging, monitoring and alarming applications to one or multiple VM(s) on the MAAS node, again similar to the reference OpenStack architecture by Dell and Canonical.</p><h4>Hardware requirements</h4><ul><li>1 x Managed switch (switch with VLAN support), a second switch can simplify the configuration but is not required</li><li>1 x Physical host with two network interface for MAAS (this can also be a VM if your host supports nested virtualization)</li><li>3 x Physical hosts for OpenStack with each two network interfaces and two storage disks</li><li>1 x Router or Firewall that can provide internet access and routing between VLANs.</li></ul><h4>Networking</h4><p>In this deployment the network layout by Dimiter Naydenov will be used, which is similar to the Dell and Canonical reference OpenStack architecture. Without going into too much detail regarding the Juju/MAAS network model, as these can be found in the linked blog post and the official documentation, a few terms are of particular importance. <br><strong>Spaces: “</strong>A space is a logical grouping of subnets that can communicate with one another.”<br><strong>VLAN: “</strong><a href="https://maas.io/docs/concepts-and-terms">A common way to create logically separate networks using the same physical infrastructure.</a>”<br><strong>Fabrics:</strong> A means of connect and allow communication between VLANs.</p><h4>OpenStack network layout</h4><p>The following overview of the typical networks in an OpenStack deployment have been adapted from Dimiter Naydenov’s <a href="http://blog.naydenov.net/2015/11/deploying-openstack-on-maas-1-9-with-juju-network-setup/">blog</a>. While they might be slightly outdated they are still very relevant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*hNxt51fE5aNobYxTgGkQcw.png" /><figcaption>The 7 different networks typically seen in an OpenStack deployment</figcaption></figure><ul><li><strong>admin</strong> — used for admin-level access to services, including for automating administrative tasks.</li><li><strong>internal</strong> — used for internal endpoints and communications between most of the services.</li><li><strong>public</strong> — used for public service endpoints, e.g. using the OpenStack CLI to upload images to glance.</li><li><strong>external</strong> — used by neutron to provide outbound access for tenant networks.</li><li><strong>data</strong> — used mostly for guest compute traffic between VMs an between VMs and OpenStack services.</li><li><strong>storage(data)</strong> — used by clients of the Ceph/Swift storage backend to consume block and object storage contents.</li><li><strong>storage(cluster)</strong> — used for replicating persistent storage data between units of Ceph/Swift.</li></ul><p>The admin network is not shown in the above diagram to make it more clear. However, each application is also connected to the admin network (except the storage cluster unit?).</p><p>These separate network will be mapped to various spaces in MAAS and Juju for the OpenStack deployment. An overview of the mapping of OpenStack applications to MAAS/Juju spaces that was adapted from Dimiter Naydenov’s <a href="http://blog.naydenov.net/2015/11/deploying-openstack-on-maas-1-9-with-juju-network-setup/">blog</a> can be found below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*38dDfCFW0plb1uOCyI5vDQ.png" /><figcaption>OpenStack application mapped to MAAS/Juju spaces</figcaption></figure><ul><li><strong>default</strong> space is used for MAAS PXE booting and Juju API servers.</li><li><strong>admin-api</strong> space represents the OpenStack <strong>admin</strong> network</li><li><strong>internal-api</strong> space represents the OpenStack <strong>internal</strong> network.</li><li><strong>public-api</strong> space represents the OpenStack <strong>public</strong> network.</li><li><strong>storage-data</strong> space represents the OpenStack <strong>storage client</strong> network.</li><li><strong>storage-cluster</strong> space represents the OpenStack <strong>storage cluster</strong> network.</li><li><strong>compute-data</strong> space represents the OpenStack <strong>data</strong> network.</li><li><strong>compute-external</strong> space represents the OpenStack <strong>external</strong> network.</li></ul><p>Each network will be created using a VLAN and have a unique subnet assigned to it. In my personal deployment I have two additional VLANs, one for IPMI for MAAS to manage power to the servers and one for the default space to negate the need for a second switch.</p><h4>Physical network layout</h4><p>In this setup, the MAAS node functions as a router/firewall and provides DNS and DHCP for all VLANs except for the public and external VLANs. The MAAS node will be setup to route the traffic from its secondary network interface connected to the VLANS to the router through its primary interface. It is a requirement that MAAS provides internet connectivity to the VLANs it manages to be able to properly deploy OpenStack. To avoid the need for a second switch, the default network is set to VLAN 2 on ports 3 to 9. This means that on these ports, VLAN 2 will need to be set as the untagged network and thus these ports do not have access to the existing network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZaIhcf67NMLqZC7tb15vjw.png" /><figcaption>Physical network connections and VLAN allocations</figcaption></figure><p>The following VLANs with their accompanying <a href="https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing">CIDR</a> will be configured in the switch. The above physical network diagram does not show the out-of-band management (OOBM) ports as this can differ between devices. For my setup, I have iDRAC7 Enterprise which has a dedicated <a href="https://en.wikipedia.org/wiki/Network_interface_controller">NIC</a> and has been setup to use VLAN 11. Older versions of iDRAC do not support this setting to my knowledge, which would require the ethernet ports on the switch that connects to the iDRAC controller of each server to have the untagged (default) network set to VLAN 11.</p><ul><li>default (for PXE boot): <strong>10.14.0.0/20</strong> (VID: 2)</li><li>public: <strong>10.50.0.0/20</strong> (VID: 50)</li><li>internal: <strong>10.100.0.0/20</strong> (VID:100)</li><li>admin: <strong>10.150.0.0/20</strong> (VID:150)</li><li>storage (for client data): <strong>10.200.0.0/20</strong> (VID:200)</li><li>compute (for guest VM data): <strong>10.250.0.0/20</strong> (VID:250)</li><li>external (for guest VM outbound): <strong>10.99.0.0/20</strong> (VID:99)</li><li>cluster (for storage replication): <strong>10.30.0.0/20</strong> (VID:30)</li><li>OOBM/IPMI (for power control: <strong>192.168.11.0/24</strong> (VID:11)</li></ul><h3>MAAS node installation and configuration</h3><p>The first step to setting up the MAAS node is to install the latest version of Ubuntu Server 20.04. The networking settings can be left as default as long as the server has a working connection to the internet for updates. After installing Ubuntu Server and rebooting the first we need to do is enable the netplan network configuration to be persistent. This can be done with the command echo “network: {config: disabled}” &gt; /etc/cloud/cloud.cfg.d/subiquity-disable-cloudinit-networking.cfg. Next, a few packages will need installing so we can configure the VLANs and the routing/firewall.</p><p>sudo apt get update<br>sudo apt install openssh-server vlan<br>sudo snap install ufw<br>sudo apt-get install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils</p><h4>Networking</h4><p>Apart from the VLAN configuration, to allow the MAAS node to also be a KVM host managed by MAAS, a large number bridges need to be configured in netplan. In the configuration file, each VLAN is linked to a network interface and each bridge is linked to a VLAN (except br0 and br1, which link directly to the network interface and should be connected to the existing network and default network (10.14.0.0/20) respectively). To edit the netplan configuration use the command: sudo nano /etc/netplan/00-installer-config.yaml. Below is the configuration file I use:</p><pre># This is the network config written by &#39;subiquity&#39;<br>network:<br>  version: 2<br>  ethernets:<br>    enp5s0:<br>      dhcp4: false<br>      dhcp6: false<br>    enp6s0:<br>      dhcp4: false<br>      dhcp6: false<br>  bridges:<br>    br0:<br>      interfaces: [enp5s0]<br>      dhcp4: no<br>      dhcp6: no<br>      addresses: [192.168.178.223/24]<br>      gateway4: 192.168.178.1<br>      nameservers:<br>        addresses: [192.168.178.1]<br>    br1:<br>      interfaces: [enp6s0]<br>      dhcp4: no<br>      dhcp6: no<br>      addresses: [10.14.0.1/20]<br>    #IPMI<br>    br11:<br>      interfaces: [vlan11]<br>      dhcp4: no<br>      dhcp6: no<br>      addresses: [&quot;192.168.11.99/24&quot;]<br>    #public<br>    br50:<br>      interfaces: [vlan50]<br>      dhcp4: no<br>      dhcp6: no<br>      addresses: [&quot;10.50.0.2/20&quot;]<br>    #internal<br>    br100:<br>      interfaces: [vlan100]<br>      dhcp4: no<br>      dhcp6: no<br>      addresses: [&quot;10.100.0.1/20&quot;]<br>    #admin<br>    br150:<br>      interfaces: [vlan150]<br>      dhcp4: no<br>      dhcp6: no<br>      addresses: [&quot;10.150.0.1/20&quot;]<br>    #storage<br>    br200:<br>      interfaces: [vlan200]<br>      dhcp4: no<br>      dhcp6: no<br>      addresses: [&quot;10.200.0.1/20&quot;]<br>    #compute<br>    br250:<br>      interfaces: [vlan250]<br>      dhcp4: no<br>      dhcp6: no<br>      addresses: [&quot;10.250.0.1/20&quot;]<br>    #external<br>    br99:<br>      interfaces: [vlan99]<br>      dhcp4: no<br>      dhcp6: no<br>      addresses: [&quot;10.99.0.2/20&quot;]<br>    #cluster<br>    br30:<br>      interfaces: [vlan30]<br>      dhcp4: no<br>      dhcp6: no<br>      addresses: [&quot;10.30.0.1/20&quot;]<br>  vlans:<br>    #IPMI<br>    vlan11:<br>      id: 11<br>      link: enp6s0<br>    #public<br>    vlan50:<br>      id: 50<br>      link: enp6s0<br>    #internal<br>    vlan100:<br>      id: 100<br>      link: enp6s0<br>    #admin<br>    vlan150:<br>      id: 150<br>      link: enp6s0<br>    #storage<br>    vlan200:<br>      id: 200<br>      link: enp6s0<br>    #compute<br>    vlan250:<br>      id: 250<br>      link: enp6s0<br>    #external<br>    vlan99:<br>      id: 99<br>      link: enp6s0<br>    #cluster<br>    vlan30:<br>      id: 30<br>      link: enp6s0</pre><p>In my case, my primary network interface is named enp5s0 and my secondary network interface is named enp6s0. These values will need to be changed according to your hardware along with the IP address of your existing network, default gateway and DNS address for the primary network interface of the MAAS node. The command ip addr can be used to display the available network interfaces of the system. Once the necessary changes have been made execute sudo netplan apply to apply the changes and reboot for good measure. After rebooting it is a good idea to list the network interfaces using ip addr to ensure everything was applied correctly.</p><p>Next, <a href="https://wiki.ubuntu.com/UncomplicatedFirewall">ufw</a> will be used to setup MAAS to route traffic from the OpenStack nodes connected to the VLANs on its secondary network interface to the router through its primary interface. First, forwarding must be enabled in ufw. This can be done using sudo nano /etc/default/ufw and changing the DEFAULT_FORWARD_POLICY to accept: DEFAULT_FORWARD_POLICY=&quot;ACCEPT&quot;. Next, edit /etc/ufw/sysctl.conf and uncommend the line net/ipv4/ip_forward=1. To configure NAT for the VLAN interfaces: sudo nano /etc/ufw/before.rules. Below is the configuration file I use. In the NAT table rules, the -F is used to flush the iptables when ufw is loaded. Without this, duplicate iptables will be added upon restarts of ufw which might cause issues.</p><pre>#<br># rules.before<br>#<br># Rules that should be run before the ufw command line added rules. Custom<br># rules should be added to one of these chains:<br>#   ufw-before-input<br>#   ufw-before-output<br>#   ufw-before-forward<br>#<br><br># NAT table rules<br>*nat<br>:PREROUTING ACCEPT [0:0]<br>:POSTROUTING ACCEPT [0:0]<br><br># Forward traffic through eth0 - Change to match you out-interface<br>-F<br>-A POSTROUTING -s 10.14.0.0/20 -o br0 -j MASQUERADE<br>-A POSTROUTING -s 10.30.0.0/20 -o br0 -j MASQUERADE<br>-A POSTROUTING -s 10.100.0.0/20 -o br0 -j MASQUERADE<br>-A POSTROUTING -s 10.150.0.0/20 -o br0 -j MASQUERADE<br>-A POSTROUTING -s 10.200.0.0/20 -o br0 -j MASQUERADE<br>-A POSTROUTING -s 10.250.0.0/20 -o br0 -j MASQUERADE<br>-A POSTROUTING -o br0 -j SNAT --to-source 192.168.178.223<br>#-D POSTROUTING -o br0 -j SNAT --to-source 192.168.178.223<br>#-A FORWARD -i br0 -o br1 -m state \<br>#  --state RELATED,ESTABLISHED -j ACCEPT<br>#-A FORWARD -i br1 -o br0 -j ACCEPT<br><br># don&#39;t delete the &#39;COMMIT&#39; line or these nat table rules won&#39;t<br># be processed<br>COMMIT<br><br># Don&#39;t delete these required lines, otherwise there will be errors<br>*filter<br>:ufw-before-input - [0:0]<br>:ufw-before-output - [0:0]<br>:ufw-before-forward - [0:0]<br>:ufw-not-local - [0:0]<br># End required lines<br><br><br># allow all on loopback<br>-A ufw-before-input -i lo -j ACCEPT<br>-A ufw-before-output -o lo -j ACCEPT<br><br># quickly process packets for which we already have a connection<br>-A ufw-before-input -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT<br>-A ufw-before-output -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT<br>-A ufw-before-forward -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT<br><br># drop INVALID packets (logs these in loglevel medium and higher)<br>-A ufw-before-input -m conntrack --ctstate INVALID -j ufw-logging-deny<br>-A ufw-before-input -m conntrack --ctstate INVALID -j DROP<br><br># ok icmp codes for INPUT<br>-A ufw-before-input -p icmp --icmp-type destination-unreachable -j ACCEPT<br>-A ufw-before-input -p icmp --icmp-type time-exceeded -j ACCEPT<br>-A ufw-before-input -p icmp --icmp-type parameter-problem -j ACCEPT<br>-A ufw-before-input -p icmp --icmp-type echo-request -j ACCEPT<br><br># ok icmp code for FORWARD<br>-A ufw-before-forward -p icmp --icmp-type destination-unreachable -j ACCEPT<br>-A ufw-before-forward -p icmp --icmp-type time-exceeded -j ACCEPT<br>-A ufw-before-forward -p icmp --icmp-type parameter-problem -j ACCEPT<br>-A ufw-before-forward -p icmp --icmp-type echo-request -j ACCEPT<br><br># allow dhcp client to work<br>-A ufw-before-input -p udp --sport 67 --dport 68 -j ACCEPT<br><br>#<br># ufw-not-local<br>#<br>-A ufw-before-input -j ufw-not-local<br><br># if LOCAL, RETURN<br>-A ufw-not-local -m addrtype --dst-type LOCAL -j RETURN<br><br># if MULTICAST, RETURN<br>-A ufw-not-local -m addrtype --dst-type MULTICAST -j RETURN<br><br># if BROADCAST, RETURN<br>-A ufw-not-local -m addrtype --dst-type BROADCAST -j RETURN<br><br># all other non-local packets are dropped<br>-A ufw-not-local -m limit --limit 3/min --limit-burst 10 -j ufw-logging-deny<br>-A ufw-not-local -j DROP<br><br># allow MULTICAST mDNS for service discovery (be sure the MULTICAST line above<br># is uncommented)<br>-A ufw-before-input -p udp -d 224.0.0.251 --dport 5353 -j ACCEPT<br><br># allow MULTICAST UPnP for service discovery (be sure the MULTICAST line above<br># is uncommented)<br>-A ufw-before-input -p udp -d 239.255.255.250 --dport 1900 -j ACCEPT<br><br># don&#39;t delete the &#39;COMMIT&#39; line or these rules won&#39;t be processed<br>COMMIT</pre><p>As ufw is not just a router but a firewall, it is important to set the following rules for MAAS to be able to function properly.</p><p>sudo ufw allow 5240<br>sudo ufw allow 5248<br>sudo ufw allow 5241:5247/tcp<br>sudo ufw allow 5241:5247/udp<br>sudo ufw allow 5250:5270/tcp<br>sudo ufw allow 5250:5270/udp<br>sudo ufw allow 22<br>sudo ufw allow 5900<br>sudo ufw allow 7911<br>sudo ufw allow 53<br>sudo ufw allow 8000/tcp<br>sudo ufw allow 3128/tcp<br>sudo ufw allow bind9 <br>sudo ufw allow ntp <br>sudo ufw allow tftp <br>sudo ufw allow 67:68/udp<br>sudo ufw allow 5787/udp<br>sudo ufw route allow in on br1 out on br0 from 10.14.0.0/20</p><p>Finally, restart ufw: sudo ufw disable &amp;&amp; sudo ufw enable. The following commands can be useful for debugging iptable issues:<br>sudo iptables -t nat -v -x -n -L<br>sudo iptables -t nat -L -v</p><h4>MAAS installation and configuration</h4><p>For this deployment the maas-test-db snap is used. However, for production deployments it is recommended to use a dedicated installation of postgresql. Start off by installing maas-test-db and maas from snap. <br>sudo snap install maas-test-db<br>sudo snap install maas</p><p>Next, initialize MAAS and create an admin user. Ensure that the MAAS URL shown during the initialization returns the IP address of the primary (external) network interface of the MAAS node and change it if needed. In my case it shows: MAAS URL [default=http://192.168.178.223:5240/MAAS/]:</p><p>sudo maas init region+rack — database-uri maas-test-db:///<br>sudo maas createadmin</p><p>For those reading this story, I have since moved on from OpenStack to Kubernetes on bare-metal. However, at some point in the future I do plan on finishing this article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9812a3f75a37" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>