-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add nodeRuntime cr to track cni status
Signed-off-by: l1b0k <[email protected]>
- Loading branch information
Showing
5 changed files
with
266 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.14.0 | ||
name: noderuntimes.network.alibabacloud.com | ||
spec: | ||
group: network.alibabacloud.com | ||
names: | ||
kind: NodeRuntime | ||
listKind: NodeRuntimeList | ||
plural: noderuntimes | ||
singular: noderuntime | ||
scope: Cluster | ||
versions: | ||
- name: v1beta1 | ||
schema: | ||
openAPIV3Schema: | ||
description: NodeRuntime is the Schema for the per node runtime API | ||
properties: | ||
apiVersion: | ||
description: |- | ||
APIVersion defines the versioned schema of this representation of an object. | ||
Servers should convert recognized schemas to the latest internal value, and | ||
may reject unrecognized values. | ||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | ||
type: string | ||
kind: | ||
description: |- | ||
Kind is a string value representing the REST resource this object represents. | ||
Servers may infer this from the endpoint the client submits requests to. | ||
Cannot be updated. | ||
In CamelCase. | ||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
type: object | ||
status: | ||
properties: | ||
pods: | ||
additionalProperties: | ||
properties: | ||
podID: | ||
type: string | ||
status: | ||
description: when pod is added | ||
enum: | ||
- initial | ||
- deleted | ||
type: string | ||
required: | ||
- podID | ||
- status | ||
type: object | ||
description: runtime status, indexed by pod uid | ||
type: object | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} |
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package v1beta1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
type RuntimePodSpec struct { | ||
UID string `json:"uid"` | ||
Name string `json:"name"` | ||
Namespace string `json:"namespace"` | ||
IPv4 string `json:"ipv4"` | ||
IPv6 string `json:"ipv6"` | ||
} | ||
|
||
// +kubebuilder:validation:Enum=initial;deleted | ||
type CNIStatus string | ||
|
||
const ( | ||
CNIStatusInitial CNIStatus = "initial" | ||
CNIStatusDeleted CNIStatus = "deleted" | ||
) | ||
|
||
type RuntimePodStatus struct { | ||
PodID string `json:"podID"` | ||
// when pod is added | ||
Status CNIStatus `json:"status"` | ||
} | ||
|
||
type NodeRuntimeSpec struct { | ||
} | ||
|
||
type NodeRuntimeStatus struct { | ||
// runtime status, indexed by pod uid | ||
Pods map[string]*RuntimePodStatus `json:"pods,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
//+kubebuilder:resource:scope=Cluster | ||
|
||
// NodeRuntime is the Schema for the per node runtime API | ||
type NodeRuntime struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec NodeRuntimeSpec `json:"spec,omitempty"` | ||
Status NodeRuntimeStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// NodeRuntimeList contains a list of Node | ||
type NodeRuntimeList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []NodeRuntime `json:"items"` | ||
} |
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
135 changes: 135 additions & 0 deletions
135
pkg/apis/network.alibabacloud.com/v1beta1/zz_generated.deepcopy.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.