Giter Site home page Giter Site logo

kptdev / kpt Goto Github PK

View Code? Open in Web Editor NEW
1.6K 47.0 221.0 60.55 MB

Automate Kubernetes Configuration Editing

Home Page: https://kpt.dev

License: Apache License 2.0

Makefile 1.05% Go 92.24% Dockerfile 0.32% Ruby 0.04% Shell 5.64% CSS 0.09% HTML 0.08% JavaScript 0.55%
krm kpt configuration-management gitops kubernetes kubectl kustomize containers schema openapi

kpt's Introduction

kpt: Automate Kubernetes Configuration Editing

kpt is a package-centric toolchain that enables a WYSIWYG configuration authoring, automation, and delivery experience, which simplifies managing Kubernetes platforms and KRM-driven infrastructure (e.g., Config Connector, Crossplane) at scale by manipulating declarative Configuration as Data.

Configuration as Data is an approach to management of configuration which:

  • makes configuration data the source of truth, stored separately from the live state
  • uses a uniform, serializable data model to represent configuration
  • separates code that acts on the configuration from the data and from packages / bundles of the data
  • abstracts configuration file structure and storage from operations that act upon the configuration data; clients manipulating configuration data don’t need to directly interact with storage (git, container images).

See the FAQ for more details about how kpt is different from alternatives.

Why kpt?

kpt enables WYSIWYG editing and interoperable automation applied to declarative configuration data, similar to how the live state can be modified with imperative tools.

See the rationale for more background.

The best place to get started and learn about specific features of kpt is to visit the kpt website.

Install kpt

kpt installation instructions can be found on kpt.dev/installation

kpt components

The kpt toolchain includes the following components:

  • kpt CLI: The kpt CLI supports package and function operations, and also deployment, via either direct apply or GitOps. By keeping an inventory of deployed resources, kpt enables resource pruning, aggregated status and observability, and an improved preview experience.

  • Function SDKs: Any general-purpose or domain-specific language can be used to create functions to transform and/or validate the YAML KRM input/output format, but we provide SDKs to simplify the function authoring process, in Go, Typescript, and Starlark, a Python-like embedded language.

  • Function catalog: A catalog of off-the-shelf, tested functions. kpt makes configuration easy to create and transform, via reusable functions. Because they are expected to be used for in-place transformation, the functions need to be idempotent.

  • Package orchestrator: The package orchestrator enables the magic behind the unique WYSIWYG experience. It provides a control plane for creating, modifying, updating, and deleting packages, and evaluating functions on package data. This enables operations on packaged resources similar to operations directly on the live state through the Kubernetes API.

  • Config Sync: While the package orchestrator can be used with any GitOps tool, Config Sync provides a reference GitOps implementation to complete the WYSIWYG management experience and enable end-to-end development of new features, such as OCI-based packages. Config Sync is also helping to drive improvements in upstream Kubernetes. For instance, Config Sync is built on top of git-sync and leverages Kustomize to automatically render manifests on the fly when needed. It uses the same apply logic as the kpt CLI.

  • Backstage UI plugin: We've created a proof-of-concept UI in the form of a Backstage UI plugin to demonstrate the WYSIWYG experience that's possible on top of the package orchestrator. More scenarios can be supported by implementing form-based editors for additional Kubernetes resource types.

Roadmap

You can read about the big upcoming features in the roadmap doc.

Contributing

If you are interested in contributing please start with contribution guidelines.

Contact

We would love to keep in touch:

  1. Join our Slack channel. You'll need to join Kubernetes on Slack first.
  2. Join our email list

kpt's People

Contributors

bgrant0607 avatar bharathkkb avatar christopherfry avatar datosh avatar dependabot[bot] avatar droot avatar etefera avatar frankfarzan avatar johnbelamaric avatar justinsb avatar karlkfi avatar kptdev-robot[bot] avatar liujingfang1 avatar martinmaly avatar mikebz avatar monopole avatar mortent avatar nagaharshita avatar natasha41575 avatar phanimarupaka avatar prachirp avatar pwittrock avatar rquitales avatar runewake2 avatar sdowell avatar seans3 avatar selfmanagingresource avatar shell32-natsu avatar yuwenma avatar zhugongpu 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  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

kpt's Issues

Don't introduce CRD support as first thinking

Defer explaining CRD support until the basics are clear.

npm init should install the Kubernetes 1.17 types by default without the need for a cluster. generating from a cluster should be opt-in

In comprehensive guide -- inline examples

The guide links to a set of examples, but its unclear which ones are good examples to start with. Also just show me the example next to the interface so I can compare them.

Documentation usability feedback for run.md

https://github.com/GoogleContainerTools/kpt/blob/master/docs/fn/run.md

  • Caveats section is very long since it's explaining multiple concepts. It's probably worth creating subsection for each
  • Need to use verbatim code style in many instances. e.g. metadata.annotations.[config.kubernetes.io/function]. Otherwise, it's hard to read.
  • Config Functions -> KPT Functions ?
  • We should simplify number of ways to invoke functions declarativey. Or at least, emphasize one approach in docs so user doesn't get overwhelmed.
  • It's ambiguous whether functions directory is required or just a convention used (functions dir is in fact a special dir recognized by kpt).
  • Also note that the implicit pattern is currently broken: #188

Follow up on yaml decoding / encoding issue for copyright header comments

There is a bug where the yaml libraries decode

old: resource
---
# Copyright
new: resource

as

old: resource
# Copyright
---
new: resource

To work around this, the ByteWriter replaces --- with \n---\n, which fixes the issue so that the decoded properly recognizes the resource / comment boundaries.

Follow up on this to see if it is an issue in the underlying libraries, or just how we use them.

[doc] `kpt svr apply` doc needs to be more detailed

I thought it would be mostly similar to kubectl apply, but I got an error that didn't make sense to me:

$ kpt svr apply .
error: unable to find one of 'kustomization.yaml', 'kustomization.yml' or 'Kustomization' in directory '/Users/davidebbo/tmp/tmp/helloworld'

The doc doesn't mention needing a kustomization file, so I'm not sure what I did wrong.

Sample hello world images don't seem to be accessible

Trying to deploy the sample to a test GKE cluster failed with:

Failed to pull image "gcr.io/kpt-dev/helloworld-gke:0.1.0": rpc error: code = Unknown desc = Error response from daemon: pull access denied for gcr.io/kpt-dev/helloworld-gke, repository does not exist or may require 'docker login'

Do the images need to be made public?

[doc] Binary installation should be more details

Right now, it's just a link to some binary, and you're on your own. Some people like more guidance. e.g. on my Mac, there were a bunch of extra step after clicking the link:

  • First I had to `chmod +x'
  • Then it was still blocked by the OS and I had to go in the system settings to allow it
  • The file needed to be renamed to kpt
  • It also needed to be moved to some folder on the path

Those may seem trivial, but I think it will lose some readers.

Things to Test umbrella issue

kpt:

  • get with tag including the path -- e.g. @v01.0 --> @package-examples/[email protected]
  • sync
  • environment variable controls

kustomize:

  • Merge -- Invert order
  • Cat Styles
  • Cat Strip comments
  • Fmt override file annotations
  • RC kind=false
  • ElementSetter
  • IsAssociative
  • ElementValues
  • MapSlice
  • filters.merge
  • filters.merg3
  • filters.IsReconciler

[doc] Sample `kpt pkg get` command doesn't work

Doc has this example:

$ kpt pkg get https://github.com/GoogleContainerTools/\
  kpt.git/package-examples/[email protected] helloworld

But pasting it as is fails because it ends up with an extra space in the middle of the url:

Error: accepts 2 arg(s), received 3
Usage:
  kpt pkg get REPO_URI[.git]/PKG_PATH[@VERSION] LOCAL_DEST_DIRECTORY [flags]

add realistic simple examples in the comprehensive guide

Example Set 1:

  • Generate: Create a Deployment + Service from an image (as data on ConfigMap input)
  • Validate: Make sure Deployments have Resources reservations set
  • Inject: Set Resource reservations to a default if unset

Example Set 2:

  • Inject: a side-car into a Deployment
  • Inject: an init container into a Deployment
  • Validate: Deployment and Service labels match if names match

[doc] Walkthroughs would be helpful to get started

Spending some time in the docs and playing with some of it, what I feel is missing the most is a good walkthrough that takes the user through an entire scenario command by command.

As it stands, there is a lot of great information, but you have to go to the doc for each command one by one and try to figure out how it all fits together.

The walkthrough doesn't have to cover everything, but could include e.g.:

  • Starting from nothing
  • Pulling down a demo package at some older revision using pkg
  • Applying the config to a cluster using svr
  • Making local changes to the package, e.g. by using cfg set
  • Pulling from the package source and showing how things get can get merged
  • Showing off functions

A nice screencast following the same walkthrough would be nice as well.

Support Diff

  • between local and upstream source
  • between local and upstream source at some version

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.