forked from spidernet-io/spiderpool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request spidernet-io#1904 from Icarus9913/fix/wk/docs
update CRD documentation
- Loading branch information
Showing
7 changed files
with
298 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,71 @@ | ||
# SpiderEndpoint | ||
|
||
A SpiderEndpoint resource represents IP address allocation details for a specific endpoint object. | ||
|
||
## CRD definition | ||
|
||
The SpiderEndpoint custom resource is modeled after a standard Kubernetes resource | ||
and is split into the `status` section: | ||
|
||
```text | ||
type SpiderEndpoint struct { | ||
[...] | ||
// Status is the status of the SpiderEndpoint | ||
Status WorkloadEndpointStatus `json:"status,omitempty"` | ||
} | ||
A SpiderEndpoint resource represents IP address allocation details for the corresponding pod. This resource one to one pod, and it will inherit the pod name and pod namespace. | ||
|
||
## Sample YAML | ||
|
||
```yaml | ||
apiVersion: spiderpool.spidernet.io/v2beta1 | ||
kind: SpiderEndpoint | ||
metadata: | ||
name: test-app-1-9dc78fb9-rs99d | ||
status: | ||
current: | ||
ips: | ||
- cleanGateway: false | ||
interface: eth0 | ||
ipv4: 172.31.199.193/20 | ||
ipv4Gateway: 172.31.207.253 | ||
ipv4Pool: worker-172 | ||
vlan: 0 | ||
node: dc-test02 | ||
uid: e7b50a38-25c2-41d0-b332-7f619c69194e | ||
ownerControllerName: test-app-1 | ||
ownerControllerType: Deployment | ||
``` | ||
### SpiderEndpoint status | ||
|
||
The `status` section contains some fields to describe details about the current Endpoint allocation. | ||
|
||
```text | ||
// WorkloadEndpointStatus defines the observed state of SpiderEndpoint | ||
type WorkloadEndpointStatus struct { | ||
// the endpoint current allocation details | ||
Current *PodIPAllocation `json:"current,omitempty"` | ||
## SpiderEndpoint definition | ||
// the endpoint history allocation details | ||
History []PodIPAllocation `json:"history,omitempty"` | ||
### Metadata | ||
// kubernetes controller owner reference | ||
OwnerControllerType string `json:"ownerControllerType"` | ||
} | ||
| Field | Description | Schema | Validation | | ||
|-----------|-----------------------------------------------|--------|------------| | ||
| name | the name of this SpiderEndpoint resource | string | required | | ||
| namespace | the namespace of this SpiderEndpoint resource | string | required | | ||
type PodIPAllocation struct { | ||
// container ID | ||
ContainerID string `json:"containerID"` | ||
### Status (subresource) | ||
// node name | ||
Node *string `json:"node,omitempty"` | ||
The IPPool status is a subresource that processed automatically by the system to summarize the current state. | ||
// allocated IPs | ||
IPs []IPAllocationDetail `json:"ips,omitempty"` | ||
| Field | Description | Schema | Validation | | ||
|---------------------|----------------------------------------------------|--------------------------------------------------------|------------| | ||
| current | the IP allocation details of the corresponding pod | [PodIPAllocation](./spiderendpoint.md#PodIPAllocation) | required | | ||
| ownerControllerType | the corresponding pod top owner controller type | string | required | | ||
| ownerControllerName | the corresponding pod top owner controller name | string | required | | ||
// created time | ||
CreationTime *metav1.Time `json:"creationTime,omitempty"` | ||
} | ||
#### PodIPAllocation | ||
type IPAllocationDetail struct { | ||
// interface name | ||
NIC string `json:"interface"` | ||
This property describes the SpiderEndpoint corresponding pod details. | ||
// IPv4 address | ||
IPv4 *string `json:"ipv4,omitempty"` | ||
| Field | Description | Schema | Validation | | ||
|-------|-------------------------------------|----------------------------------------------------------------------|------------| | ||
| uid | corresponding pod uid | string | required | | ||
| node | total IP counts of this pool to use | string | required | | ||
| ips | current allocated IP counts | list of [IPAllocationDetail](./spiderendpoint.md#IPAllocationDetail) | required | | ||
// IPv6 address | ||
IPv6 *string `json:"ipv6,omitempty"` | ||
#### IPAllocationDetail | ||
// IPv4 SpiderIPPool name | ||
IPv4Pool *string `json:"ipv4Pool,omitempty"` | ||
This property describes single Interface allocation details. | ||
// IPv6 SpiderIPPool name | ||
IPv6Pool *string `json:"ipv6Pool,omitempty"` | ||
// vlan ID | ||
Vlan *int64 `json:"vlan,omitempty"` | ||
// IPv4 gateway | ||
IPv4Gateway *string `json:"ipv4Gateway,omitempty"` | ||
// IPv6 gateway | ||
IPv6Gateway *string `json:"ipv6Gateway,omitempty"` | ||
CleanGateway *bool `json:"cleanGateway,omitempty"` | ||
// route | ||
Routes []Route `json:"routes,omitempty"` | ||
} | ||
``` | ||
| Field | Description | Schema | Validation | Default | | ||
|--------------|------------------------------------------------------------|------------------------------------------|------------|---------| | ||
| interface | single interface name | string | required | | | ||
| ipv4 | single IPv4 allocated IP address | string | optional | | | ||
| ipv6 | single IPv6 allocated IP address | string | optional | | | ||
| ipv4Pool | the IPv4 allocated IP address corresponding pool | string | optional | | | ||
| ipv6Pool | the IPv6 allocated IP address corresponding pool | string | optional | | | ||
| vlan | vlan ID | int | optional | 0 | | ||
| ipv4Gateway | the IPv4 gateway IP address | string | optional | | | ||
| ipv6Gateway | the IPv6 gateway IP address | string | optional | | | ||
| cleanGateway | a flag to choose whether need default route by the gateway | boolean | optional | | | ||
| routes | the allocation routes | list if [Route](./spiderippool.md#Route) | optional | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.