DevOps Loop Power-Ups
Requirements
-
Connected Kubernetes cluster.
Some features need support for LoadBalancer services
-
Permission to list, create and delete resources on your cluster or at least one namespace
-
Some features need a local running docker engine
(e.g. Docker Desktop)
-
Some networking features will ask for root/sudo permissions
Install
Homebrew
brew install adrianliechti/tap/loop
Current State
- Highly in Progress
- Commands, arguments and output will change
Feature & Usage
Cluster Config
Import and merge a Kubernetes config file
loop config import -f path/to/config
List available config contexts or switch default context
loop config context [<context>]
List available namespaces or set default namespace
loop config namespace [<namespace>]
Cluster Applications
List applications on cluster or specified namespace
loop app list [--namespace <namespace>]
namespace: application namespace
Get config information about an application
loop app info --name <namespace> [--namespace <namespace>]
namespace: application namespace
Follow logs of all application's container(s)
loop app logs --name <namespace> [--namespace <namespace>]
namespace: application namespace
Cluster Network Access
This commands starts a lightwight VPN using sshuttle to route traffic to your cluster subnet.
loop connect [--namespace <namespace>]
namespace: namespace to create temporary helper in (default: default)
Cluster Services Access
Catapult allows you to connect to cluster services using their cluster network address or dns names.
This works by temporarly modifing your hosts file (/etc/hosts) and start multiple port forwardings.
loop catapult [--namespace <namespace>] [--scope <scope>]
namespace: forward only services of specified namespace
scope: scope the namespace for DNS resolutions
Cluster Web UI
Kubernetes Dashboard is a popular web-based admin UI.
This command allows to temporary start a preconfigured local instance to manage your cluster.
loop dashboard
Expose local Servers
Expose local http server
loop expose http --port <port> --host <hostname> [--namespace <name>] [--namespace <namespace>]
port: local tcp port to expose
hostname: external hostname of ingress
namespace: namespace to create temporary tunnel in (default: default)
name: name of tunnel deployment and service
loop expose tcp --port <port> [--host <hostname>] [--namespace <name>] [--namespace <namespace>]
port: local tcp ports to expose (can be specified multiple times)
hostname: external hostname of load balancer service (needs External-DNS)
namespace: namespace to create temporary tunnel in (default: default)
name: name of tunnel deployment and service
Temporary start a remote Docker daemon to leverage additional compute power or build complex amd64 images on a M1 processsor (as a real world usecase).
loop remote docker [--namespace <namespace>]
namespace: namespace to create temporary daemon in (default: default)
Start and attach a remote shell with the current workdir mounted in /mnt/src.
loop remote shell [--image >image>] [--namespace <namespace>]
image: image to use for shell
namespace: namespace to create temporary daemon in (default: default)
Start a remote VSCode Server with the current workdir mounted in /mnt/src.
loop remote code [--namespace <namespace>]
port: local port to access VSCode Server Web UI
namespace: namespace to create temporary daemon in (default: default)
Docker Image Utilities
Browse an explore image layers using dive
loop image browse --image <image>[:<tag>]
Lint images for security and configuration issues using dockle
loop image lint --image <image>[:<tag>]
Export Dockerfiles from images using
whaler
loop image analyze --image <image>[:<tag>]
Scan for vulnerability and configuration issue using
trivy
loop image scan --image <image>[:<tag>]
Create a runnable app image from source code in workdir. The command useses Cloud Native Buildpacks
and the Google Builder & Buildpacks by default
loop image pack --image <image> [--builder <builder image>]
image: application image
builder: builder image