Skip to content

Latest commit

 

History

History

swiftkubectl

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

swiftkube-c-t-l

Mac + Linux

Overview

An example Kubernetes CLI using SwiftkubeClient implementing a tiny subset of the functionality for demo purposes.

This example demonstrates using SwiftkubeClient and SwiftkubeModel to communicate with API server. The implemented API mimicks kubectl.

Showcases

  • Load Kubernetes objects
    • by name in a given namespace
    • list objects in all namespaces
  • Create Kubernetes objects
    • ConfigMaps via --from-literal and --from-file
    • Deployments with a given image
  • Apply object manifests from a file
  • Server version information
  • Server API Versions
  • Server API Resources

SwiftkubeClient detects the current local kubeconfig automatically, i.e. if you've got a kubeconfig under ~/.kube/config it will be picked up and used for all swiftkubectl calls.

Usage

Clone this repository and run:

$ swift build
$ .build/debug/swiftkubectl -h
OVERVIEW: Swiftkube-c-t-l

An example kubernetes cli using SwiftkubeClient implementing
a tiny subset of the functionality for demo purposes.

USAGE: swiftkubectl <subcommand>

OPTIONS:
  -h, --help              Show help information.

SUBCOMMANDS:
  apply                   Apply a configuration to a resource by filename.
  get                     Display one or many resources.
  create                  Create a resource.
  version                 Print the client and server version information for the current context.
  api-versions            Print the supported API versions on the server, in the form of 'group/version'.
  api-resources           Print the supported API resources on the server.

  See 'swiftkubectl help <subcommand>' for detailed help.