Deploying Microservices with Kubernetes and Helm
Nathan Ojieabu
Deploying Microservices with Kubernetes and Helm
This project demonstrates deploying a microservices application using Kubernetes and Helm, progressing from basic manifests to a streamlined Helm-based approach. It uses Google's Online Boutique sample application.
Table of Contents
Project Overview
This project documents the deployment of microservices using different approaches, from basic Kubernetes manifests to Helm charts. The implementation uses Google's Online Boutique sample microservices application.
Implementation Steps
-
Initial Setup:
- Established a Kubernetes cluster on DigitalOcean.
- Logged into the DigitalOcean dashboard.
- Navigated to the Kubernetes section.
- Clicked on "Create Cluster".
- Selected the desired region and node specifications.
- Completed the setup by following the on-screen instructions.
- Downloaded the Kubernetes config file from the DigitalOcean dashboard.
- Assigned the config file to the
KUBECONFIG
environment variable:- Command:
export KUBECONFIG=path/to/your/kubeconfig
- Command:
- Established a Kubernetes cluster on DigitalOcean.
-
Basic Kubernetes Deployment:
- Created and deployed microservices using raw Kubernetes manifests.
- Command:
kubectl apply -f config.yaml
- Command:
- Implemented services like payment, email, currency, redis, and frontend.
- Configured appropriate probes, ports, and environment variables.
- Command:
kubectl describe deployment <deployment-name>
- Command:
- Created and deployed microservices using raw Kubernetes manifests.
-
Helm Chart Migration:
- Refactored deployments into reusable Helm charts.
- Command:
helm create <chart-name>
- Command:
- Created shared templates for common configurations.
- Implemented two main charts:
microservices
: Generic chart for application services.redis
: Specialized chart for Redis deployment.
- Command:
helm lint <chart-directory>
- Refactored deployments into reusable Helm charts.
-
Helmfile Integration:
- Implemented Helmfile for orchestrating multiple Helm releases.
- Command:
helmfile apply
- Command:
- Streamlined deployment process.
- Command:
helmfile sync
- Command:
- Implemented Helmfile for orchestrating multiple Helm releases.
-
Accessing the Frontend Service:
- The frontend service is exposed via a LoadBalancer.
- Accessible at
http://<LoadBalancerIP>:3000
Repository Structure
config.yaml
: Original Kubernetes manifests.helm-charts/
microservices/
: Common chart for application services.redis/
: Specialized chart for Redis deployment.
Technologies Used
- Kubernetes
- Helm
- Helmfile
- DigitalOcean Kubernetes
- Google Cloud Microservices Demo Images