(cluster-version spec)
Retrieve remote cluster build informations
Retrieve remote cluster build informations
(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
(create-namespace spec ns-spec)
(create-namespace spec ns-spec opts)
Create a new namespace
Create a new namespace
(delete-job spec n)
(delete-job spec n {:keys [namespace] :or {namespace default-ns} :as opts})
Deletes a job
Deletes a job
(delete-namespace spec ns)
(delete-namespace spec ns opts)
Delete the selected namespace
Delete the selected namespace
(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
(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
(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
(get-namespace spec n)
(get-namespace spec n opts)
Retrieve informations about the selected namespace
Retrieve informations about the selected namespace
(get-pod spec pod-name)
(get-pod spec pod-name {:keys [namespace] :or {namespace default-ns} :as opts})
Retrieve pod informations
Retrieve pod informations
(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
(list-jobs spec)
(list-jobs
spec
{:keys [namespace all-namespaces] :or {namespace default-ns} :as opts})
List or watch jobs
List or watch jobs
(list-pods spec)
(list-pods
spec
{:keys [namespace all-namespaces] :or {namespace default-ns} :as opts})
List or watch pods
List or watch pods
(mk-client)
(mk-client kube-config)
(mk-client kube-config token)
Generic client builder
There is several ways to instantiate the client:
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 EndpointKUBERNETES_SERVICE_HOST
- the Kubernetes Service Endpoint PortKUBERNETES_TOKEN
- the actual Kubernetes token to be used
See: https://docs.selectel.com/cloud/managed-kubernetes/instructions/service-account-tokenThe 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.
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.
(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
Detect if the application is currently running on k8s platform, or not
Detect if the application is currently running on k8s platform, or not
(submit-job spec job-spec)
(submit-job spec job-spec opts)
Submits a job for execution
Submits a job for execution
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close