GithubHelp home page GithubHelp logo

ycyr / bootstrap-kubernetes-with-qemu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zimmertr/tjs-kubernetes-service

0.0 2.0 0.0 4.89 MB

Proxmox + QEMU + Debian + Kubeadm + Ansible = K8s

License: GNU General Public License v3.0

Shell 100.00%

bootstrap-kubernetes-with-qemu's Introduction

TKS (TJ's Kubernetes Service)

Summary

Declaratively build a 4 node Kubernetes cluster on Proxmox using Ansible and QEMU. Optionally enable advanced features including ingress, load balancing, etc.

Approximate deployment time: 25 minutes

Requirements

  1. Proxmox server
  2. DNS Server
  3. Ansible 2.7.0+. Known incompatibility with a previous build.

Instructions

Required:

  1. Modify the vars.yml file with values specific to your environment.
  2. Provision DNS A records for the IP Addresses & Hostnames you defined for your nodes in the vars.yml file.
  3. Modify the inventory.ini file to reflect your chosen DNS records and the location of the SSH keys used to connect to the nodes.
  4. Run the deployment: ansible-playbook -i inventory.ini site.yml
  5. After deployment, a ~/.kube directory will be created on your workstation. Within your config an authentication_token file can be be found. This token is used to authenticate against the Kubernetes API and Dashboard using your account. To connect to the dashboard, install kubectl on your workstation and run kubectl proxy then navigate to the Dashboard Endpoint in your browser.

Optional:

To enable an optional feature, fill in the additional parameters in vars.yml and execute a playbook listed below.

Feature Command Requirements
NFS backed persistent storage ansible-playbook -i inventory.ini playbooks/optional/deploy_nfs_provisioner.yml
MetalLB Load Balancer ansible-playbook -i inventory.ini playbooks/optional/deploy_metallb.yml
NGINX Ingress Controller ansible-playbook -i inventory.ini playbooks/optional/deploy_ingress-nginx.yml MetalLB or other Load Balancer integration
DataDog agents ansible-playbook -i inventory.ini playbooks/optional/deploy_datadog.yml

Tips

  1. You can rollback the entire deployment with: ansible-playbook -i inventory.ini playbooks/optional/delete_all_resources.yml
  2. If Calico isn't deploying correctly it's likely the CIDR you assigned to it in vars.yml conflicts with your network.
  3. See this repository to do this with LXC instead. Benefits of using LXC include:
* No virtualization overhead means better performance
* Ability to directly mount volumes from your server into your containers.

TODO

  1. Add better support for multi-node Proxmox clusters.
  2. Add support for VLAN Tags & IDs.
  3. Perform security audit and enhance if necessary.
  4. Add info to README about updating inventory file and how to handle SSH key generation and propegation.
  5. Add playbook to integrate k8s with a log server.
  6. Fix *.raw disk issue.
  7. Implement identification of different types of storage mounts.
  8. Automatically include inventory.ini somehow so one can simply run ansible-playbook site.yml to deploy.
  9. Create playbook to upgrade kubernetes version for kubeadm cluster.
  10. Create playbook to install OS updates on nodes.
  11. Move dashboard deployment to optional features.
  12. Refactor lazy sleep tasks for more intelligent wait_for tasks.

Problems

  1. The proxmox_kvm module is out of date and does not support cloudinit related api calls. Meaning shell commands must be used instead to perform qm create tasks.
  2. The k8s module does not support applying Kubernetes Deployments from URL. Instead of using get_url to download them first, and then apply them with k8s, I just use shell to run a kubectl apply -f. Feature Request here.
  3. Miscellaneous qcow2 image issues:
OS Issue
Debian Kernel Panic on the first boot. Bypassed by stopping and starting a VM after 30 seconds.
CentOS A nameserver is baked into /etc/resolv.conf by default. Bug Report here
CoreOS Proxmix issued cloud-init does not seem to configure networking properly.
Ubuntu Kernel Panic on the first boot. Bypass hack is untested as I prefer Debian.

bootstrap-kubernetes-with-qemu's People

Contributors

zimmertr avatar

Watchers

 avatar  avatar

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.