Coder Social home page Coder Social logo

mdsanima-lab / k3s-kube-demo Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 251 KB

Deploy demo apps in Lightweight Kubernetes K3s cluster

License: MIT License

Dockerfile 5.11% JavaScript 1.96% CSS 82.49% TypeScript 10.43%
arm64 jetson-nano k3s-cluster kubectl kubernetes kubernetes-cluster kubernetes-deployment kubernetes-manifests kubernetes-service nextjs raspberry-pi

k3s-kube-demo's Introduction

K3s Kube Demo

Deploying Demo Apps in Lightweight Kubernetes K3s Cluster. Checkt the official documentation how to install and configure K3s Cluster.

The Linux docker images in this repository is builded for AMD 64-bit, ARM 32-bit, and ARM 64-bit architectures. Thats allow you to run this app inside K3s Cluster on Raspberry Pi 3 and 4 nodes, nVidia Jetson Nano nodes, Ampere ARM and AMD 64-bit server nodes.

Kube Demo Apps

There is a two different application on this monorepo:

Building Multi-Arch Images

This is a monorepo contains two different application. Each app is building for multi-arch images and pushing in hub.docker.com site.

First start Docker Desktop on Windows and check our builders, type in the WSL terminal:

docker buildx ls

We are currently using the default builder. Now create a new builder, which gives us access to new multi-arch features, type in the WSL terminal:

docker buildx create --name mybuilder
docker buildx use mybuilder
docker buildx inspect --bootstrap

Here is a new builder instance with the name mybilder, switched to it, and inspected it. Now you can build multi-arch images for each application.

Example Command

This is a example command, type in the WSL terminal:

docker buildx build --platform linux/amd64,linux/arm64 -t mdsanima/app --push .

This command create multi-arch images for linux/amd64 and linux/arm64 architecture then pushing to docker hub repository.

Do not execute this command this is a only example, for each application this command is available inside apps folder on README.md files.

Debug Application

This is a documentation how to troubleshooting your application.

Get a Shell to a Running Container

Create the simple nginx pod:

kubectl run nginx-shell-demo --image=nginx

Verify that the container is running:

kubectl get pod nginx-shell-demo

Get a shell to the running container:

kubectl exec --stdin --tty nginx-shell-demo -- /bin/bash

Now you are inside the pod.

Delete the demo pod:

kubectl delete pod nginx-shell-demo

Configure Hosts Name

Edit your /etc/hosts file and add this line:

192.168.1.30 kube.mdsanima.local rpi-1.node.test hello.dev.local mdsanima.dev.local

Now you can assess at the URL like this http://kube.mdsanima.local or this http://rpi-1.node.test:31337 specific node port services. You can type anything you want.

This config may be different of any your node. Also you can change it in WSL and if you want to access browser on Windows you need to change it in other location. Open the Windows Terminal with Administrator mode on your WSL system. I use Ubuntu 22.04 LTS Jammy. Type this command nano /mnt/c/Windows/System32/drivers/etc/hosts and add your host name.

Restart Deployment

When new image is pushing to the repository you can restart the deployment:

kubectl rollout restart deploy hello-world
kubectl rollout restart deploy hello-mdsanima

After executing these commands, new images will be downloaded.

NGINX Ingress Controller

Here is a instruction guide for install the NGINX Ingress Controller from official documentation site.

You can deploy the ingress controller with the following command:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.6.4/deploy/static/provider/cloud/deploy.yaml

Now check the namespace, pods and services with short version commands:

kubectl get ns
kubectl get pod --namespace=ingress-nginx
kubectl get svc --namespace=ingress-nginx

k3s-kube-demo's People

Contributors

mdsanima avatar

Stargazers

Mats Estensen avatar

Watchers

 avatar

k3s-kube-demo's Issues

Add translation for polish language for all `.md` files

English language files remain in the same files, and we are adding new files with Polish translations of the original files, for example:

  • The file README.md is the original in English.
  • The file README.polish.md is the translation.
  • The file how-to-create-kubernetes-cluster.md is the original in English.
  • The file how-to-create-kubernetes-cluster.polish.md is the translation.

Other examples of how file names with translations can look:

  • README.pl.md
  • README.pl-pl.md
  • README.polish.md
  • README.en.md
  • README.en-us.md
  • README.english.md

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.