Coder Social home page Coder Social logo

google / kasane Goto Github PK

View Code? Open in Web Editor NEW
169.0 7.0 20.0 197 KB

A simple kubernetes deployment manager

License: Apache License 2.0

Python 77.50% Gherkin 7.96% Dockerfile 2.07% Ruby 12.47%
kubernetes helm package-manager kubernetes-deployment ksonnet docker

kasane's Introduction

Kasane

kasane [ ้‡ใญ ] (n.) pile; heap; layers

This is not an official Google product

Kasane is a layering tool for kubernetes. It allows you to use the officially published YAML documents and extend them further with your local configuration.

Kasane can utilise Jsonnet for deep object modification and patching.

Archival notice

As time goes the k8s infrastructure takes shape. Kasane was an interesting experiment, but practice demonstrated that k8s deployments often need to interact with various third-party services, be those clouds, credential storages, or databases.

Kasane can be somewhat easily replicated with pulumi. Go try that.

Installation

Kasane requires Python 3+. Install via pip:

pip install kasane

Installation via Homebrew:

brew tap google/kasane https://github.com/google/kasane.git
brew install google/kasane/kasane

Running from a Docker container

You can run kasane from a docker container, the official image is gcr.io/kasaneapp/kasane. The image is based on alpine and comes pre-packaged with bash, curl, git and kubectl in addition to kasane itself. The workdir is set to /app and the default command is kasane show so you can quickly examine your local Kasanefiles like this:

$ docker run --rm -ti -v $PWD/examples/03-environment:/app gcr.io/kasaneapp/kasane
config:
  defaultFlag: UNRESOLVED_ENV_VAR__DEFAULT_VALUE
  defaultFromKasanefile: value
  jsonnetEnv: UNRESOLVED_ENV_VAR__OTHER_VALUE
kind: VendoredObject
metadata:
  name: PreconfiguredObject

Tagged builds for versions starting with 0.1.4 are also available as e.g. gcr.io/kasaneapp/kasane:0.1.4.

Examples

  • Simple Layers is an introduction to kasane features.
  • Jsonnet Transformations shows how to use Jsonnet to transform objects.
  • Environment explains how to use the external environment for customized pipelines.
  • Complex Service shows all the features together by using the upstream configuration for kubernetes dashboard, adding an ingress, and optionally enabling istio sidecar.

Similar tools

Helm

Helm is fully-featured package management solution for kubernetes. Compared to it, kasane is a swiss army knife. It's simple, lightweight, doesn't install helper code into your production. Kasane allows you to use original YAML files written by application authors, modifying them to your local needs. If you see a kubectl apply -f http:// example you can turn it into a Kasane deployment with a single line of code and then extend it to your needs.

Kasane doesn't do any templating, relying on Jsonnet for data manipulation. You won't ever need to count number of spaces to make sure your yaml go template is rendered correctly.

Ksonnet

Kasane is similar to Ksonnet but is much simpler to use. Kasane allows to re-use original YAML files and minimizes amount of custom Jsonnet code you need to write. Most of the time your Kasane project would consist of a Kasanefile and single yaml or jsonnet file. Still, Kasane allows runtime flexibility with conditional layers and custom environment.

License

Kasane is distributed under Apache-2 license. See the contributing guidelines on how you can contribute to the project.

kasane's People

Contributors

danishprakash avatar e1senh0rn avatar farcaller avatar kant avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

kasane's Issues

Load remote Kasanefiles

It'd be helpful if kasane could one-click install apps via

kasane apply http://example.com/Kasanefile

This can be done by extending the -p flag to point at Kasanefiles and adding support for remote projects.

Loaders for existing k8s objects

It would be useful to load an existing k8s object from the cluster or at least check its presence. It raises the question of where to store such an object, though, as it can't be directly loaded into the layers without issues. Migrate env to context and allow dynamic context?

Support uninstallation

To make kasane into a full-featured manager it needs to support object removal. That could be a trivial extension of layers for use cases when there are dynamically created objects.

Can define a global env named mode:

  • apply is the current kasane apply action
  • remove would allow to add additional objects to be removed with when: mode == 'remove' (also see #10)
  • purge would do the remove plus more (e.g. remove all the relevant CRDs)

Add some way to nest / include layers

As Kasanefiles grow longer they start to become a mess. Add some way to group several layers via an include: or block: option like ansible does that.

One question here is if jsonnet layers should be block scoped and I have a tentative answer of yes.

Investigate more helpers

e.g. if pwgen and pki management were integrated into kasane it could be a complete replacement for stash deployments.

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.