Skip to content

Playbooks and Templates to deploy resorces in my home lab

License

Notifications You must be signed in to change notification settings

kringen/homelab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

homelab

Playbooks and Templates to deploy resorces in my home lab

Ansible

Ansible directory and file structure follows the recommendations here: (Best Practices)[https://docs.ansible.com/ansible/2.8/user_guide/playbooks_best_practices.html]

Deploy all playbooks

ansible-playbook -K -i hosts --extra-vars "proxy_admin_username= proxy_admin_password= vm_root_pass=" site.yml

Tagged Deployments

DHCPD Deployment

ansible-playbook -K -i hosts --tags dhcpd site.yml

VIRT Deployment

ansible-playbook -K -i hosts --extra-vars vm_root_pass="" --tags virt site.yml

BIND Deployment

ansible-playbook -K -i hosts --tags bind site.yml

NFS Deployment

ansible-playbook -K -i hosts --tags nfs site.yml

Kubernetes Cluster Deployment

1 - Generate base kubernetes node image with latest kubelet/kubeadm and other required packages.

cd homelab/image-builder-blueprints

# Modiffy and push the blueprint
composer-cli blueprints push kubernetes_node.toml

# Check blueprint
composer-cli blueprints list
composer-cli blueprints show kubernetes_node
composer-cli blueprints depsolve kubernetes_node

# Build image
composer-cli compose start kubernetes_node qcow2
# Check status
composer-cli compose status
# Download image by UUID
composer-cli compose image UUID


2 - Deploy the virtual machines using Terraform

cd homelab/terraform/cluster_deploy

TF_VAR_redhat_email=<ReplaceWithRedHatEmail> TF_VAR_redhat_password='<ReplaceWithRealPassword>' TF_VAR_ssh_public_key=$(cat ~/.ssh/id_rsa.pub) TF_VAR_base_image=<base image path> terraform apply -var-file=homelab.tfvars

3 - Install kubernetes and configure cluster using ansible

cd homelab/ansible

ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook --private-key=/home/erik/.ssh/id_rsa -i hosts k8s_cluster.yml -K

4 - Install rbac roles, service mesh, and other cluster applications

These terraform configs will install essential configurations / applications such as:

  • Service Mesh
  • Certificate Manager
  • NFS Storage Class
  • OpenID Connect (OIDC) Authentication
  • Roles & RoleBindings
cd homelab/terraform/cluster_config

terraform apply -var-file=variable.tfvars

About

Playbooks and Templates to deploy resorces in my home lab

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published