All Projects → nubank → k8s-api

nubank / k8s-api

Licence: Apache-2.0 License
Kubernetes client, data driven

Programming Languages

clojure
4091 projects

Projects that are alternatives of or similar to k8s-api

client-go-examples
Collection of mini-programs demonstrating Kubernetes client-go usage.
Stars: ✭ 722 (+729.89%)
Mutual labels:  kubernetes-api, kubernetes-client
Kubernetes Workshop
⚙️ A Gentle introduction to Kubernetes with more than just the basics. 🌟 Give it a star if you like it.
Stars: ✭ 3,122 (+3488.51%)
Mutual labels:  kubernetes-api, kubernetes-client
steampipe-mod-kubernetes-compliance
Run individual controls or full compliance benchmarks for NSA CISA Kubernetes Hardening Guidance across all of your Kubernetes clusters using Steampipe.
Stars: ✭ 23 (-73.56%)
Mutual labels:  kubernetes-api
Objective-CPP
C++ compatibility library for Objective-C - Objective-CPP is a library intended to ease software development using Objective-C++. It declares categories on Objective-C classes, to work with the STL C++ types, such as std::string, std::vector, etc.
Stars: ✭ 37 (-57.47%)
Mutual labels:  foundation
Neslib
Delphi utilities shared with other Neslib repositories
Stars: ✭ 33 (-62.07%)
Mutual labels:  foundation
fnd-docs
Foundation developer docs
Stars: ✭ 33 (-62.07%)
Mutual labels:  foundation
curry
curry is a framework built to enhance and compliment Foundation and UIKit.
Stars: ✭ 47 (-45.98%)
Mutual labels:  foundation
rbac-tool
Rapid7 | insightCloudSec | Kubernetes RBAC Power Toys - Visualize, Analyze, Generate & Query
Stars: ✭ 546 (+527.59%)
Mutual labels:  kubernetes-api
FoundationNavWalker
A simple extension of wp_nav_menu to support Foundation 5's offcanvas nav
Stars: ✭ 17 (-80.46%)
Mutual labels:  foundation
Foundation
My Software BASE
Stars: ✭ 48 (-44.83%)
Mutual labels:  foundation
k8s
Python client library for the Kubernetes API
Stars: ✭ 35 (-59.77%)
Mutual labels:  kubernetes-client
kiva
Ground heat transfer calculation tool
Stars: ✭ 23 (-73.56%)
Mutual labels:  foundation
OperationPlus
NSOperation's missing pieces
Stars: ✭ 119 (+36.78%)
Mutual labels:  foundation
gen-crd-api-reference-docs
API Reference Docs generator for Kubernetes CRDs (used by Knative, Kubeflow and others)
Stars: ✭ 205 (+135.63%)
Mutual labels:  kubernetes-api
tools-android
Objective-C on Android with Foundation, CoreFoundation, and libdispatch.
Stars: ✭ 38 (-56.32%)
Mutual labels:  foundation
Sukari
🍯 Sweet Syntactical Sugar For Swift
Stars: ✭ 30 (-65.52%)
Mutual labels:  foundation
foundation-server
(v1) A scalable cryptocurrency mining pool server written in Node.js
Stars: ✭ 45 (-48.28%)
Mutual labels:  foundation
heisenberg
Zeek WordPress starter theme based on _s and Foundation
Stars: ✭ 77 (-11.49%)
Mutual labels:  foundation
tb-grid
tb-grid is a super simple and lightweight 12 column responsive grid system utilizing css grid.
Stars: ✭ 19 (-78.16%)
Mutual labels:  foundation
Extras
Just some extras..
Stars: ✭ 17 (-80.46%)
Mutual labels:  foundation

kubernetes-api

kubernetes-api is a Clojure library that acts as a kubernetes client

Motivation

We had a good experience with cognitect-labs/aws-api, and missed something like that for Kubernetes API. We had some client libraries that generated a lot of code, but it lacked discoverability and documentation.

clojure.deps

{:deps {nubank/k8s-api {:mvn/version "0.1.2"}}}

Leiningen

[nubank/k8s-api "0.1.2"]
;; In your ns statement
(ns my.ns
  (:require [kubernetes-api.core :as k8s]))

Usage

Instantiate a client

There're multiple options for authentication while instantiating a client. You can explicit set a token:

(def k8s (k8s/client "http://some.host" {:token "..."}))

Or a function that returns the token

(def k8s (k8s/client "http://some.host" {:token-fn (constantly "...")}))

You can also define client certificates

(def k8s (k8s/client "http://some.host" {:ca-cert     "/some/path/ca-docker.crt"
                                         :client-cert "/some/path/client-cert.pem"
                                         :client-key  "/some/path/client-java.key"}))

Discover

You can list all operations with

(k8s/explore k8s)

or specify a specific entity

(k8s/explore k8s :Deployment)
;=>
[:Deployment
 [:get "read the specified Deployment"]
 [:update "replace the specified Deployment"]
 [:delete "delete a Deployment"]
 [:patch "partially update the specified Deployment"]
 [:list "list or watch objects of kind Deployment"]
 [:create "create a Deployment"]
 [:deletecollection "delete collection of Deployment"]
 [:list-all "list or watch objects of kind Deployment"]]

get info on an operation

(k8s/info k8s {:kind :Deployment
               :action :create})
;=>
{:summary "create a Deployment",
 :parameters {:namespace java.lang.String,
              #schema.core.OptionalKey{:k :pretty} (maybe Str),
              #schema.core.OptionalKey{:k :dry-run} (maybe Str),
              #schema.core.OptionalKey{:k :field-manager} (maybe Str),
              :body ...},
 :returns {200 {#schema.core.OptionalKey{:k :apiVersion} (maybe Str),
                #schema.core.OptionalKey{:k :kind} (maybe Str),
                #schema.core.OptionalKey{:k :metadata} ...,
                #schema.core.OptionalKey{:k :spec} ...,
                #schema.core.OptionalKey{:k :status} ...},
           201 {#schema.core.OptionalKey{:k :apiVersion} (maybe Str),
                #schema.core.OptionalKey{:k :kind} (maybe Str),
                #schema.core.OptionalKey{:k :metadata} ...,
                #schema.core.OptionalKey{:k :spec} ...,
                #schema.core.OptionalKey{:k :status} ...},
           202 {#schema.core.OptionalKey{:k :apiVersion} (maybe Str),
                #schema.core.OptionalKey{:k :kind} (maybe Str),
                #schema.core.OptionalKey{:k :metadata} ...,
                #schema.core.OptionalKey{:k :spec} ...,
                #schema.core.OptionalKey{:k :status} ...},
           401 Any}}

Invoke

You can call an operation with

(k8s/invoke k8s {:kind    :ConfigMap
                 :action  :create
                 :request {:namespace "default"
                           :body      {:apiVersion "v1"
                                       :data       {"foo" "bar"}}}})

invoke it will return the body, with :request and :response in metadata

(meta (k8s/invoke ...))
;=>
{:request ...
 :response {:status ...
            :body ...}}

You can debug the request map with

(k8s/request k8s {:kind    :ConfigMap
                  :action  :create
                  :request {:namespace "default"
                            :body      {:apiVersion "v1"
                                        :data       {"foo" "bar"}}}})
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].