Introduction to KUDO: Automate Day-2 Operations (I)
Learn more about the Kubernetes Universal Declarative Operator and how it can make it easier to use Kubernetes Operators using YAML.
Join the DZone community and get the full member experience.Join For Free
Operators are one of the most powerful tools when you are working with Kubernetes, especially when you are in a scenario where Stateful conditions are required like ordered and automated rolling updates, or graceful deployment/deletion and scaling/termination. The problem, however, is writing and building Operators require deep knowledge of Kubernetes internal and a lot lines of code.
Using Kubebuilder requires writing thousands lines of controller code in GO and existing implementations often don't cover the entire lifecycle. You can also go for Operator Framework in order to use Ansible or Helm charts but both have some limitations.
KUDO (Kubernetes Universal Declarative Operator) is an open-source toolkit that makes it easy to build Operators using YAML. Additionally, it provides a set of pre-built Operators, that you can use out-of-the-box or easily customize to help you standardizing operations.
Some of the reasons to try KUDO are:
- Provides abstractions for sequencing lifecycle operations using Kubernetes objects and plans (a kind of runbook).
- You can reuse and extend previous base Operators for custom Operators.
- Provides a kubectl plugin, so you can use 'kubectl kudo' to manage, deploy and debug all your workloads.
- Workloads are managed as CRDs which helps to keep everything in your repository with versioning.
- Existing Operators can be managed by KUDO.
How KUDO Works
KUDO uses different objects to handle workloads: Operator, OperatorVersion and Instance.
- Operator is being represented by a CRD object and is the high-level description of a deployable service.
- OperatorVersion represents implementation of an Operator's specific version of a deployable application. It contains objects, plans and parameters.
- Instance is an application instantiation to an OperatorVersion. Once created, it renders all parameters in templates such as services, pods or StatefulSets. You can create multiple instances of an OperatorVersion on your Kubernetes cluster.
How Kudo Orchestrates Orders Tasks
Kudo uses plans to orchestrate tasks through phases and steps using a structured runbook. Phases and steps can be run serial or parallel depending on the needs of your application. Some usual plans would be deploy, backup, restore or upgrade.
Published at DZone with permission of Sudip Sengupta. See the original article here.
Opinions expressed by DZone contributors are their own.