curl --request GET \
--url https://api.rafftechnologies.com/api/v1/k8s/clusters/{cluster_id}/kubeconfig \
--header 'X-API-Key: <api-key>' \
--header 'X-Project-ID: <x-project-id>'import requests
url = "https://api.rafftechnologies.com/api/v1/k8s/clusters/{cluster_id}/kubeconfig"
headers = {
"X-Project-ID": "<x-project-id>",
"X-API-Key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Project-ID': '<x-project-id>', 'X-API-Key': '<api-key>'}
};
fetch('https://api.rafftechnologies.com/api/v1/k8s/clusters/{cluster_id}/kubeconfig', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rafftechnologies.com/api/v1/k8s/clusters/{cluster_id}/kubeconfig",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>",
"X-Project-ID: <x-project-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.rafftechnologies.com/api/v1/k8s/clusters/{cluster_id}/kubeconfig"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Project-ID", "<x-project-id>")
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.rafftechnologies.com/api/v1/k8s/clusters/{cluster_id}/kubeconfig")
.header("X-Project-ID", "<x-project-id>")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rafftechnologies.com/api/v1/k8s/clusters/{cluster_id}/kubeconfig")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Project-ID"] = '<x-project-id>'
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"kubeconfig": "<string>",
"api_endpoint": "https://q7z7zg.k8s.raffusercloud.com:6443"
}{
"error": "<string>",
"message": "<string>"
}Get Kubeconfig
Issue a kubeconfig for the cluster. Every kubeconfig expires — the default lifetime is 7 days; use expires_in to choose another (10 minutes to 30 days). Grants full cluster-admin access while valid, so store it like a password, and rotate access to invalidate every issued kubeconfig at once.
For anything long-running (a workstation, CI), prefer the CLI: raff kubernetes kubeconfig <cluster-id> writes a kubeconfig that fetches a fresh token for every kubectl command, so it never expires and stores no credential on disk.
curl --request GET \
--url https://api.rafftechnologies.com/api/v1/k8s/clusters/{cluster_id}/kubeconfig \
--header 'X-API-Key: <api-key>' \
--header 'X-Project-ID: <x-project-id>'import requests
url = "https://api.rafftechnologies.com/api/v1/k8s/clusters/{cluster_id}/kubeconfig"
headers = {
"X-Project-ID": "<x-project-id>",
"X-API-Key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Project-ID': '<x-project-id>', 'X-API-Key': '<api-key>'}
};
fetch('https://api.rafftechnologies.com/api/v1/k8s/clusters/{cluster_id}/kubeconfig', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rafftechnologies.com/api/v1/k8s/clusters/{cluster_id}/kubeconfig",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>",
"X-Project-ID: <x-project-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.rafftechnologies.com/api/v1/k8s/clusters/{cluster_id}/kubeconfig"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Project-ID", "<x-project-id>")
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.rafftechnologies.com/api/v1/k8s/clusters/{cluster_id}/kubeconfig")
.header("X-Project-ID", "<x-project-id>")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rafftechnologies.com/api/v1/k8s/clusters/{cluster_id}/kubeconfig")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Project-ID"] = '<x-project-id>'
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"kubeconfig": "<string>",
"api_endpoint": "https://q7z7zg.k8s.raffusercloud.com:6443"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
API key for authentication. Each key is bound to a specific account.
Headers
Project ID. Required for all mutating operations (create, delete, power actions, resize).
Path Parameters
Cluster ID (short id, e.g. q7z7zg)
Query Parameters
Kubeconfig lifetime in seconds (10 minutes to 30 days). Defaults to 7 days when omitted. Expired kubeconfigs stop working on their own.
600 <= x <= 2592000