This guide provides step-by-step instructions for deploying a full-stack chat application on Kubernetes using Kind, Metallb, and Ingress. It is designed to help developers set up a robust Kubernetes cluster for hosting containerized applications on a virtual private server (VPS).
The deployment includes setting up essential Kubernetes tools, configuring a load balancer, integrating SSL for secure communication, and deploying both the frontend and backend services. Additionally, optional sections cover monitoring the application with Prometheus and Grafana for enhanced observability and performance tracking.
Whether you are deploying a chat application for production or exploring Kubernetes capabilities, this guide will serve as a comprehensive roadmap to get your application up and running efficiently.
? Getting Started For k8s
Below table helps you to navigate to the particular tool installation section fast.
Tech stack | Installation |
---|---|
Docker | Install and configure Docker |
Kind & Kubectl | Install and configure Kind & Kubectl |
Metallb | Install Metallb |
Ingress | Install and configure Ingress |
Helm | Helm Install and configure |
SSL Certificate | Install and configure Cert Manager |
Project Deploy | Project Deploy and Others |
Monitoring | Namespace Create for Groping Prometheus and grafana and Other |
Prometheus | Install and configure Prometheus |
Grafana | Install and configure Grafana |
? Pre-requisites to implement this project:
[!Note]
vps minimum need
- RAM - 4GB
- CPU - 2 Core(s)
- Storage - 20 GB
- One Domain
? Docker Install and configure
sudo apt-get update sudo apt-get install docker.io -y sudo usermod -aG docker $USER && newgrp docker
? Kind & Kubectl Install and configure
Install KIND and kubectl using the provided script. Create kind_kubectl_config.yaml file:
#!/bin/bash # For AMD64 / x86_64 [ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.26.0/kind-linux-amd64 chmod +x ./kind sudo cp ./kind /usr/local/bin/kind VERSION="v1.31.0" URL="https://dl.k8s.io/release/${VERSION}/bin/linux/amd64/kubectl" INSTALL_DIR="/usr/local/bin" curl -LO "$URL" chmod +x kubectl sudo mv kubectl $INSTALL_DIR/ kubectl version --client rm -f kubectl rm -rf kind echo "kind & kubectl installation complete."
./kind_kubectl_config.yaml
[!Note]
If your Vps ARM64 then use this [ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.26.0/kind-linux-amd64
Run this script and it cerate kubectl and kind environment.
Kind Install More Information
?️ Setting Up the KIND Cluster
Create a kind-cluster-config.yaml file:
kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane image: kindest/node:v1.31.2 - role: worker image: kindest/node:v1.31.2 - role: worker image: kindest/node:v1.31.2 extraPortMappings: - containerPort: 80 hostPort: 80 protocol: TCP - containerPort: 443 hostPort: 443 protocol: TCP
Create the cluster using the configuration file:
kind create cluster --config kind-cluster-config.yaml --name my-kind-cluster
Verify the cluster:
kubectl get nodes kubectl cluster-info
[!Note]
Here i add extraPortMappings for running Ingress
? Metallb Install
[!Note]
I am using Metallb for use LoadBalance. Suppose you are using Aws/Azure/DigitalOcean ect whose provide kubernates loadBalance facility then doesn't need Metallb. Here I buy VPS from a local company. They give one IP address to access VPS.
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.14.9/config/manifests/metallb-frr.yaml
Check Metallb configuration
kubectl get all -n metallb-system
?️ Create a metallb_config.yaml file:
apiVersion: metallb.io/v1beta1 kind: IPAddressPool metadata: name: first-pool namespace: metallb-system spec: addresses: - 160.191.163.33-160.191.163.33
apply metallb_config.yaml file
kubectl apply -f metallb_config.yaml
[!Note]
MY VPS IP address is 160.191.163.33. Change this IP as your require
♻️ Ingress Install and configure
kubectl apply -f https://kind.sigs.k8s.io/examples/ingress/deploy-ingress-nginx.yaml
[!Note]
Here service/ingress-nginx-controller show EXTERNAL-IP is your VPS IP. My VPS IP is 160.191.163.33. It ensure that Our Metallb LoadBalance wroking.
? Helm Install and configure
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 chmod 700 get_helm.sh ./get_helm.sh
Check Helm Version
helm version
?? Install and configure Cert Manager || SSL Certificate
sudo apt-get update sudo apt-get install docker.io -y sudo usermod -aG docker $USER && newgrp docker
Installing cert-manager CRDs
#!/bin/bash # For AMD64 / x86_64 [ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.26.0/kind-linux-amd64 chmod +x ./kind sudo cp ./kind /usr/local/bin/kind VERSION="v1.31.0" URL="https://dl.k8s.io/release/${VERSION}/bin/linux/amd64/kubectl" INSTALL_DIR="/usr/local/bin" curl -LO "$URL" chmod +x kubectl sudo mv kubectl $INSTALL_DIR/ kubectl version --client rm -f kubectl rm -rf kind echo "kind & kubectl installation complete."
https://artifacthub.io/packages/helm/cert-manager/cert-manager
? Project Deploy and Others
Step One
Clone the below Project in your VPS
./kind_kubectl_config.yaml
Step Two
Go to k8s folder and you can see this file
Step Three
Create Nampe Space
kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane image: kindest/node:v1.31.2 - role: worker image: kindest/node:v1.31.2 - role: worker image: kindest/node:v1.31.2 extraPortMappings: - containerPort: 80 hostPort: 80 protocol: TCP - containerPort: 443 hostPort: 443 protocol: TCP
Step Four
Apply all Secret file
kind create cluster --config kind-cluster-config.yaml --name my-kind-cluster
Step Five
Declear Mongodb Volumes and Others
kubectl get nodes kubectl cluster-info
Step Six
Apply the Rest of Other file
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.14.9/config/manifests/metallb-frr.yaml
Step Seven
Configure SSL Certificate Domain. Open ssl_certificate.yaml and edit your desired domain name
Apply ssl_certificate.yaml file
kubectl get all -n metallb-system
Step Eight
Configure Ingress file. Open ingress.yaml and add your desired domain name.
Apply ingress.yaml file
apiVersion: metallb.io/v1beta1 kind: IPAddressPool metadata: name: first-pool namespace: metallb-system spec: addresses: - 160.191.163.33-160.191.163.33
Check Certificate
Check NameSpace
kubectl apply -f metallb_config.yaml
? Browser View
? Conclusion
Congratulations! You’ve successfully deployed the Full-Stack Chat Application . You can now access your Chat App.
? Monitoring and Others [Optional]
Now we are doing Extra features like Monitoring. It helps you learn about servers and apps.
Create Namespace
sudo apt-get update sudo apt-get install docker.io -y sudo usermod -aG docker $USER && newgrp docker
Check Namespace
[!Note]
This Namespace helping to control all monitoring app like- Prometheus, Grafana, Loki ect
Prometheus and Grafana Install and Configure
Install
#!/bin/bash # For AMD64 / x86_64 [ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.26.0/kind-linux-amd64 chmod +x ./kind sudo cp ./kind /usr/local/bin/kind VERSION="v1.31.0" URL="https://dl.k8s.io/release/${VERSION}/bin/linux/amd64/kubectl" INSTALL_DIR="/usr/local/bin" curl -LO "$URL" chmod +x kubectl sudo mv kubectl $INSTALL_DIR/ kubectl version --client rm -f kubectl rm -rf kind echo "kind & kubectl installation complete."
Run Prometheus Via Port
./kind_kubectl_config.yaml
now you can access Prometheus using this port. Like
kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane image: kindest/node:v1.31.2 - role: worker image: kindest/node:v1.31.2 - role: worker image: kindest/node:v1.31.2 extraPortMappings: - containerPort: 80 hostPort: 80 protocol: TCP - containerPort: 443 hostPort: 443 protocol: TCP
[!Note]
Change IP Address
Grafana Install and Configure
Run Grafana Via Port
kind create cluster --config kind-cluster-config.yaml --name my-kind-cluster
Get Grafana Username and Password
UserName
kubectl get nodes kubectl cluster-info
password
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.14.9/config/manifests/metallb-frr.yaml
[!Note]
You can change password
Grafana Dashboard.
Here you can choose different type Algorithm Dashboard
That’s all. Happy Learning :) .
[if it is helpful, giving a star to the repository ?]
Project Github Link
https://github.com/kamruzzamanripon/k8-node-react-mongodb-app
The above is the detailed content of Chat App Deploy on Kubernetes Using Kind, Metallb and Ingress. For more information, please follow other related articles on the PHP Chinese website!

The power of the JavaScript framework lies in simplifying development, improving user experience and application performance. When choosing a framework, consider: 1. Project size and complexity, 2. Team experience, 3. Ecosystem and community support.

Introduction I know you may find it strange, what exactly does JavaScript, C and browser have to do? They seem to be unrelated, but in fact, they play a very important role in modern web development. Today we will discuss the close connection between these three. Through this article, you will learn how JavaScript runs in the browser, the role of C in the browser engine, and how they work together to drive rendering and interaction of web pages. We all know the relationship between JavaScript and browser. JavaScript is the core language of front-end development. It runs directly in the browser, making web pages vivid and interesting. Have you ever wondered why JavaScr

Node.js excels at efficient I/O, largely thanks to streams. Streams process data incrementally, avoiding memory overload—ideal for large files, network tasks, and real-time applications. Combining streams with TypeScript's type safety creates a powe

The differences in performance and efficiency between Python and JavaScript are mainly reflected in: 1) As an interpreted language, Python runs slowly but has high development efficiency and is suitable for rapid prototype development; 2) JavaScript is limited to single thread in the browser, but multi-threading and asynchronous I/O can be used to improve performance in Node.js, and both have advantages in actual projects.

JavaScript originated in 1995 and was created by Brandon Ike, and realized the language into C. 1.C language provides high performance and system-level programming capabilities for JavaScript. 2. JavaScript's memory management and performance optimization rely on C language. 3. The cross-platform feature of C language helps JavaScript run efficiently on different operating systems.

JavaScript runs in browsers and Node.js environments and relies on the JavaScript engine to parse and execute code. 1) Generate abstract syntax tree (AST) in the parsing stage; 2) convert AST into bytecode or machine code in the compilation stage; 3) execute the compiled code in the execution stage.

The future trends of Python and JavaScript include: 1. Python will consolidate its position in the fields of scientific computing and AI, 2. JavaScript will promote the development of web technology, 3. Cross-platform development will become a hot topic, and 4. Performance optimization will be the focus. Both will continue to expand application scenarios in their respective fields and make more breakthroughs in performance.

Both Python and JavaScript's choices in development environments are important. 1) Python's development environment includes PyCharm, JupyterNotebook and Anaconda, which are suitable for data science and rapid prototyping. 2) The development environment of JavaScript includes Node.js, VSCode and Webpack, which are suitable for front-end and back-end development. Choosing the right tools according to project needs can improve development efficiency and project success rate.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver CS6
Visual web development tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.
