Kubernetes client, data driven
You can filter the paths from the OpenAPI specification. This is useful when you want to use a specific version of the api, or when you want to use a specific group of resources.
(def k8s (k8s/client "http://some.host" {:token "..."
:apis ["some.api/v1alpha1", "another.api"]}))
[!WARNING] [BREAKING] If you use this library to interact with CRDs, you need to explicit set the
:apis
. If you need both (CRDs and k8s resources), you can usekubernetes-api.core/default-apis
to select k8s default apis too.
This might break some clients, but it's required to make our client more resilient. Right now, the addition of any openapi schema (which is done automatically when you install a CRD or Aggregated API) can break the client even if you're not interacting with it.
We have 3 new fields:
:certificate-authority-data - a base64 encoded string with the certificate
authority data
:client-certificate-data - a base64 encoded string with the client certificate
alternative to :client-cert
:client-key-data - a base64 encoded string with the client key alternative
to :client-key
These new fields can be used interchangeably with the existing fields :client-cert/:ca-cert/:client-key
, meaning that you can mix and match file references and base64-encoded strings.
Before this release, if you created a client with :token
and :ca-cert
, it would ignore the :ca-cert
since we required the 3 components for a mTLS connection: CA certificate, client key and client cert.
Now you can set CA certificate independently, which means you can have secure connections over self-signed CAs, assuming you have a safe way of distributing such certificate.
Full Changelog: https://github.com/nubank/k8s-api/compare/0.2.1...0.3.0
Now the client has support for all Kubernetes patch strategies:
application/json-patch+json
application/merge-patch+json
application/strategic-merge-patch+json
application/apply-patch+yaml
You can look Kubernetes Documentation about patchs here
=> (k8s/explore client :ConfigMap)
[:ConfigMap
[:list "list or watch objects of kind ConfigMap"]
[:create "create a ConfigMap"]
[:deletecollection "delete collection of ConfigMap"]
[:list-all "list or watch objects of kind ConfigMap"]
[:get "read the specified ConfigMap"]
[:update "replace the specified ConfigMap"]
[:delete "delete a ConfigMap"]
[:patch/json "update the specified ConfigMap using RFC6902"]
[:patch/strategic "update the specified ConfigMap using a smart strategy"]
[:patch/json-merge "update the specified ConfigMap using RFC7286"]
[:apply/server
"create or update the specified ConfigMap using server side apply"]]