A Clojure Wrapper for the kubernetes API.
Client is modelized by a map, initialization function depend of your Kubernetes distribution.
(ns test
(:require [clj-k8s.auth :as ka]))
;; From ServiceAccount
(def client (ka/from-service-account))
;; From GKE
(def client (ka/from-gcp-kube-config))
;; From Env
(def client (ka/from-token))
;; The default & Generic way
(def client (ka/from-spec {:base-url "https://localhost:6443"
:token "eyGteo8o..."
:namespace "wilkins"}))
KUBECONFIG
env variable is honored and ~/.kube/config
used as fallback if path isn't set via argv.K8S_TOKEN
should be setup if not provided by argumentThe Authentification method is subjected to change in the future, with a generic function for context resolving. We recommand using the from-spec
method for the moment.
TBD
TBD
TBD
TBD
TBD
minikube start --driver=podman
kubectl -n kube-system create serviceaccount toast
kubectl -n kube-system create clusterrolebinding toast-bind --clusterrole=cluster-admin --serviceaccount=kube-system:toast
export K8S_TOKEN=$(kubectl -n kube-system create token toast)
When token is properly exported, run tests as follow:
lein test
Copyright © 2019-2023 Oscaro
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close