Cloud Native 9 min read

Understanding Helm and Kubernetes Operators

The article explains how Helm simplifies deploying complex Kubernetes applications with a single YAML chart but cannot manage runtime operations, while Kubernetes Operators—built on custom resource definitions and webhook logic—automate tasks such as scaling, upgrades, and side‑car injection, offering higher‑level lifecycle management.

Sohu Tech Products
Sohu Tech Products
Sohu Tech Products
Understanding Helm and Kubernetes Operators

This article provides a comprehensive explanation of Helm and Kubernetes Operators, comparing their roles in application deployment and management. It begins by introducing Helm as a tool for simplifying the deployment of complex applications like Apache Pulsar, which consists of multiple components including Broker, Proxy, Zookeeper, Bookkeeper, and optional monitoring tools like Prometheus and Grafana.

The article demonstrates how Helm allows users to configure and deploy entire systems through a single YAML file, eliminating the need to manually deploy each component individually. It shows how Helm generates and executes the necessary YAML files for all components, making it similar to kubectl apply but with pre-configured parameters.

The article then contrasts Helm with Kubernetes Operators, highlighting the limitations of Helm in application operations. While Helm can deploy and upgrade applications, it cannot handle operational tasks such as automatic scaling based on resource usage or disk expansion when thresholds are reached. These tasks typically require manual intervention through monitoring alerts.

The article explains that Operators can provide higher-level management by automatically handling complex upgrade processes, such as upgrading Zookeeper, Bookkeeper, Broker, and Proxy in the correct order while monitoring each component's status.

The article introduces Custom Resource Definitions (CRDs) as a key concept for Operators, explaining how they extend Kubernetes with custom resources similar to built-in resources like Deployment and Service. It provides examples of CRDs from Prometheus Operator and VictoriaMetrics Operator, showing how they define custom resources like Prometheus, Alertmanager, ScrapeConfig, VMPodScrape, VMCluster, and VMAlert.

The article explains the technical principles behind Operators, describing how they run as webhooks in the Kubernetes API server. It mentions that Operators can be written in any language but Go is commonly used with tools like kubebuilder and operator-sdk. The article provides a practical example using the OpenTelemetry Operator, showing how it injects OpenTelemetry agents into applications through a CRD called Instrumentation.

The article includes code examples demonstrating how Operators register webhook endpoints and handle Pod mutations to inject sidecar containers and environment variables. It also explains how operator-sdk tools automate the creation of CRDs from Go struct definitions.

Overall, the article provides a thorough understanding of the differences between Helm and Operators, their use cases, and the technical implementation of Operators using CRDs and webhooks.

MicroservicesKubernetesOpenTelemetryPrometheusVictoriaMetricsHelmApplication DeploymentCRDOperatorsWebhook
Sohu Tech Products
Written by

Sohu Tech Products

A knowledge-sharing platform for Sohu's technology products. As a leading Chinese internet brand with media, video, search, and gaming services and over 700 million users, Sohu continuously drives tech innovation and practice. We’ll share practical insights and tech news here.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.