Giter VIP home page Giter VIP logo

ansible-k8s-cluster's Introduction

Ansible-k8s-cluster

This project's main purpose is to practice ansible and also automate the process of installing kubernetes using kubeadm on an ubuntu server.

This follows the official kubernetes documentation on creating a cluster using kubeadm and also a video guide from Linux TV Links:

I'm using this script in a virtual machine created in azure and my personal home lab.

When installing kubeadm make sure you create the dir "/etc/apt/keyrings". Only if the directory exists the command to install the gpg key will work.

When you initialize the cluster using the kubeadm init command , --control-plane-endpoint should be equal to either the DNS name or the Ip address of the loadbalancer if you have multiple control planes. Then for the --pod-network-cidr , its important that you have an overlay network , so for this flag we can assign the private ip address of any CNI plugin such as flannel or cillium ( which you should install after initializing the cluster). In this project the address is 10.244.0.0/16. This an important element for the cluster for pod networking in the cluster.

(Run kubeadm init without the --control-plane-endpoint when you setup the cluster in azure or single home lab server with a single control plane)

Here is the documentation for the kubelet command: https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/ .

Oncee you initialize the cluster using kubeadm you will find the coredns pods in the pending state and this is due to the pods waiting for something and that is the overlay network ( flannel in this case ) , so install it by applying the k8s manifests for flannel which can be found in the ReadMe file of their github: https://github.com/flannel-io/flannel

Issue regarding node not found in kubelet :kubernetes/kubeadm#2370

ansible-k8s-cluster's People

Contributors

rghdrizzle avatar

Watchers

Lucian 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.