Create a namespace IP pool.
POST /nsippool
Parameter | Description | Required |
---|---|---|
name | Name of the IP pool to be created. Name must be unique within a namespace. | True |
namespace | Namespace defines the space within each name must be unique. | True |
subnet | IP addresses in the IP pool belongs to this subnet. | True |
start | The first IP address of the IP pool. | True (or use cidr instead) |
end | The last IP address of the IP pool. | True (or use cidr instead) |
cidr | Another representation of IP addresses in the IP pool. | True (or use start,end instead ) |
gateway | Gateway of all pods using IP addresses from this IP pool. | True |
vlanid | VLAN ID of the IP pool. (Integer) | True |
{
"name": "example-ns-pool",
"namespace": "default",
"subnet": "192.168.1.0/24",
"start": "192.168.1.5",
"end": "192.168.1.24",
"gateway": "192.168.1.1",
"vlanid": 100
}
Result | Description | Code |
---|---|---|
Success | Successfully create the IP pool, return its' full information. | 200 |
Existed | IP pool's name isn't unique within a namespace. | 400 |
Overlap | Some IPs are already in another namespace IP pool. | 400 |
Error | Error occurred when creating IP pool. | 400 |
{
"name": "example-ns-pool",
"namespace": "default",
"subnet": "192.168.1.0/24",
"start": "192.168.1.5",
"end": "192.168.1.24",
"gateway": "192.168.1.1",
"vlanid": 100,
"total": 20,
"PodMap": null
}
Read information of a namespace IP pool.
GET /nsippool/{namespace}/{name}
Parameter | Description |
---|---|
namespace | Object name and auth scope, such as for teams and projects. |
name | Name of the namespace IP pool. |
Result | Description | Code |
---|---|---|
Success | Get information of requested IP pool. | 200 |
Failed | Can not find requested IP pool. | 400 |
Read information of all namespace IP pools in the given namespace.
GET /getAllPool/{namespace}
Parameter | Description |
---|---|
namespace | Object name and auth scope, such as for teams and projects. |
Result | Description | Code |
---|---|---|
Success | Get information of all IP pools in the given namespace. | 200 |
Failed | Can not find IP pools in the given namespace. | 400 |
Delete information of a namespace IP pool.
DELETE /nsippool/{namespace}/{name}
Parameter | Description |
---|---|
namespace | Object name and auth scope, such as for teams and projects. |
name | Name of the namespace IP pool to be deleted. |
Result | Description | Code |
---|---|---|
Success | Successfully delete the namespace IP pool. | 200 |
Failed | Error occurred when deleting the IP pool. | 400 |
Create a service IP pool, usually is a part of a namespace IP pool.
POST /serviceIPPool
Parameter | Description | Required |
---|---|---|
name | Name of the IP pool to be created. Name must be unique within a namespace. | True |
namespace | Namespace defines the space within each name must be unique. | True |
start | The first IP address of the IP pool. | True (or use cidr instead) |
end | The last IP address of the IP pool. | True (or use cidr instead) |
cidr | Another representation of IP addresses in the IP pool. | True (or use start,end instead ) |
serviceName | Name of the kubernetes service using the IP pool. | True |
nsIPPoolName | Name of the namespace IP pool that the service IP pool belongs to. | True |
{
"name": "example-svc-pool",
"namespace": "default",
"start": "192.168.1.5",
"end": "192.168.1.14",
"serviceName": "example-service",
"nsIPPoolName": "example-ns-pool"
}
Result | Description | Code |
---|---|---|
Success | Successfully create the IP pool, return its' full information. | 200 |
Existed | IP pool's name isn't unique within a namespace. | 400 |
Overlap | Some IPs are already in another namespace IP pool. | 400 |
NotFound | Can not find requested namespace IP pool. | 400 |
Error | Error occurred when creating IP pool. | 400 |
{
"name": "example-svc-pool",
"namespace": "default",
"start": "192.168.1.5",
"end": "192.168.1.14",
"serviceName": "example-service",
"nsIPPoolName": "example-ns-pool",
"total": 10
}
Read information of a service IP pool.
GET /serviceIPPool/{namespace}/{name}
Parameter | Description |
---|---|
namespace | Object name and auth scope, such as for teams and projects. |
name | Name of the service IP pool. |
Result | Description | Code |
---|---|---|
Success | Get information of requested IP pool. | 200 |
Failed | Can not find requested IP pool. | 400 |
Delete information of a service IP pool.
DELETE /serviceIPPool/{namespace}/{name}
Parameter | Description |
---|---|
namespace | Object name and auth scope, such as for teams and projects. |
name | Name of the service IP pool to be deleted. |
Result | Description | Code |
---|---|---|
Success | Successfully delete the service IP pool. | 200 |
Failed | Error occurred when deleting the IP pool or there are pods still running with IPs in the service IP pool. | 400 |