Giter Club home page Giter Club logo

k8s-setup's Introduction

k8s-setup

Code for my post on Bare-Metal Kubernetes Setup, a setup of Bare Metal Kubernetes using Kubeadm and Metallb on Ubuntu 18.04 master and 3 Ubuntu 18.04 minions.

Setup Master

./setup-master.sh Network/Mask LB-Address-Range

This part does setup setup of:

  • Initialize master.
  • Setup pod network.
  • Setup LoadBalancer.
  • Setup LoadBalancer config.

Example

./setup-master.sh 192.168.122.0/24 192.168.122.150-192.168.122.250

Setup Nodes

Just join the nodes using the token generated in the previous master setup script.

Dashboard

./setup-dashboard.sh

This will setup the Kubernetes UI Dashboard and a service account k8s-admin.

To start the dashboard in the master.

kubectl proxy --accept-hosts='^*$'

The dashboard is accessible on the Master IP port 8001. You can bind your local environment to the master via SSH.

ssh -fNTL localhost:8000:127.0.0.1:8001 user@master-ip-address

Now you can access the dashboard on: http://localhost:8000/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/overview?namespace=default

Storage

Longhorn - Option 1

To setup Longhorn

./setup-longhorn.sh

Longhorn setups up with a LB type service for accessing the dashboard. You should see it using

╭─user@z-server-1 ~/k8s-setup  ‹master*›
╰─➤  k get services -n longhorn-system
NAME                      TYPE           CLUSTER-IP     EXTERNAL-IP       PORT(S)        AGE
compatible-csi-attacher   ClusterIP      10.96.66.245   <none>            12345/TCP      3d15h
csi-attacher              ClusterIP      10.96.23.111   <none>            12345/TCP      3d15h
csi-provisioner           ClusterIP      10.96.6.171    <none>            12345/TCP      3d15h
longhorn-backend          ClusterIP      10.96.24.184   <none>            9500/TCP       3d15h
longhorn-frontend         LoadBalancer   10.96.191.83   192.168.122.150   80:31082/TCP   3d15h
╭─user@z-server-1 ~/k8s-setup  ‹master*›
╰─➤

StorageOS - Option 2

To setup StorageOS.

Install StorageOS operator

./setup-storage-os.sh

To access the Storage OS dashboard:

kubectl --namespace storageos port-forward svc/storageos 5705

To access the dashboard, bind your local machine to the master ip port 5705

ssh -fNTL localhost:5700:127.0.0.1:5705 user@MASTER-IP-ADDRESS

The access http://localhost:5700/

Nginx Ingress Controller

To setup Nginx Ingress Controller.

./setup-nginx-ingress-ctl.sh

Cert-Manager

To setup cert manager.

./setup-cert-manager.sh

Kube-Prometheus

If you need cluster monitoring out of the box try Kube-Promatheus

k8s-setup's People

Contributors

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