Giter Site home page Giter Site logo

industrial-cloud-bootcamp / kubernetes-2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from industrial-cloud-bootcamp/kubernetes-1

0.0 0.0 0.0 61 KB

This repo contains the script to install docker engine alongside cri-containerd. That lead to the creation of a kubernetes cluster with kube components

Shell 100.00%

kubernetes-2's Introduction

kubernetes on Ubuntu 16+

The repository contains the steps to build a kubernetes cluster from scratch.

It includes installing Docker Engine, CRI-dockerd adapter to act as shim between docker and k8s.

Later on, the final kubernetes tools such as kubeadm, kubelet, kubectl are installed.


Installation

./deploy_k8s.sh

Post Installation

After the installation of tools, configure it based on what kind of node it would be. Out of many nodes, atleast one must be chosen as master.

The only difference between worker node and master is, during the initializing stage, installs the cluster control plane components.


Setup Master node

Make one of the node as master in a multi node cluster. To do that, initialize the kubeadm with server parameters.

kubeadm init --apiserver-advertise-address=[server_ip] --pod-network-cidr=[pod netwrok cidr] --cri-socket=unix:///var/run/cri-dockerd.sock

Initialition first runs a series of prechecks to ensure that the machine is ready to run kubernetes. These prechecks expose warnings and exit on errors. Kubeadm init then downloads and installs the cluster control plane components. This make take several minutes. After it finishes able to see:

Your Kubernetes control-plane has initialized successfully!

To start using your cluster, you need to run the following as a regular user:

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

Setup Worker nodes

Once a node has been selected as master, join workers to the master by the following sytax as root.

kubeadm join [master_ip]:6443 --token [from master node] --discovery-token-ca-cert-hash [hash generated by master] --cri-socket unix:///var/run/cri-dockerd.sock

Once the worker has joined, you will get the following output.

This node has joined the cluster.

  • Certificate signing request was sent to apiserver and a response was received.
  • The Kubelet was informed of the new secure connection details.

Run 'kubectl get nodes' on the control-plane to see this node join the cluster.

In case you missed to save the token when master was created, generate a new one in master node by:

kubeadm token create --print-join-command

NotnotReady solution

You must deploy a Container Network Interface (CNI) based Pod network add-on so that your Pods can communicate with each other.

Cluster DNS (CoreDNS) will not start up before a network is installed.

Supported plugins:

  • Calico
  • Cilium
  • Weave-net

Install weave

 kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"

References

Kubernetes logo

kubernetes-2's People

Contributors

abuharis avatar sravanisavili avatar martinstilaks 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.