Code Monkey home page Code Monkey logo

cli-utils's Introduction

cli-utils

This repo will contains binaries that built from libraries in cli-runtime.

commands

This repo can build a binary cli-utils by

GO111MODULE=on go generate
GO111MODULE=on go build 

Note that the binary name has not been finally decided yet and is subject to change. Currently there are following candidates:

k2
kapply
kctl
kutils
kcli
kut
(other better name)

It provides following builtin commands as well as dynamic commands.

Usage:
  cli-utils [command]

Available Commands:
  apply       Apply resource configurations.
  delete      Delete resources from a Kubernetes cluster.
  help        Help about any command
  prune       Prune obsolete resources.

apply has a status subcommand, which can display status for resources.

All of those commands can be run on a kustomization directory or a directory with raw Kubernetes yaml file.

# apply a kustomization directory to cluster
./cli-utils --kubeconfig ~/.kube/config apply cmd/test-manifests/hello

# display the status
./cli-utils --kubeconfig ~/.kube/config apply status cmd/test-manifests/hello --wait --every 2 --count 30

# delete the applied resources
./cli-utils --kubeconfig ~/.kube/config delete cmd/test-manifests/hello

# apply with watching for status
./cli-utils --kubeconfig ~/.kube/config apply status cmd/test-manifests/hello

libraries

You can also use cli-utils as a library. It provides a library to run apply, status, prune and delete on a list of Unstructured resources.

import (
   "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
   "sigs.k8s.io/cli-utils/pkg"
   )
 c := pkg.InitializeCmd(io.Stdout, nil)
 var resources []unstructured.Unstructured
 err := c.Apply(resources)
 err = c.Status(resources)
 err = c.Prune(resources)
 err = c.Delete(resources)

Examples

TODO: add examples

Community, discussion, contribution, and support

Learn how to engage with the Kubernetes community on the community page.

You can reach the maintainers of this project at:

Code of conduct

Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.

cli-utils's People

Contributors

liujingfang1 avatar barney-s avatar pwittrock avatar nikhita avatar k8s-ci-robot avatar sataqiu 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.