All Projects → Comcast → K8sh

Comcast / K8sh

Licence: apache-2.0
A simple, easily extensible shell for navigating your kubernetes clusters

Programming Languages

shell
77523 projects
bash
514 projects

Projects that are alternatives of or similar to K8sh

k8scc
# K8S Crash Course
Stars: ✭ 16 (-88.24%)
Mutual labels:  k8s, kubectl
vcluster
vcluster - Create fully functional virtual Kubernetes clusters - Each vcluster runs inside a namespace of the underlying k8s cluster. It's cheaper than creating separate full-blown clusters and it offers better multi-tenancy and isolation than regular namespaces.
Stars: ✭ 1,360 (+900%)
Mutual labels:  k8s, kubectl
command-line-cheat-sheet
📝 A place to quickly lookup commands (bash, vim, git, AWS, Docker, Terraform, Ansible, kubectl)
Stars: ✭ 30 (-77.94%)
Mutual labels:  k8s, kubectl
kahoy
Simple Kubernetes raw manifests deployment tool
Stars: ✭ 33 (-75.74%)
Mutual labels:  k8s, kubectl
Rakkess
Review Access - kubectl plugin to show an access matrix for k8s server resources
Stars: ✭ 751 (+452.21%)
Mutual labels:  k8s, kubectl
kubectl-janitor
List Kubernetes objects in a problematic state
Stars: ✭ 48 (-64.71%)
Mutual labels:  k8s, kubectl
kubectl-images
🕸 Show container images used in the cluster.
Stars: ✭ 153 (+12.5%)
Mutual labels:  k8s, kubectl
Ketall
Like `kubectl get all`, but get really all resources
Stars: ✭ 233 (+71.32%)
Mutual labels:  k8s, kubectl
Gcr.io mirror
all of the gcr.io docker image mirror
Stars: ✭ 650 (+377.94%)
Mutual labels:  k8s, kubectl
Geodesic
🚀 Geodesic is a DevOps Linux Distro. We use it as a cloud automation shell. It's the fastest way to get up and running with a rock solid Open Source toolchain. ★ this repo! https://slack.cloudposse.com/
Stars: ✭ 629 (+362.5%)
Mutual labels:  k8s, kubectl
k8s-deployer
Deploy Kubernetes service and store retrieved information in the Consul K/V store
Stars: ✭ 23 (-83.09%)
Mutual labels:  k8s, kubectl
Kube Aliases
Kubernetes Aliases and Bash Functions
Stars: ✭ 40 (-70.59%)
Mutual labels:  k8s, kubectl
kubeswitch
visually select kubernetes context/namespace from tree
Stars: ✭ 15 (-88.97%)
Mutual labels:  k8s, kubectl
kube-lineage
A CLI tool to display all dependencies or dependents of an object in a Kubernetes cluster.
Stars: ✭ 238 (+75%)
Mutual labels:  k8s, kubectl
Ansible Role Kubernetes
Ansible Role - Kubernetes
Stars: ✭ 247 (+81.62%)
Mutual labels:  k8s, kubectl
kube-dump
Backup a Kubernetes cluster as a yaml manifest
Stars: ✭ 142 (+4.41%)
Mutual labels:  k8s, kubectl
Maratona Kubernetes
Repositório de código de demonstrações da Maratona Kubernetes 🇧🇷
Stars: ✭ 152 (+11.76%)
Mutual labels:  k8s, kubectl
Kubefwd
Bulk port forwarding Kubernetes services for local development.
Stars: ✭ 2,713 (+1894.85%)
Mutual labels:  k8s, kubectl
Allok8
⚡️A pretty swell Kubernetes visualization tool
Stars: ✭ 281 (+106.62%)
Mutual labels:  k8s, kubectl
K8s Utils
Kubernetes Utility / Helper Scripts
Stars: ✭ 33 (-75.74%)
Mutual labels:  k8s, kubectl

k8sh

k8sh Screenshot

A shell wrapper for bash including aliases for kubectl that makes it easy to navigate between and execute commands on different kubernetes clusters and namespaces.

This script is designed to be as short and simple as possible and also easily extensible so you can make it your own without too much deep knowledge of bash.

First time

Clone the repo and then make sure k8sh has execute permissions:

chmod +x k8sh

Now you can execute k8sh!

./k8sh

Add to a PATH directory to execute anywhere.

k8sh will automatically look at your current kubectl configuration to determine your current kubernetes context and namespace.

Context and Namespace Commands

k8sh automatically keeps track of the current context and namespace you are operating in. These are displayed when starting up k8sh and on the k8sh prompt.

To switch contexts:

ct <context_to_switch_to>

To list available contexts:

ct

To switch namespaces:

ns <namespace_to_switch_to>

To list available namespaces:

ns

NOTE: When changing the context, the change is made globally to kubectl as if you did a kubectl config use-context yourself. The namespace, however, is kept track of by k8sh. The standard kubectl command is aliased to always include the namespace that is currently selected within k8sh.

Aliases

As stated above, when inside of k8sh the standard kubectl command is aliased to always include the namespace that is currently selected. k8sh also includes many other aliases to make accessing commonly used kubectl commands a snap.

k

k is an easy shorthand for kubectl

Common Actions

Shorthands for common actions

  • describe -> k describe
  • get -> k get
  • create -> k create
  • apply -> k apply
  • delete -> k delete
  • scale -> k scale
  • rollout -> k rollout
  • logs -> k logs
  • explain -> k explain

Query for common resources (kubectl get)

Instead of typing out kubectl get pods/services/replicationcontrollers/etc you can simply type the following aliases to get a list of those resources:

  • pods
  • services
  • deployments / dep
  • replicasets
  • replicationcontrollers / rc
  • nodes
  • limitranges
  • limits
  • events
  • persistentvolumes / pv
  • persistentvolumeclaims / pvc
  • namespaces
  • ingresses / ing
  • configmaps
  • secrets

Tab Completion

The ct, ns, k (as well as kubectl) commands support tab completion. k completion requires bash-completion to be installed in order to function which in turn requires bash 4.1+.

Installing bash 4 / bash-completion on MacOSX

Upgrading to Bash 4: https://itnext.io/upgrading-bash-on-macos-7138bd1066ba

Installing Bash Completion: https://davidalger.com/posts/bash-completion-on-os-x-with-brew/

.k8sh_extensions

On startup k8sh looks for a .k8sh_extensions file in your home directory. If it is there, it loads it as an inline bash script so you can supply your own aliases and functions to execute within k8sh.

To force the extensions file to be reloaded while in a k8sh session you can run:

reloadExtensions

See examples/k8sh_extensions for some examples of what extensions can do.

Todo

  • Feel free to submit your ideas!
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].