- Kubernetes cluster running (local, cloud, or KIND).
- kubectl installed and configured.
- Helm 3 installed. Install Helm with:
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.shapache/
├── Chart.yaml # Chart metadata
├── values.yaml # Default values for customization
└── templates/ # Kubernetes resource templates
├── deployment.yaml
└── service.yaml- Installation
Clone or navigate to the Helm chart directory.
Package the chart:
helm package .Install the Helm chart:
helm install apache ./apache --namespace apache-namespace --create-namespaceDefault Configuration The chart deploys an Apache HTTP Server with the following default values (from values.yaml):
replicaCount: 2
image:
repository: httpd
tag: 2.4
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
resources:
requests:
memory: "64Mi"
cpu: "100m"
limits:
memory: "128Mi"
cpu: "200m"You can customize these values by modifying values.yaml or passing them via the --set flag during installation.
Accessing the Deployment Check the status of your pods and services:
kubectl get pods -n apache-namespace
kubectl get svc -n apache-namespaceForward the service port to access Apache locally:
kubectl port-forward svc/apache 8080:80 -n apache-namespaceOpen your browser and visit:
http://localhost:8080
Uninstallation To remove the deployment and associated resources:
helm uninstall apache -n apache-namespace
kubectl delete namespace apache-namespaceCustomizing the Chart You can override default values using the --set flag. For example:
helm install apache ./apache \
--namespace apache-namespace \
--set replicaCount=3 \
--set image.tag=2.4.53 \
--set service.type=LoadBalancerAlternatively, modify the values.yaml file directly.
- Scalable: Set replicaCount to scale the number of pods.
- Configurable Resources: Customize CPU/memory requests and limits.
- Customizable Service: Supports ClusterIP, NodePort, or LoadBalancer service types.
Verify Helm and Kubernetes versions:
helm version
kubectl versionCheck Helm release status:
helm status apache -n apache-namespaceInspect pod logs:
kubectl logs <apache-pod-name> -n apache-namespace