Kubernetes Universal Declarative Operator (KUDO) provides a declarative approach to building production-grade Kubernetes Operators covering the entire application lifecycle.
See the Documentation with Examples.
Before you get started:
- Install Go
1.12.3
or later - This project uses Go Modules. Set
GO111MODULE=on
in your environment. - Kubernetes Cluster
1.13
or later (e.g. Minikube) - Install kubectl with version
1.13
or later - Install Kustomize with version
2.0.3
or later
⚠️ This project uses Go Modules. Due to the current state of code generation in controller-tools and code-generator, KUDO currently must be cloned into its$GOPATH
-based location.
- Get KUDO repo:
go get github.com/kudobuilder/kudo/
cd $GOPATH/src/github.com/kudobuilder/kudo
make install
to deploy universal CRDsmake run
to run the Operator with local go environment
Notes:
- If
go get ...
is not functioning, an alternative is to:
cd $GOPATH
mkdir -p src/github.com/kudobuilder
cd src/github.com/kudobuilder
git clone [email protected]:kudobuilder/kudo.git
- Before
make install
you will need to have:
- minikube running (some of the tests run against it)
~/.git-credentials
must exist with git credentials.lint
in $PATH which is provided by having$GOPATH\bin
in$PATH
as inexport PATH=$GOPATH/bin:$PATH
.
In order to run KUDO CRDs must be installed. make install-crds
will install the CRDs which can be confirmed with kubectl get crds
resulting in something looking like:
$ kubectl get crds
NAME CREATED AT
frameworks.kudo.k8s.io 2019-04-12T19:50:18Z
frameworkversions.kudo.k8s.io 2019-04-12T19:50:18Z
instances.kudo.k8s.io 2019-04-12T19:50:18Z
planexecutions.kudo.k8s.io 2019-04-12T19:50:18Z
To update code generation and these manifests after an API object change, run make generate
and make manifests
.
To run operator: make run
- To create CLI:
make cli
- ensure
$GOPATH/src/github.com/kudobuilder/kudo/bin
is in yourPATH
To run CLI: kubectl kudo
Tools are located in tools.go
in order to pin their versions. Refer to (https://github.com/go-modules-by-example/index/blob/ac9bf72/010_tools/README.md)[https://github.com/go-modules-by-example/index/blob/ac9bf72/010_tools/README.md] for more information. The Makefile will automatically go install
the required tools before they are installed, using the versions specified by the module.
- Framework: High-level description of a deployable application (e.g., Apache Kafka)
- FrameworkVersion: Specific version of a deployable application, including lifecycle hooks for deployments, upgrades, and rollbacks (e.g., Kafka version 2.4.1)
- Instance: Resource created to manage an instance of specific FrameworkVersion. Instances are pets and have the same name throughout its entire lifecycle. (e.g., Kafka 2.4.1 cluster with 3 brokers)
- PlanExecution: Kudo-managed resource defining the inputs and status of an instance’s executable plans (e.g., upgrade kafka from version 2.4.1 -> 2.4.2)
Create a Framework
object for Zookeeper
$ kubectl apply -f https://raw.githubusercontent.com/kudobuilder/frameworks/master/repo/stable/zookeeper/versions/0/zookeeper-framework.yaml
framework.kudo.k8s.io/zookeeper created
Create a FrameworkVersion
for the Zookeeper Framework
$ kubectl apply -f https://raw.githubusercontent.com/kudobuilder/frameworks/master/repo/stable/zookeeper/versions/0/zookeeper-frameworkversion.yaml
frameworkversion.kudo.k8s.io/zookeeper-1.0 created
Create an Instance of the Zookeeper
$ kubectl apply -f https://raw.githubusercontent.com/kudobuilder/frameworks/master/repo/stable/zookeeper/versions/0/zookeeper-instance.yaml
instance.kudo.k8s.io/zk created
When an instance is created, the default deploy
plan is executed.
$ kubectl get planexecutions
NAME AGE
zk-deploy-317743000 53s
The statefulset defined in the FrameworkVersion
comes up with 3 pods:
kubectl get statefulset zk-zk
NAME DESIRED CURRENT AGE
zk-zk 3 3 1m20s
kubectl get pods
NAME READY STATUS RESTARTS AGE
zk-zk-0 1/1 Running 0 23s
zk-zk-1 1/1 Running 0 23s
zk-zk-2 1/1 Running 0 23s
Learn how to engage with the Kubernetes community on the community page.
Weekly meetings occur every Thursday at 3pm UTC
You can discuss the agenda or reach the maintainers of this project at:
Quick links:
Participation in the Kudo community is governed by the Kubernetes Code of Conduct.