Git Product home page Git Product logo

cosmos-operator's Introduction

Cosmos Operator

Project Status: Initial Release GoDoc Go Report Card License: Apache-2.0 Version

Cosmos Operator is a Kubernetes Operator for blockchains built with the Cosmos SDK.

The long-term vision of this operator is to allow you to "configure it and forget it".

Motivation

Kubernetes provides a foundation for creating highly-available, scalable, fault-tolerant applications. Additionally, Kubernetes provides well-known DevOps patterns and abstractions vs. traditional DevOps which often requires "re-inventing the wheel".

Furthermore, the Operator Pattern allows us to mix infrastructure with business logic, thus minimizing human intervention and human error.

Disclaimers

  • Tested on Google's GKE and Bare-metal with Kubeadm. Although kubernetes is portable, we cannot guarantee or provide support for AWS, Azure, or other kubernetes providers.
  • Requires a recent version of kubernetes: v1.23+.
  • CosmosFullNode: The chain must be built from the Cosmos SDK.
  • CosmosFullNode: Validator sentries require a remote signer such as horcrux.
  • CosmosFullNode: The controller requires heighliner images. If you build your own image, you will need a shell sh and set the uid:gid to 1025:1025. If running as a validator sentry, you need sleep as well.
  • CosmosFullNode: May not work for all Cosmos chains. (Some chains diverge from common conventions.) Strangelove has yet to encounter a Cosmos chain that does not work with this operator.

CosmosFullNode CRD

Status: v1, stable

CosmosFullNode is the flagship CRD. Its purpose is to deploy highly-available, fault-tolerant blockchain nodes.

The CosmosFullNode controller is like a StatefulSet for running Cosmos SDK blockchains.

A CosmosFullNode can be configured to run as an RPC node, a validator sentry, or a seed node. All configurations can be used as persistent peers.

As of this writing, Strangelove has been running CosmosFullNode in production for many months.

Minimal example yaml

Full example yaml

Why not a StatefulSet?

Each pod requires different config, such as peer settings in config.toml and mounted node keys. Therefore, a blanket template as found in StatefulSet did not suffice.

Additionally, CosmosFullNode gives you more control over individual pod and pvc pairs vs. a StatefulSet to help the human operator debug and recover from situations such as a corrupted PVCs.

Support CRDs

These CRDs are part of the operator and serve to support CosmosFullNodes.

Quick Start

See the quick start guide.

Contributing

See the contributing guide.

Best Practices

See the best practices guide for CosmosFullNode.

Roadmap

Disclaimer: Strangelove has not committed to these enhancements and cannot estimate when they will be completed.

  • Scheduled upgrades. Set a halt height and image version. The controller performs a rolling update with the new image version after the committed halt height.
  • Support configuration suitable for validator sentries.
  • Reliable, persistent peer support.
  • Quicker p2p discovery using private peers.
  • Advanced readiness probe behavior. (The CometBFT rpc status endpoint is not always reliable.)
  • Automatic rollout for PVC resizing. (Currently human intervention required to restart pods after PVC resized.) Requires ExpandInUsePersistentVolumes feature gate.
  • Automatic PVC resizing. The controller increases PVC size once storage reaches a configured threshold; e.g. 80% full.
  • Bootstrap config using the chain registry. Query the chain registry and set config based on the registry.
  • Validate p2p such as peers, seeds, etc. and filter out non-responsive peers.
  • HPA support.
  • Automatic upgrades. Controller monitors governance and performs upgrade without any human intervention.
  • Corrupt data recovery. Detect when a PVC may have corrupted data. Restore data from a recent VolumeSnapshot.
  • Safe, automatic backups. Create periodic VolumeSnapshots of PVCs while minimizing chance of data corruption during snapshot creation.

License

Copyright 2023 Strangelove Ventures LLC.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

cosmos-operator's People

Contributors

davidnix avatar dependabot[bot] avatar agouin avatar antityping avatar boojamya avatar justyntemme avatar nourspace avatar pfc-developer avatar beckettsean avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.