The Ultimate DevOps Sandbox .
“Tired of juggling multiple VMs for your DevOps stack? Get it all in one place with the ultimate DevOps VM—just one command, zero hassle.”
Intro
This idea’s been chilling in my mind for ages while I was playing around with Vagrant. I’ve lost count of the number of cool builds I’ve tried out from GitHub across different stacks. But, you know the deal—too many VMs, and suddenly your laptop sounds like a jet taking off. The kicker? A lot of these VMs are pretty much the same, with just slight differences in configurations.The Idea Behind the Bundle
One day, it hit me: Why not just use one VM and throw everything into it? One box, all the tools. No more hogging resources, and you still get to have all your DevOps toys in one place. That’s how the All-In-One DevOps VM idea was born—“A single VM to rule them all“, loaded with everything you need for your DevOps shenanigans.
Just run a single “vagrant up"
command, and you’re good to go!
GitHub Repository
Check out the first release on my GitHub repo. Feedback & contributions are welcome, Let’s see how it grows with your help!What’s in the pack
Here’s what you’ll find packed into this VM:- KVM + kcli (virtualization CLI wrapper)
- Ansible AWX (will soon be replace by OLAM)
- HashiCorp Squad:
- Docker
- Kubernetes (single-node 1.28)
- Helm + Kubernetes Dashboard
- k9s for managing your K8s like a boss
- kubectl autocompletion
- kubescape
- And more…
- Compliance as Code:
- Jenkins
- Cloud Shell CLI for OCI, AWS, Azure, and GCP
- Other handy tools like
tmate
,bind-utils
, and a bunch more!
Get Started
Pre-Reqs
Resources: Recommended range is:- RAM: 4–8GB
- vCPU: 2–4 cores
vb.memory
and vb.cpus
settings to match your machine’s capacity.
How to Roll:
- Clone or Download the Repo:
$ git clone https://github.com/brokedba/Devops_all_in_one_vm.git
- Hop into the Directory and fire up the VM:
$ cd /path/to/Devops_all_in_one_vm/OL7 $ vagrant up
Explore The Box
KVM
- Display current setup
[root@localhost ~]# kcli list pool +---------+------------------+ | Pool | Path | +---------+-------------------+ | default | /u01/guest_images | +---------+-------------------+ [root@localhost ~]# kcli list network Listing Networks... +---------+--------+------------------+------+---------+------+ | Network | Type | Cidr | Dhcp | Domain | Mode | +---------+--------+------------------+------+---------+------+ | default | routed | 192.168.122.0/24 | True | default | nat | +---------+--------+------------------+------+---------+------+
TERRAFORM (KVM)
In this example we will be using libvirt terraform provider to launch a KVM VM inside our vm (nested virtualization)
- Download the provider
[root@localhost]# wget https://github.com/dmacvicar/terraform-provider-libvirt/releases/download/v0.6.2/terraform-provider-libvirt-0.6.2+git.1585292411.8cbe9ad0.Fedora_28.x86_64.tar.gz [root@localhost]# tar xvf terraform-provider-libvirt-**.tar.gz
- Add the plugin in a local registry and install the provider
[root@localhost]# mkdir –p ~/.local/share/terraform/plugins/registry.terraform.io/dmacvicar/libvirt/0.6.2/linux_amd64
[root@localhost]# mv terraform-provider-libvirt ~/.local/share/terraform/plugins/registry.terraform.io/dmacvicar/libvirt/0.6.2/linux_amd6
- Add the below code block to the main.tf file to map libvirt references with the actual provider
[root@localhost projects]# cd /root/projects/terraform [root@localhost]# vi libvirt.tf ... terraform { required_version = ">= 0.13" required_providers { libvirt = { source = "dmacvicar/libvirt" version = "0.6.2" } } } ... REST of the ConfigRun :
terraform init & terraform plan
Read my full tutorial here
KUBERNETES
- Create nginx deployment and list current K8 info
[root@localhost ~]# kubectl -n kube-system get cm kubeadm-config -o yaml [root@localhost ~]# kubectl apply -f https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/application/nginx-app.yaml [root@localhost ~]# kubectl get pods -o wide NAME READY STATUS RESTARTS AGE my-nginx-62 1/1 Running 0 12m my-nginx-6h 1/1 Running 0 12m my-nginx-6n 1/1 Running 0 12m [root@localhost ~]# kubectl get services --sort-by=.metadata.name NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 72m my-nginx-svc LoadBalancer 10.109.205.27 <pending> 80:31302/TCP 19m [root@localhost ~]# kubectl get deploy -o wide NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR my-nginx 3/3 3 3 21m nginx nginx:1.14.2 app=nginx [root@localhost ~]# kubectl get namespace [root@localhost ~]# kubectl get events --sort-by=.metadata.creationTimestamp
- Helm
[root@localhost ~]# helm version --short v3.15.1+ge211f2a [root@localhost ~]# helm repo add stable https://charts.helm.sh/stable [root@localhost ~]# helm repo add bitnami https://charts.bitnami.com/bitnami "bitnami" has been added to your repositories "stable" has been added to your repositories [root@localhost ~]# helm search repo list NAME CHART VERSION APP VERSION DESCRIPTION bitnami/kube-state-metrics 4.2.3 2.12.0 kube-state-metrics is a simple service that lis... bitnami/redis 19.5.2 7.2.5 Redis(R) is an open source, advanced key-value ... bitnami/redis-cluster 10.2.3 7.2.5 Redis(R) is an open source, scalable, distribut... bitnami/valkey 0.1.0 7.2.4 Valkey is an open source, advanced key-value st... stable/redis 10.5.7 5.0.7 DEPRECATED Open source, advanced key-value stor...
- Kubernetes Dashboard
# kubectl proxy
Starting to serve on 127.0.0.1:8001
HTTP URL: http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/
- K9s
AWX
Note: In EL8/9 builds, AWX will be replaced by OLAM (Oracle Fork that is rpm based). Thank you AWX maintainers for pooping the party with K8/docker complexity.VERSION: 17.0.1
Deployment framework: Docker
[root@localhost]# docker ps
CONTAINER ID IMAGE COMMAND STATUS PORTS NAMES
ad0415de0acd ansible/awx:17.0.1 "/usr/bin/tini -- /u…" Up a minute 8052/tcp awx_task
d323791a27cb ansible/awx:17.0.1 "/usr/bin/tini -- /b…" Up 11 minutes 0.0.0.0:80->8052/tcp, :::80->8052/tcp awx_web
313ba9a22186 postgres:12 "docker-entrypoint.s…" 11 minutes 5432/tcp awx_postgres
56385b68670d redis "docker-entrypoint.s…" Up 11 minutes 6379/tcp awx_redis
Log in using the following credentials, assuming you’ve not changed them.
- Username: admin
- Password: password
JENKINS
- Portal configuration
- Cli Help
[root@localhost ~]# wget http://localhost:8089/jnlpJars/jenkins-cli.jar
[root@localhost ~]# java -jar jenkins-cli.jar -s http://localhost:8089/ -webSocket -auth admin:password help