Skip to content

CaptainMayotoast/kubernetes-ansible

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

An Ansible playbook that installs Kubernetes.

A guide for using this repo to spin up a Kubernetes cluster is available at Installing your Kubernetes homelab cluster in minutes with Ansible

Credits

Code examples originally adapted from https://perdue.dev/installing-your-kubernetes-homelab-cluster-in-minutes-with-ansible/

Features

  • containerd
  • calico for pod networking

Installation

  1. Update inventory/dev with IPs for each master/slave nodes

  2. Install a Python virtual envrionment:

python3 -m venv ./venv
  1. Install ansible within the venv

python3 -m pip install ansible

  1. Run keyscan.py

Output will look like:

['homelabvm1', 'homelabvm2', 'homelabvm3', 'homelabvm4']
# homelabvm1:22 SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.6
# homelabvm2:22 SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.6
# homelabvm4:22 SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.6
# homelabvm3:22 SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.6
  1. Run ansible -i inventory/dev all -m ping --user ansible

Output will look like:

homelabvm1 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python3"
    },
    "changed": false,
    "ping": "pong"
}
homelabvm2 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python3"
    },
    "changed": false,
    "ping": "pong"
}
homelabvm3 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python3"
    },
    "changed": false,
    "ping": "pong"
}
homelabvm4 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python3"
    },
    "changed": false,
    "ping": "pong"
}
  1. Run ansible-playbook -i inventory/dev playbooks/k8s_all.yaml --user ansible

About

An Ansible playbook that installs Kubernetes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%