Giter VIP home page Giter VIP logo

noomnim-chat-k8s-pi's Introduction

Noomnim Chat Kubernetes on Raspberry Pi

Ubuntu Virtual Machine initial configuration (Master node)

  1. Setup static IP address on the machine
  2. Run the following script install Docker daemon and Kubeadm
sudo apt-get update

sudo apt-get install -y vim apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo usermod -aG docker $USER

sudo swapoff --all
sudo sed -i '$ d' /etc/fstab

echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install -qy kubeadm

Raspberry Pi initial configuration (Worker node)

  1. Flash Raspberry Pi with Raspbian Stretch Download
  2. Run the script below to set static IP address to the Pi. Change IP address and router address depend on your preferences.
cat << EOF | sudo tee -a /etc/dhcpcd.conf
interface eth0
static ip_address=192.168.99.21/24
static routers=192.168.99.1
static domain_name_servers=8.8.8.8

interface wlan0
static ip_address=192.168.99.31/24
static routers=192.168.99.1
static domain_name_servers=8.8.8.8
EOF
  1. Run sudo raspi-config
    • Configure host name and wifi in Network Options
    • Configure localization: Enable en_US.UTF-8 and th_TH.UTF-8 and set default to en_US.UTF-8
  2. Reboot the Pi
  3. Run the following script to install Docker and disable swap
sudo apt-get update
curl -sSL get.docker.com | sh && \
	sudo usermod pi -aG docker
sudo dphys-swapfile swapoff && \
	sudo dphys-swapfile uninstall && \
	sudo update-rc.d dphys-swapfile remove
sudo swapoff -a
sudo systemctl disable dphys-swapfile.service
  1. Edit file /boot/cmdline.txt anda ppend cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory to the end of the first line.
  2. Reboot the Pi
  3. Run the following script to install kubeadm
cat << EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install -qy kubeadm

Initialize the Kubernetes cluster

Click here to see the steps to create high availability kubernetes cluster with HAProxy load balancer.

Deploying the application

wget -O- https://raw.githubusercontent.com/sunboyy/noomnim-chat-k8s-pi/master/k8s-deploy.sh | bash -

noomnim-chat-k8s-pi's People

Contributors

schwanabc avatar sunboyy avatar

Watchers

 avatar  avatar

Forkers

schwanabc

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.