Giter VIP home page Giter VIP logo

local-k8s's Introduction

local development cluster

This is work in progress

A short way to get a local kubernetes development cluster up and running on a local machine with Docker Desktop and expose apps to the internet for testing purposes.

Do not clone this repo now. We do this later in the devbox container.

Architecture

architecture

Prerequisites

Activate Kubernetes on Docker Desktop:

-> Docker Desktop -> Preferences -> Kubernetes -> Enable Kubernetes

Start the devbox container

Linux/MacOS:

docker run -d --hostname devbox -p 2080:2080 --rm \
  -v devboxhome:/home/coder \
  -v ${HOME}/.kube/config:/home/coder/.kube/config \
  --name local-k8s-devbox \
  isi006/code-server-k8s:latest

Windows:

docker run -d --hostname devbox -p 2080:2080 --rm -v devboxhome:/home/coder -v %userprofile%/.kube/config:/home/coder/.kube/config --name local-k8s-devbox isi006/code-server-k8s:latest

Visit http://localhost:2080/ to access the devbox IDE.

Open a terminal and check if it works:

kubectl cluster-info

Clone the repo in the devbox

git clone https://github.com/klauserber/local-k8s.git

Minimal infrastructure setup

configure

cp config.yml_template config.yml

Edit the config file to choose your domain suffix to build unique localtunnel subdomains.

install ingress-nginx

-> https://artifacthub.io/packages/helm/ingress-nginx/ingress-nginx

cd ingress-nginx
./run.sh

check if it works:

kubectl get all -n ingress-nginx

Test the system with the hello-app

Deploy the app

cd hello-app
./run.sh

Testing

kubectl get all -n hello-app

Visit http://hello.127.0.0.1.nip.io for local access.
Visit https://hello{{public_domain_suffix}} for public access.

Undeploy the app

./run.sh -d

Optional: Deploy portainer

You can install Portainer to get more insights about the cluster.

cd portainer
./run.sh

Visit the app at http://portainer.127.0.0.1.nip.io

Next steps?

This is a good starting point to play around with kubernetes on your local machine. So what can you do next?

local-k8s's People

Contributors

klauserber avatar

Watchers

 avatar  avatar

Forkers

mikelgo

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.