Skip to content

Latest commit

 

History

History
154 lines (107 loc) · 6.48 KB

README.md

File metadata and controls

154 lines (107 loc) · 6.48 KB

KUDO

CircleCI

Kubernetes Universal Declarative Operator (KUDO) provides a declarative approach to building production-grade Kubernetes Operators covering the entire application lifecycle.

Getting Started

See the Documentation with Examples.

Quick Start

Pre-requisites

Before you get started:

Go Modules

⚠️ 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.

Installation Instructions

  • Get KUDO repo: go get github.com/kudobuilder/kudo/
  • cd $GOPATH/src/github.com/kudobuilder/kudo
  • make install to deploy universal CRDs
  • make run to run the Operator with local go environment

Notes:

  1. 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
  1. 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 in export PATH=$GOPATH/bin:$PATH.

Running the Operator

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

Running the CLI

  • To create CLI: make cli
  • ensure $GOPATH/src/github.com/kudobuilder/kudo/bin is in your PATH

To run CLI: kubectl kudo

Useful Tools

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.

Concepts

  • 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)

Deploy your first Application

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

Community, Discussion, Contribution, and Support

Learn how to engage with the Kubernetes community on the community page.

KUDO Weekly Community Meetings

Weekly meetings occur every Thursday at 3pm UTC

You can discuss the agenda or reach the maintainers of this project at:

Quick links:

Code of Conduct

Participation in the Kudo community is governed by the Kubernetes Code of Conduct.