Kubernetes

Create an API Key and access token:-

For create a API Key and Access Token to refer this link :-

https://www.e2enetworks.com/help/knowledge-base/how-to-create-an-api-access-token/

List of Kubernetes

To find the list of Kubernetes, send a HTTP GET request :-

**https://api.e2enetworks.com/myaccount/api/v1/kubernetes/?apikey={{api_key}}&location=Delhi&project_id={{project-id}}

Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "code": 200,
    "data": [
        {
            "service_id": 4224,
            "service_name": "E2E-K8s-Cluster-441",
            "roles": [
                {
                    "role_name": "master",
                    "cardinality": 1,
                    "min_vms": null,
                    "max_vms": null,
                    "cooldown": 300,
                    "state": "Running",
                    "elasticity_policies": [],
                    "node_id_list": [
                        133442
                    ]
                }
            ],
            "state": "Running",
            "auto_scale_enabled": false,
            "plan_name": "E2E-K8s-Cluster",
            "version": "1.23",
            "master_node_id": 121161,
            "created_at": "Apr 04, 2023 02:42:45 PM",
            "cluster_id": 1201
        },
    ],
    "errors": {},
    "message": "Success"
    }

Create a new Kubernetes

To create a Kubernetes , send a Post request :-

**https://api.e2enetworks.com/myaccount/api/v1/kubernetes/?apikey={{api_key}}&location=Delhi&project_id={{project-id}}

Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{

"name": "E2E-K8s-Cluster-441",
"version": "1.23",
"slug_name": "C3-4vCPU-8RAM-100DISK-3rdGen-K8s1_23-master-metal-lb",
"vpc_id": "10660",
"sku_id": "1178",
"node_pools": [
    {
        "name": "pool-mueht",
        "slug_name": "C3-4vCPU-8RAM-100DISK-C3.8GB-CentOS-Stream",
        "sku_id": "1088",
        "specs_name": "C3.8GB",
        "worker_node": 2,
        "elasticity_dict": {}
    }
]

}

Delete a Kubernetes -

To delete a Kubernetes , send a DELETE request to Kubernetes endpoint :-

**https://api.e2enetworks.com/myaccount/api/v1/kubernetes/service/<<id>>?apikey={{api_key}}&location=Delhi&project_id={{project-id}}

Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...

Download yml -

To Get a yml file , send a GET request to Kubernetes endpoin :-

https://api.e2enetworks.com/myaccount/api/v1/kubernetes/cluster-config-download/<<<id>>>/?apikey={{api_key}}&project_id={{project-id}}

Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    apiVersion: v1
    clusters:
    - cluster:
            certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0t.............
    server: https://216.48.188.36:6443
    name: kubernetes
    contexts:
    - context:
    cluster: kubernetes
    user: kubernetes-admin
    name: kubernetes-admin@kubernetes
    current-context: kubernetes-admin@kubernetes
    kind: Config
    preferences: {}
    users:
    - name: kubernetes-admin
    user:
            client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FUR.............
            client-key-data: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktL.............
    }

Get Kubernetes Token -

To Get a token , send a GET request to Kubernetes endpoin :-

https://api.e2enetworks.com/myaccount/api/v1/kubernetes/proxy-ui-token/<<<id>>>/?apikey={{api_key}}&project_id={{project-id}}&location=Delhi

Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{

    "code": 200,
    "data": {
        "token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjdQRG85NTAwMHJjbi1PVDQ0........"
    },
    "errors": {},
    "message": "Success"

}

List Of Persistent Volume -

To find the list of Persistent Volume , send a GET request to Kubernetes endpoin :-

https://api.e2enetworks.com/myaccount/api/v1/persistent_volume/<<<cluster_id>>>/?apikey={{api_key}}&location=Delhi&project_id={{project-id}}

Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{

    "code": 200,
    "data": {
        "pv_list": [
            {
                "pv_id": 368,
                "pv_name": "PV-10GB-375",
                "created_at": "2023-04-04T10:51:59.523136Z",
                "pv_size": 10000,
                "status": "BOUND",
                "cluster_name": "E2E-K8s-Cluster-441",
                "service_id": 4222,
                "cluster_id": 1200
            }
        ],
        "namespace_name": "ns-17976",
        "ceph_user_id": "AQDIHyBjEdhAGxAAHIpRX6dyitUw5rsUeLcG8Q=="
    },
    "errors": {},
    "message": "Success"
}

Create a new Persistent Volume

To create a Persistent Volume , send a Post request :-

https://api.e2enetworks.com/myaccount/api/v1/persistent_volume/<<<cluster_id>>>/?apikey={{api_key}}&location=Delhi

Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "name": "PV-10GB-313",
    "pv_size": 10
}

Delete a Persistent Volume -

To delete a Persistent Volume , send a DELETE request to Kubernetes endpoint :-

https://api.e2enetworks.com/myaccount/api/v1/persistent_volume/<<<cluster_id>>>/<<<pv_id>>>/?apikey={{api_key}}&location=Delhi&project_id={{project-id}}

Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
"code": 200,
"data": {
    "pv_id": 368
},
"errors": {},
"message": "persistent volume deleted successfully"
}

List Of LB IP Pool -

To find the list of LB IP Pool , send a GET request to Kubernetes endpoin :-

https://api.e2enetworks.com/myaccount/api/v1/reserve_ips/k8s_ip/?apikey={{api_key}}&contact_person_id=null&location=Delhii&project_id={{project-id}}

Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "code": 200,
    "data": [
        {
            "ip_address": "216.48.188.6",
            "status": "Available",
            "bought_at": "04-04-2023 11:34",
            "vm_id": null,
            "vm_name": "--",
            "reserve_id": 7157,
            "appliance_type": "--",
            "reserved_type": "KubernetesIP"
        }
    ],
    "errors": {},
    "message": "Success",
    "is_limit_available": true,
    "reserved_ip_details": {
        "customer_max_limit": 3,
        "reserved_ips_count": 2
    },
    "reserve_ip_price": "INR 199.0 (excluding GST)",
    "currency": "INR"
}

Create a new LB IP Pool

To create a LB IP Pool ** , send a **Post request to Kubernetes endpoin :-

https://api.e2enetworks.com/myaccount/api/v1/reserve_ips/k8s_ip/?apikey={{api_key}}&project_id={{project-id}}&location=Delhi

Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "code": 200,
    "data": {
        "ip_address": "216.48.188.6",
        "status": "Available",
        "bought_at": "04-04-2023 11:34",
        "vm_id": null,
        "vm_name": "--",
        "reserve_id": 7157,
        "appliance_type": "--",
        "reserved_type": "KubernetesIP"
    },
    "errors": {},
    "message": "Success",
    "is_limit_available": true,
    "reserved_ip_details": {
        "customer_max_limit": 3,
        "reserved_ips_count": 1
    },
    "reserve_ip_price": "INR 199.0 (excluding GST)",
    "currency": "INR"
}

Attach LB IP Pool To Kubernetes

To Attach LB IP Pool To Kubernetes ** , send a **Post request to Kubernetes endpoin :-

https://api.e2enetworks.com/myaccount/api/v1/reserve_ips/k8s_public_ip/<<<ip>>>/actions/?apikey={{api_key}}&project_id={{project-id}}&location=Delhii

Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "vm_id": 126334,
    "type": "attach"
}

Detach LB IP Pool To Kubernetes

To detach LB IP Pool To Kubernetes ** , send a **Post request to Kubernetes endpoin :-

https://api.e2enetworks.com/myaccount/api/v1/reserve_ips/k8s_public_ip/<<<ip>>>/actions/?apikey={{api_key}}&project_id={{project-id}}&location=Delhi

Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "vm_id": 126334,
    "type": "detach"
}