Start a Conversation

Unsolved

R

1 Rookie

 • 

15 Posts

135

May 22nd, 2023 06:00

Streamlining Lab Infrastructure with Ansible Terraform and AWS

Streamlining Lab Infrastructure with Ansible Terraform and AWS

 

ryanwallner_0-1684513704166.png

A core tenet of DevOps culture is automation. DevOps is of course not limited to automation, it’s a major organizational mindset shift that comes along with cultural, organizational and technological changes to ultimately be able to deliver software more efficiently and effectively while keeping high quality standards. Of course, this means that DevOps looks very different from team to team and the technology stack and tools they choose to use may also look different, that’s ok. What this post will hopefully lay out for you is one particular example of what a DevOps technology stack could be like and what the use case for building it was. 

Use case aimed at community and education. 

Strengthening an external community can mean many things to many people. For me, it always includes a form of education and learning for me. This may be through my own experiences coupled with what I've seen work, however I find that when individuals are a part of a community and that community helps them feel like they are part of a common goal or goals, then it helps with a sense of belonging that can be sustained. 

Individuals learn different ways, some better than others. You may think that you learn better when you have a visual aid, others while reading or if they have something tangible to use. One of the ways I truly believe a community of technologists learn effectively is through kinesthetic learning (aka a hands-on approach). For this use case, we wanted to provide a hands-on approach to community learning and provide free sandboxed experiences targeting a variety of technologies that have to do with DevOps. 

How on demand DevOps sandboxes can help foster community learning 

With a high-level goal of creating on-demand, DevOps sandboxes that use real technologies often discussed with customers, users, and community members, we needed to develop a way to automate the environment. Building this system from scratch was out of the question due to our team size and there are many tools and providers that help in this type of environment; however, we knew that we wanted the following characteristics. 

  • Embeddable and easy to use via web. 
  • Support for Cloud (AWS, Azure...) 
  • Access has low barriers (social login, public access, free) 
  • Labs should be concise. Tackle a “how to do X,Y,Z” in <10-20m max.  
  • Think of this like levels in a larger game. Many sandboxes could be used together later. 

Instruqt wound up being a perfect fit for these needs. We could offer our community a way to access and use DevOps tools in a free, anonymous and supportive way. This was really important to us coming from a developer relations perspective and helps our overall goal to foster community engagement. Next, we needed to choose a starting point for what DevOps topics and tools we were going to target. 

Building the environment  

We decided to target GitOps, Kubernetes, Terraform, Ansible, Observability, Authorization and Kubernetes Storage using a few different labs. A colleague of mine and I started working on a project we called “quickstart” which ultimately was a way for us to stand up a multi-use Kubernetes environment as quickly as possible. We built it with these sandbox environments in mind, so it had several different knobs we could turn depending on whether we wanted to run it on prem or in AWS or showcase Ansible, Terraform and other topics. The stack we chose to start with included the following: 

  • Target a cloud experience via AWS 
  • Infrastructure built through Terraform. (VPCs, Instances, Subnets) 
  • Installation and Configuration of components done through Ansible. (Host config, PowerFlex) 
  • Kubernetes deployed through Ansible or RKE. 
  • Applications deployed through a single source of truth in Git using GitOps where we could. 

ryanwallner_1-1684513704169.png

 

This got us about ninety percent of the way there and I would be lying if I said there wasn’t some bash scripts laying around to do certain things, or some govc integrations being used for standing up the stack on-prem instead of using the vSphere terraform provider. Like anything, this is also a work-in-progress and let’s face it, bash still has its place in the hearts of sys admins / DevOps engineers. 

Terraform and Ansible are two popular DevOps tools today that work quite well together. Terraform allows you to configure outputs which can seed your Ansible automation with information about what the terraform modules just created. This is what allows us to stand up our AWS VPC, Network, Instances, Volumes and hand off to Ansible to build PowerFlex, CSM and Kubernetes. 

Feel free to try it out yourself at https://developer.dell.com  

Less headaches with automated testing 

The last thing we wanted to do was automate our testing. CI/CD is a critical part of any DevOps development and release cycle and luckily Instruqt has a nice way to test a track that we could easily build into GitHub Actions for pre-release and ongoing maintenance. These GitHub actions allow developers to test easily, merge approved changes after testing, and release quickly to production. 

ryanwallner_2-1684513704171.png

ryanwallner_3-1684513704173.png

In summary, the goal was to create a resource that our community could benefit from that we could maintain over the years. Those interested can head over to https://developer.dell.com and try this out today by scrolling down to the hands-on learning environments. Our goal was to be able to showcase DevOps tools in a friendly and inviting way and I think we’ve hit the goal here; however, we aren't going to stop there. We plan to add more resources for the community as well as make the repositories used in the background open source so that the community can look at and use the code directly. We also have a lot of areas that could be improved in the stack and even places where we would like to substitute more Terraform or Ansible where scripts are being used today. I hope you come take a look at our community and what we are building, and thanks for reading! 

No Responses!

Top