curl https://api.galadriel.com/v1/leases/lse_xyz123/kubeconfig \
-H "Authorization: Bearer YOUR_API_TOKEN" \
> ~/.kube/galadriel-lse-xyz123.conf
# Use with kubectl
export KUBECONFIG=~/.kube/galadriel-lse-xyz123.conf
kubectl get nodes
import requests
response = requests.get(
"https://api.galadriel.com/v1/leases/lse_xyz123/kubeconfig",
headers={"Authorization": "Bearer YOUR_API_TOKEN"}
)
kubeconfig = response.text
# Save to file
with open("kubeconfig.yaml", "w") as f:
f.write(kubeconfig)
print("Kubeconfig saved to kubeconfig.yaml")
const response = await fetch(
'https://api.galadriel.com/v1/leases/lse_xyz123/kubeconfig',
{
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
}
);
const kubeconfig = await response.text();
// Save to file or use in your application
console.log('Kubeconfig retrieved successfully');
apiVersion: v1
kind: Config
clusters:
- cluster:
certificate-authority-data: LS0tLS1CRUdJTi...
server: https://api.galadriel.com
name: galadriel-lse-xyz123
contexts:
- context:
cluster: galadriel-lse-xyz123
namespace: customer-alice-lse-xyz123
user: alice
name: galadriel-lse-xyz123
current-context: galadriel-lse-xyz123
users:
- name: alice
user:
token: eyJhbGciOiJSUzI1NiIsImtpZCI6IjEyMyJ9...
Leases
Get Kubeconfig
Get the kubeconfig for a lease to access the Kubernetes cluster
GET
/
v1
/
leases
/
{lease_id}
/
kubeconfig
curl https://api.galadriel.com/v1/leases/lse_xyz123/kubeconfig \
-H "Authorization: Bearer YOUR_API_TOKEN" \
> ~/.kube/galadriel-lse-xyz123.conf
# Use with kubectl
export KUBECONFIG=~/.kube/galadriel-lse-xyz123.conf
kubectl get nodes
import requests
response = requests.get(
"https://api.galadriel.com/v1/leases/lse_xyz123/kubeconfig",
headers={"Authorization": "Bearer YOUR_API_TOKEN"}
)
kubeconfig = response.text
# Save to file
with open("kubeconfig.yaml", "w") as f:
f.write(kubeconfig)
print("Kubeconfig saved to kubeconfig.yaml")
const response = await fetch(
'https://api.galadriel.com/v1/leases/lse_xyz123/kubeconfig',
{
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
}
);
const kubeconfig = await response.text();
// Save to file or use in your application
console.log('Kubeconfig retrieved successfully');
apiVersion: v1
kind: Config
clusters:
- cluster:
certificate-authority-data: LS0tLS1CRUdJTi...
server: https://api.galadriel.com
name: galadriel-lse-xyz123
contexts:
- context:
cluster: galadriel-lse-xyz123
namespace: customer-alice-lse-xyz123
user: alice
name: galadriel-lse-xyz123
current-context: galadriel-lse-xyz123
users:
- name: alice
user:
token: eyJhbGciOiJSUzI1NiIsImtpZCI6IjEyMyJ9...
Path Parameters
string
required
The lease ID
Response
Returns a Kubernetes config file in YAML format that can be used withkubectl.
curl https://api.galadriel.com/v1/leases/lse_xyz123/kubeconfig \
-H "Authorization: Bearer YOUR_API_TOKEN" \
> ~/.kube/galadriel-lse-xyz123.conf
# Use with kubectl
export KUBECONFIG=~/.kube/galadriel-lse-xyz123.conf
kubectl get nodes
import requests
response = requests.get(
"https://api.galadriel.com/v1/leases/lse_xyz123/kubeconfig",
headers={"Authorization": "Bearer YOUR_API_TOKEN"}
)
kubeconfig = response.text
# Save to file
with open("kubeconfig.yaml", "w") as f:
f.write(kubeconfig)
print("Kubeconfig saved to kubeconfig.yaml")
const response = await fetch(
'https://api.galadriel.com/v1/leases/lse_xyz123/kubeconfig',
{
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
}
);
const kubeconfig = await response.text();
// Save to file or use in your application
console.log('Kubeconfig retrieved successfully');
apiVersion: v1
kind: Config
clusters:
- cluster:
certificate-authority-data: LS0tLS1CRUdJTi...
server: https://api.galadriel.com
name: galadriel-lse-xyz123
contexts:
- context:
cluster: galadriel-lse-xyz123
namespace: customer-alice-lse-xyz123
user: alice
name: galadriel-lse-xyz123
current-context: galadriel-lse-xyz123
users:
- name: alice
user:
token: eyJhbGciOiJSUzI1NiIsImtpZCI6IjEyMyJ9...
Usage
Once you have the kubeconfig, you can use standard Kubernetes tools:# Set as current context
export KUBECONFIG=~/.kube/galadriel-lse-xyz123.conf
# View nodes
kubectl get nodes
# Deploy workloads
kubectl apply -f job.yaml
# Check GPU availability
kubectl describe nodes | grep nvidia.com/gpu