Coder Social home page Coder Social logo

etsangsplk / kubecfg Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vmware-archive/kubecfg

0.0 1.0 0.0 11.17 MB

A tool for managing complex enterprise Kubernetes environments as code.

License: Apache License 2.0

Makefile 0.09% Go 5.86% PureBasic 94.05%

kubecfg's Introduction

kubecfg

Build Status Go Report Card

A tool for managing Kubernetes resources as code.

kubecfg allows you to express the patterns across your infrastructure and reuse these powerful "templates" across many services, and then manage those templates as files in version control. The more complex your infrastructure is, the more you will gain from using kubecfg.

Yes, Google employees will recognise this as being very similar to a similarly-named internal tool ;)

Install

Pre-compiled executables exist for some platforms on the Github releases page.

On macOS, it can also be installed via Homebrew: brew install kubecfg

To build from source:

% PATH=$PATH:$GOPATH/bin
% go get github.com/ksonnet/kubecfg

Quickstart

# Show generated YAML
% kubecfg show -o yaml examples/guestbook.jsonnet

# Create resources
% kubecfg update examples/guestbook.jsonnet

# Modify configuration (downgrade gb-frontend image)
% sed -i.bak '\,gcr.io/google-samples/gb-frontend,s/:v4/:v3/' examples/guestbook.jsonnet
# See differences vs server
% kubecfg diff examples/guestbook.jsonnet

# Update to new config
% kubecfg update examples/guestbook.jsonnet

# Clean up after demo
% kubecfg delete examples/guestbook.jsonnet

Features

  • Supports JSON, YAML or jsonnet files (by file suffix).
  • Best-effort sorts objects before updating, so that dependencies are pushed to the server before objects that refer to them.
  • Additional jsonnet builtin functions. See lib/kubecfg.libsonnet.
  • Optional "garbage collection" of objects removed from config (see --gc-tag).

Infrastructure-as-code Philosophy

The idea is to describe as much as possible about your configuration as files in version control (eg: git).

Changes to the configuration follow a regular review, approve, merge, etc code change workflow (github pull-requests, phabricator diffs, etc). At any point, the config in version control captures the entire desired-state, so the system can be easily recreated in a QA cluster or to recover from disaster.

Jsonnet

Kubecfg relies heavily on jsonnet to describe Kubernetes resources, and is really just a thin Kubernetes-specific wrapper around jsonnet evaluation. You should read the jsonnet tutorial, and skim the functions available in the jsonnet std library.

kubecfg's People

Contributors

anguslees avatar burdiyan avatar falfaro avatar gauntletwizard avatar hausdorff avatar jessicayuen avatar jjo avatar mkmik avatar ngtuna avatar petr-k avatar prydonius avatar q3k avatar sebgoa avatar tomwilkie avatar

Watchers

 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.