Giter VIP home page Giter VIP logo

ohmyk8s's Introduction

Oh My Kubernetes!

An Ansible Playbook to automate the configuration of (Ubuntu Linux x86_64) machines to be ready for Kubernetes development. It cuts down the development environment preparation from tedious hours to less than 5 minutes.

Included software

The below are installed on both k8sdev and k8sdevlite groups:

All of the above come with bash completion, whenever applicable.

The below are installed only on the k8sdev group:

System requirements

  1. Ansible on your controller machine (e.g. laptop) which is typically different from, but could be the same as, the target machine you are preparing. You also need a couple of Ansible collections, install using the command: ansible-galaxy collection install community.general community.kubernetes (Make sure that you are using Ansible > v2.9)

  2. One or more SSH connections to the target machine(s) with public key authentication configured. You can do that by editing your .ssh/config. For example:

    # ~/.ssh/config
    Host awsdev1
        HostName 100.100.100.100
        User ubuntu
        IdentityFile ~/.ssh/id_rsa
        IdentitiesOnly yes
  3. A configured Ansible hosts file with 2 sections called k8sdev and k8sdevlite containing all the machines you want to configure (yes you can configure many machines at once!). For example:

    # /etc/ansible/hosts
    [k8sdev]
    awsdev1 ansible_user=ubuntu
    1.2.3.4 ansible_user=anotheruser
    5.6.7.8 ansible_user=ubuntu
    ...
    [k8sdevlite]
    ...

The above file can be stored in the default location /etc/ansible/hosts if the control machine is running Debian/Ubuntu or a similar distro. For other distros or other operating systems, you can store it in any location then supply --inventory <file-location> to the ansible-playbook command.

Installation

To launch the installation process that will configure all target machines at once, run the following:

git clone https://github.com/hammady/ohmyk8s.git
cd ohmyk8s
ansible-playbook ohmyk8s.yaml -v

Note: ansible-playbook accepts -v for verbose mode (-vvv for more, -vvvv to enable connection debugging)

Sit (or stand!) and watch the results, you should get a report similar to the below if everything goes well:

...
PLAY RECAP *******************************
awsdev1                     : ok=56   changed=7    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Caveats

  • This only supports Ubuntu 20.04 running on x86_64 architectures. Support for other distributions and architectures is possible but needs some work. For example, the focal distro is hard-coded in some lines and should be detected.

Support

If there are any errors from the above command, please create an issue in this repo or drop me a line at: github at hammady dot net.

If you have any suggestions or enhancements, please feel free to create a PR or discuss with me. Please note that I am a total noob in Ansible, I learned it in the same day I created this repo.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.