GithubHelp home page GithubHelp logo

anguslees / kustomize-libsonnet Goto Github PK

View Code? Open in Web Editor NEW
52.0 4.0 7.0 17 KB

A jsonnet library that implements most of the kustomize operations

License: Apache License 2.0

Jsonnet 100.00%
kubernetes kustomize jsonnet

kustomize-libsonnet's Introduction

Kubernetes kustomize operations in jsonnet

This repo contains kustomize.libsonnet - a jsonnet library that re-implements the core transformation operations of the Kubernetes kustomize tool.

There are two major differences from the real kustomize tool:

  • The "overlay" file is described in jsonnet syntax, rather than kustomize.yaml. Jsonnet is significantly more powerful, so you can trivially implement (and share) new transformations using this approach.
  • The file I/O directives of kustomize are not implemented. Jsonnet is a sand-boxed language, which is good for security, and a library cannot implement "new" ways to read files. kubecfg already supports importing content from YAML/JSON files, and from remote URLs.

See example.jsonnet for one way to apply these transformations to existing YAML manifest files. The example uses the kubecfg tool (to parse the input YAML files), although kustomize.libsonnet itself should also work in other jsonnet environments. It can also be combined with other jsonnet libraries, such as kube.libsonnet and k.libsonnet.

Note that (just like regular kustomize) projects using kustomize.libsonnet can "stack": Team A can import some upstream JSON/YAML (or jsonnet!) manifests, and apply a kustomize.libsonnet "overlay" to modify it for their particular needs. Team B can import the kustomize.libsonnet from team A and then apply another kustomize.libsonnet overlay with their additional needs, and so on.

kustomize-libsonnet's People

Contributors

anguslees avatar camh- avatar groodt 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

Watchers

 avatar  avatar  avatar  avatar

kustomize-libsonnet's Issues

What is the proper usage of configMapGenerator() and secretGenerator() for files & literals?

This seems like it could be really useful, but I'm not clear how to fully utilize kustomize from the jsonnet side.

From the example, what should this look like?

local kustomization = kustomize.applyList([
  updateConfig,
  kustomize.namePrefix("staging-"),
  kustomize.commonLabels({variant: "staging", org: "acmeCorporation"}),
  kustomize.commonAnnotations({note: "Hello, I am staging!"}),
  kustomize.configMapGenerator(),
  kustomize.secretGenerator(),
]);

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.