A shell for local Kubernetes interaction https://code.wellware.dev/leemachin/broccolus
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lee Machin 294df37e7e Remove unused config 3 months ago
app Finish up IO stuff ready for stdlib 3 months ago
test Initial Stack setup 3 months ago
.gitignore Initial Stack setup 3 months ago
ChangeLog.md Initial Stack setup 3 months ago
LICENSE Initial Stack setup 3 months ago
README.org Flesh out readme a little more 3 months ago
Setup.hs Initial Stack setup 3 months ago
package.yaml Implement basic error handling 3 months ago
stack.yaml Initial Stack setup 3 months ago

README.org

Broccolus

Interaction with your kubernetes cluster through Lisp

The broc REPL

Running broc with no arguments will open up a fresh repl for quick scripting against Kubernetes. Similarly, broc --eval '(code)' can be used to execute quick commands on the fly, especially combined with broc --include somefuncs.broc.

Examples

Pod filtering

Query your cluster for pods, statuses, restarts, last errors, and more.


;; broc failedpods.broc

(defpod salesforce
  :app salesforce-api
  :container app)

(defpod kafka)

(query '((salesforce kafka) . (status last-error))

Port forwarding

Forward multiple ports to services in your cluster. forward-ports will listen to the connections and periodocally return the status of each one.


;; broc portfwd.broc

(defport node/express :local 8000 :remote 8000)
(defport nginx :local 8000 :remote 8000)

(defservice auth-api
  :port node/express
  :description "Authentication service")

(defservice loadbalancer
  :port nginx
  :description "Load balancer")

(defservice mysql
  :port 3305:3306
  :description "Main database")

(forward-ports '(auth-api
                 loadbalancer
                 mysql))