question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Curlable Kubernaut API

See original GitHub issue

Kubernaut curl API:

Claim a cluster:
 GET <URL>/claims/<client-supplied-globally-scoped-claim-name>?expires=<deadline> -> kubeconfig file

Renew a claim:
 GET <URL>/claims/<client-supplied-globally-scoped-claim-name>?expires=<new-later-deadline> -> kubeconfig file

Release a cluster
 GET <URL>/claims/<client-supplied-globally-scoped-claim-name>?expires=<time-in-past> -> kubeconfig file

List claims:
 GET <URL>/claims/ -> json body with list of globally-scoped-claim-names

Rationale:

After having integrated kubernaut into a bunch of dev loops, I think the above curl-based API would probably be simpler/easier to work with and would avoid a bunch of the work associated with having a fat client.

FWIW, the list part isn’t actually directly needed by the integrations, but it is useful for debugging/correcting resource leaks.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
plombardi89commented, Nov 4, 2018

The only reason the API isn’t a first class citizen is because everyone wanted a CLI as the UX originally and handling tokens is messy.

0reactions
rhscommented, Nov 4, 2018

While not “pretty” this is a simple work around for (1) curl ... | python -c 'import sys, json; print json.load(sys.stdin)["claim"]["kubeconfig"]'

That workaround isn’t a super great option for me. Keep in mind I’m trying to write build files that work anywhere, and if I could count on a sane/working python environment everywhere, then I could just use the kubernaut cli.

To be clear I don’t really care about “pretty”, all I care about is how much work I need to do to leverage kubernaut for my use cases, and how brittle that work is in different environments. It really could be way easier and more portable if the server API were tweaked a little.

Regarding #2… customizable expirations is on the backlog to implemented. I have a hard time seeing how renew would work with GCE preemptible VM’s on the backend though since they are automatically reaped after 24 hours without exception.

It would just have a 24hr limit? I mean no claim is guaranteed to last anyways, right?

Read more comments on GitHub >

github_iconTop Results From Across the Web

cURLing the Kubernetes API server | by Niel de Wet - Medium
To interact with the Kubernetes API you need a ServiceAccount with the correct permissions, obtained through a (Cluster)Role and a RoleBinding.
Read more >
How To Call Kubernetes API using Simple HTTP Client - iximiuz
There are plenty of reasons to call the Kubernetes API using a CLI (like curl) or GUI (like postman) HTTP client. For instance,...
Read more >
Kubernetes is so Simple You Can Explore it with Curl - Tilt Blog
The Kubernetes API is /proc for distributed systems. Everything is a resource over HTTP. We can explore every Kubernetes resource with a few...
Read more >
Receive data from Kubernetes API using curl - laury.dev
Start by running kubectl's proxy. With its help, we avoid dealing with authentication headers. Test the connection with a basic call.
Read more >
Howto – cURL the kubernetes API server
Kubernetes management is abstracted via a rest API, which is served over a self signed secure connection. Frequently people run into issues ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found