Everything You Need to Know to Start Using Helm
90%
Using a Chart with Custom Configurations
If you want to customize the installation of a chart by changing specific configuration values, you can use the --set flag followed by the key-value pairs you want to modify. The general syntax is:
helm install [RELEASE_NAME] [CHART] --set key1=value1,key2=value2
As an example, let's upgrade the previous WordPress installation to use a LoadBalancer service with custom ports:
- The port
8000as the service port for HTTP traffic (instead of the default80already used by the Ingress controller) - The port
8443as the service port for HTTPS traffic (instead of the default443already used by the Ingress controller) - The node port
30008as the port to open on each node for HTTP traffic - The node port
30009as the port to open on each node for HTTPS traffic
# Complete reset - this will delete everything and start fresh
helm uninstall my-wordpress --ignore-not-found
kubectl delete pvc --all --ignore-not-found
sleep 10
# Install with custom configurations
helm upgrade -i \
my-wordpress \
bitnami/wordpress \
--set service.type=LoadBalancer \
--set service.ports.http=8000 \
--set service.ports.https=8443 \
--set service.nodePorts.http=30008 \
--set service.nodePorts.https=30009
# Test the installation
EXTERNAL_IP=$(\
kubectl get svc \
--namespace default \
my-wordpress \
-o jsonpath='{.status.loadBalancer.ingress[0].ip}'\
)
# Verify pods
kubectl get pods
# Verify services
kubectl get svc
# Access WordPress
echo "WordPress URL: http://$EXTERNAL_IP:8000/"
echo "WordPress URL (HTTPS): https://$EXTERNAL_IP:8443/"
service.type
Cloud-Native Microservices With Kubernetes - 2nd Edition
A Comprehensive Guide to Building, Scaling, Deploying, Observing, and Managing Highly-Available Microservices in KubernetesEnroll now to unlock all content and receive all future updates for free.
