Liking cljdoc? Tell your friends :D

clj-k8s.api


active-nsclj

(active-ns spec)
source

cluster-versionclj

(cluster-version spec)

Retrieve remote cluster build informations

Retrieve remote cluster build informations
sourceraw docstring

create-endpointclj

(create-endpoint spec ep-spec)
(create-endpoint spec
                 ep-spec
                 {:keys [namespace] :or {namespace default-ns} :as opts})

Create a new endpoint

Create a new endpoint
sourceraw docstring

create-namespaceclj

(create-namespace spec ns-spec)
(create-namespace spec ns-spec opts)

Create a new namespace

Create a new namespace
sourceraw docstring

delete-jobclj

(delete-job spec n)
(delete-job spec n {:keys [namespace] :or {namespace default-ns} :as opts})

Deletes a job

Deletes a job
sourceraw docstring

delete-namespaceclj

(delete-namespace spec ns)
(delete-namespace spec ns opts)

Delete the selected namespace

Delete the selected namespace
sourceraw docstring

delete-podclj

(delete-pod spec pod-name)
(delete-pod spec
            pod-name
            {:keys [namespace] :or {namespace default-ns} :as opts})

Delete a pod by his name

Delete a pod by his name
sourceraw docstring

get-endpointsclj

(get-endpoints spec ns)
(get-endpoints spec
               ep-name
               {:keys [namespace] :or {namespace default-ns} :as opts})

Fetches the specified endpoints or returns nil if not found

Fetches the specified endpoints or
returns nil if not found
sourceraw docstring

get-jobclj

(get-job spec n)
(get-job spec n {:keys [namespace] :or {namespace default-ns} :as opts})

Fetches the specified job or returns nil if not found

Fetches the specified job or returns nil if not found
sourceraw docstring

get-namespaceclj

(get-namespace spec n)
(get-namespace spec n opts)

Retrieve informations about the selected namespace

Retrieve informations about the selected namespace
sourceraw docstring

get-podclj

(get-pod spec pod-name)
(get-pod spec pod-name {:keys [namespace] :or {namespace default-ns} :as opts})

Retrieve pod informations

Retrieve pod informations
sourceraw docstring

job-podsclj

(job-pods spec n)
(job-pods spec n opts)

Fetches all of the pods belonging to a specific job

Fetches all of the pods belonging to a specific job
sourceraw docstring

list-jobsclj

(list-jobs spec)
(list-jobs
  spec
  {:keys [namespace all-namespaces] :or {namespace default-ns} :as opts})

List or watch jobs

List or watch jobs
sourceraw docstring

list-podsclj

(list-pods spec)
(list-pods
  spec
  {:keys [namespace all-namespaces] :or {namespace default-ns} :as opts})

List or watch pods

List or watch pods
sourceraw docstring

mk-clientclj

(mk-client)
(mk-client kube-config)
(mk-client kube-config token)

Generic client builder

There is several ways to instantiate the client:

  1. Without any arguments, the function will fetch several env variables to build the client. This method is useful for applications that run directly in a Kubernetes Pod, or for executions context where env variables are used for configurations, required env variables are:

  2. The more straightforward, and easy to setup is from a map spec directly, every elements are explicitly used for client building (probably this will be fetched from your component management system like Integrant.

  3. The last one is from, configuration file directly. The builder will auto-detect if the current context is a GKE cluster. If so, you'll need to be sure that the GOOGLE_APPLICATION_CREDENTIALS variable is set and corretly pointing to your SA for fetching token from API.

    WARN: If not running on GKE, you'll need to explicitly setup your token variable to use with your current context.

    Note: This methods is used by default if the builder isn't call with arguments AND all variables are not satisfied.

Generic client builder

There is several ways to instantiate the client:

1. Without any arguments, the function will fetch several env variables
   to build the client. This method is useful for applications that run directly
   in a Kubernetes Pod, or for executions context where env variables are used for
   configurations, required env variables are:

   - `KUBERNETES_SERVICE_HOST` - the Kubernetes Service Endpoint
   - `KUBERNETES_SERVICE_HOST` - the Kubernetes Service Endpoint Port
   - `KUBERNETES_TOKEN`        - the actual Kubernetes token to be used
      See: https://docs.selectel.com/cloud/managed-kubernetes/instructions/service-account-token

2. The more straightforward, and easy to setup is from a map spec directly, every
   elements are explicitly used for client building (probably this will be fetched
   from your component management system like Integrant.

3. The last one is from, configuration file directly. The builder will auto-detect
   if the current context is a GKE cluster. If so, you'll need to be sure that the
   `GOOGLE_APPLICATION_CREDENTIALS` variable is set and corretly pointing to your SA
   for fetching token from API.

   WARN: If not running on GKE, you'll need to explicitly setup your token variable to use
   with your current context.

   Note: This methods is used by default if the builder isn't call with arguments
         AND all variables are not satisfied.
sourceraw docstring

pod-logsclj

(pod-logs spec n)
(pod-logs spec n {:keys [namespace] :or {namespace default-ns} :as opts})

Reads the logs of a specific pod

Reads the logs of a specific pod
sourceraw docstring

running-from-kube?clj

Detect if the application is currently running on k8s platform, or not

Detect if the application is currently running on k8s
platform, or not
sourceraw docstring

submit-jobclj

(submit-job spec job-spec)
(submit-job spec job-spec opts)

Submits a job for execution

Submits a job for execution
sourceraw docstring

with-api-contextcljmacro

(with-api-context api-context & body)

A helper macro to wrap api-context with default values.

A helper macro to wrap *api-context*
with default values.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close