k8s-client | Ruby Kubernetes API client | REST library

 by   kontena Ruby Version: v0.10.4 License: Apache-2.0

kandi X-RAY | k8s-client Summary

kandi X-RAY | k8s-client Summary

k8s-client is a Ruby library typically used in Web Services, REST, Nodejs applications. k8s-client has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

The top-level K8s::Client provides access to separate APIClient instances for each Kubernetes API Group (v1, apps/v1, etc.), which in turns provides access to separate ResourceClient instances for each API resource type (nodes, pods, deployments, etc.). Individual resources are returned as K8s::Resource instances, which provide attribute access (resource.metadata.name). The resource instances are returned by methods such as client.api('v1').resource('nodes').get('foo'), and passed as arguments for client.api('v1').resource('nodes').create_resource(res). Resources can also be loaded from disk using K8s::Resource.from_files(path), and passed to the top-level methods such as client.create_resource(res), which lookup the correct API/Resource client from the resource apiVersion and kind. The different K8s::Error::API subclasses represent different HTTP response codes, such as K8s::Error::NotFound or K8s::Error::Conflict.

            kandi-support Support

              k8s-client has a low active ecosystem.
              It has 74 star(s) with 21 fork(s). There are 11 watchers for this library.
              It had no major release in the last 12 months.
              There are 15 open issues and 42 have been closed. On average issues are closed in 26 days. There are 3 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of k8s-client is v0.10.4

            kandi-Quality Quality

              k8s-client has no bugs reported.

            kandi-Security Security

              k8s-client has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              k8s-client is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              k8s-client releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed k8s-client and discovered the below as its top functions. This is intended to give you an instant insight into k8s-client implemented functionality, and help decide if they suit your requirements.
            • Sends multiple requests to the server .
            • Prune all resources in the list
            • Parse a response object
            • Merge two hashes .
            • Create a new instance of the resource .
            • Performs an HTTP request .
            • Watch for a notification
            • Fetch all available resources
            • Fetches resources from resources
            • Prepare a resource
            Get all kandi verified functions for this library.

            k8s-client Key Features

            No Key Features are available at this moment for k8s-client.

            k8s-client Examples and Code Snippets

            No Code Snippets are available at this moment for k8s-client.

            Community Discussions


            How can I list all the clusters using k8s java library
            Asked 2021-Apr-28 at 12:34

            I want to access the k8s configuration api through a java client or any other supported language. How can I do these kubectl commands using k8s-client :

            kubectl config get-contexts

            kubectl config use-context foo



            Answered 2021-Apr-28 at 12:34

            kubectl config get-contexts:

            Source https://stackoverflow.com/questions/67108262


            Watch a secret using annotation
            Asked 2020-Apr-18 at 20:32

            I want to watch secrets for a specific service account. How can I do it using fabric8 k8s-client ? I can create watch using a field ( like below ) but how can I do for annotation as service account detail is available as annotation .



            Answered 2020-Apr-18 at 20:32

            You cannot, annotations are not indexed. Only labels are. You’ll have to do that filtering client side.

            Source https://stackoverflow.com/questions/61295723


            How to fix 'java.lang.NoClassDefFoundError: io/fabric8/kubernetes/api/model/apps/Deployment'
            Asked 2019-Nov-05 at 01:42

            I have been trying to integrate spark interpreter on zeppelin (v0.7.3) on a Kubernetes cluster. However, as a complication of having k8s version 1.13.10 on the servers https://issues.apache.org/jira/browse/SPARK-28921

            I needed to upgrade my spark k8s-client to v4.6.1 as indicated here https://github.com/GoogleCloudPlatform/spark-on-k8s-operator/issues/591#issuecomment-526376703

            But when I try executing a spark command sc.version on zeppelin-ui, I get:



            Answered 2019-Nov-05 at 01:42

            After some rigorous research and help from my colleagues, I was able to verify that io/fabric8/kubernetes/api/model/apps/Deployment didn't exist at Kubernetes-model-v2.0.0. Upgrading the jar to v3.0.0 fixed the issue.

            Source https://stackoverflow.com/questions/58602643


            kubernetes go-client PersistentVolumeClaim not provisioned on request, stuck in Pending state
            Asked 2019-Mar-27 at 16:31

            While using the go-client API after I use the api.PersistentVolumeClaims(namespace).Create(createOpts) call the PersistentVolumeClaim appears as a resource but stays in the Pending state. I do not see any events when using kubectl describe pvc, I also don't see any Volumes being created etc.



            Answered 2019-Mar-27 at 16:31

            What you are doing in the code looks correct. However, it looks like that your PVC can't find a matching PV to bind together.

            It looks like you are using a hostPath PV (with a storage class) that doesn't support dynamic provisioning. Also, documented here.

            So most likely you will have to create a hostPath PV so that your PVC can bind to it. The volume has to be equal or greater in size as what you are requesting in your PVC.

            Another option is to use a Local volume that supports dynamic provisioning which is different from hostPath.

            You can debug the dynamic provisioning and binding of the PVC/PV by looking at the kube-controller-manager logs on your K8s control plane leader.

            Source https://stackoverflow.com/questions/55367948


            Authenticating Kubernetes API(NodeJS) client using certificate not successful
            Asked 2017-Apr-20 at 00:58

            I have deployed a Kubernetes cluster in google cloud and trying to access it using the Kubernetes NodeJS API, a kubernetes client.

            To do so, we need to authenticate with cluster. I tried using just the Username and Password method. I get the following error:



            Answered 2017-Apr-19 at 08:00

            To do so, we need to authenticate with cluster. I tried using just the Username and Password method. I get the following error:

            Looking at the NodeJS client, I don't see a way to provide the cluster CA certificate along with the username and password, so unless you set strictSSL to false this error message seems reasonable (your system is saying that it doesn't trust the certificate presented by the server, which is correct because it is a self-signed certificate authority). You may be able to work around this by installing the cluster CA certificate into your system certificate root store, but using a different authentication method (and filing a bug against the NodeJS client) seems preferable.

            Then I tried the authentication using the CAcert, ClientCert and ClientKey. I basically hardcoded the keys instead of importing it from the files.

            Did you also try importing files (for comparison)? It looks like this is a parsing error with the way that you are specifying the PEM blocks, and the libraries may do a better job reading the blocks from files instead of inline data.

            My intuition is authentication is possible only with keys. But I think I am doing something wrong with the certs. Do I need to create some other certificates out of this or is the method of using the certs is wrong ?

            Authentication should be possible with the username / password or the client keys. The NodeJS library also allows you to point to a kubeconfig file, which should allow you to specify the username / password along with the cluster CA certificate so that you can securely connect to the API endpoint if you want to use basic auth credentials.

            Source https://stackoverflow.com/questions/43486804

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install k8s-client

            Add this line to your application's Gemfile:.


            Bug reports and pull requests are welcome on GitHub at https://github.com/kontena/k8s-client.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone kontena/k8s-client

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link