Operators take a real-world operations team’s knowledge, wisdom, and expertise, and codify it into a computer program that helps operating complex server applications like databases, messaging systems, or web applications. Operators provide implementations for operating applications that are testable and thus more reliable at runtime.
While operators are equally applicable to application and infrastructure operations on other platforms, today they are mainly associated with Kubernetes. Kubernetes provides many functions for operating applications out-of-the-box, with operational tasks, including scaling, upgrading, or configuring applications, covered already. However, these tasks become complex and are repetitive, in particular with stateful applications, such as database servers. Kubernetes operators extend the functionality of the Kubernetes platform with automation to cover all the complex and repetitive commands and tasks.
Today’s IT can choose between operating applications on its own or taking a hosted service from public cloud providers. Users expect at least the same service level from hosting and operating applications in-house as from these providers. Consequently, site reliability engineers and DevOps teams use Kubernetes operators to reach public cloud providers’ performance and reliability levels. For them, operators are popular because they automate repetitive tasks and help to reduce the complexity of operations on the powerful but sophisticated Kubernetes platform.
Read our White Paper: A guide to Kubernetes Operators
A fundamental concept is that for every application there is one operator which covers all the knowledge about this application in various use cases. The operator concept includes a controller which watches the state of the application. In addition, the operator implements the application-specific operational tasks and executes them depending on defined events or commands by the user. If necessary, the operator interacts with the Kubernetes platform to control resources for deployed applications as required. For a more detailed explanation of the concepts of a Kubernetes operator, see our recent series on the software operator design pattern.
Yes, many Kubernetes operators are open source, for example an operator for the popular database server PostgreSQL, or the operator for the event streaming platform Kafka. Different operators can be arranged to manage a composition of applications, for example, to form an observability stack, including Grafana and Prometheus. Marketplaces provide a central location in the web for finding all relevant operators belonging to an ecosystem – for these examples the marketplace is charmhub.io.
For operators, an additional type of software has emerged, also available as open source: an orchestration engine enabling the deployment, integration and lifecycle management of applications using the operators. This engine also provides the interface to interact with one or multiple operators, via a CLI, via an API, using client libraries or using Web-based dashboards. In addition, the orchestration engine usually provides an abstraction layer covering different deployment substrates, such as multiple Kubernetes clusters on public and private clouds at the same time. Canonical’s open source software Juju is an example of an orchestration engine for Kubernetes operators.
The best way to create a Kubernetes operator is using a framework. A framework provides common, mature and proven elements for every operator. Reusing these frameworks accelerates development and results in a more reliable implementation. In addition the framework may contain runtime software, managing the lifecycle of an operator. To choose the right framework, consider the following:
Canonical’s experience building private clouds and running managed applications over the past years has led to a comprehensive software development kit for operators: the Charm SDK. The Charm SDK comprises a framework and tools for building, packaging and testing Kubernetes operators. In addition, Canonical provides Juju, an open-source orchestration engine for Kubernetes operators that enables applications’ deployment, integration and lifecycle management at any scale.
There is a lot to discover about Juju and the Charm SDK; please have a look at the linked resources below. You can also check out the presentations from our recent Operator Day events to learn how to build operators and see examples of operators for popular open-source applications.
More questions about operators, Juju and charms?
(Photo by Sivani Bandaru on Unsplash)
Our latest Canonical website rebrand did not just bring the new Vanilla-based frontend, it also…
At Canonical, the work of our teams is strongly embedded in the open source principles…
Welcome to the Ubuntu Weekly Newsletter, Issue 873 for the week of December 29, 2024…
Have WiFi troubles on your Ubuntu 24.04 system? Don’t worry, you’re not alone. WiFi problems…
The following is a post from Mark Shuttleworth on the Ubuntu Discourse instance. For more…
I don’t like my prompt, i want to change it. it has my username and…