forked from kosmos-io/kosmos
-
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 kosmos-io#535 from duanmengkk/reactor_code
add api for virtualcluster plugin
- Loading branch information
Showing
18 changed files
with
1,292 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,114 @@ | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.11.0 | ||
creationTimestamp: null | ||
name: virtualclusterplugins.kosmos.io | ||
spec: | ||
group: kosmos.io | ||
names: | ||
kind: VirtualClusterPlugin | ||
listKind: VirtualClusterPluginList | ||
plural: virtualclusterplugins | ||
shortNames: | ||
- vp | ||
singular: virtualclusterplugin | ||
scope: Namespaced | ||
versions: | ||
- name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
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: | ||
description: VirtualClusterPluginSpec is the specification for a VirtualClusterPlugin | ||
resource | ||
properties: | ||
pluginSources: | ||
properties: | ||
chart: | ||
properties: | ||
name: | ||
type: string | ||
repo: | ||
type: string | ||
storage: | ||
properties: | ||
hostPath: | ||
properties: | ||
nodeName: | ||
type: string | ||
path: | ||
type: string | ||
type: object | ||
pvPath: | ||
type: string | ||
uri: | ||
type: string | ||
type: object | ||
values: | ||
items: | ||
type: string | ||
type: array | ||
valuesFile: | ||
properties: | ||
hostPath: | ||
properties: | ||
nodeName: | ||
type: string | ||
path: | ||
type: string | ||
type: object | ||
pvPath: | ||
type: string | ||
uri: | ||
type: string | ||
type: object | ||
version: | ||
type: string | ||
wait: | ||
type: boolean | ||
type: object | ||
yaml: | ||
properties: | ||
path: | ||
properties: | ||
hostPath: | ||
properties: | ||
nodeName: | ||
type: string | ||
path: | ||
type: string | ||
type: object | ||
pvPath: | ||
type: string | ||
uri: | ||
type: string | ||
type: object | ||
required: | ||
- path | ||
type: object | ||
type: object | ||
successStateCommand: | ||
type: string | ||
type: object | ||
required: | ||
- spec | ||
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
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,81 @@ | ||
package v1alpha1 | ||
|
||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
||
// +genclient | ||
// +kubebuilder:subresource:status | ||
// +kubebuilder:resource:shortName=vp | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
type VirtualClusterPlugin struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
// VirtualClusterPluginSpec is the specification for a VirtualClusterPlugin resource | ||
// +required | ||
Spec VirtualClusterPluginSpec `json:"spec"` | ||
} | ||
|
||
type VirtualClusterPluginSpec struct { | ||
// +optional | ||
PluginSources PluginSources `json:"pluginSources,omitempty"` | ||
|
||
// +optional | ||
SuccessStateCommand string `json:"successStateCommand,omitempty"` | ||
} | ||
|
||
type PluginSources struct { | ||
// +optional | ||
Chart Chart `json:"chart,omitempty"` | ||
// +optional | ||
Yaml Yaml `json:"yaml,omitempty"` | ||
} | ||
|
||
type Chart struct { | ||
// +optional | ||
Name string `json:"name,omitempty"` | ||
// +optional | ||
Repo string `json:"repo,omitempty"` | ||
// +optional | ||
Storage Storage `json:"storage,omitempty"` | ||
// +optional | ||
Version string `json:"version,omitempty"` | ||
// +optional | ||
ValuesFile Storage `json:"valuesFile,omitempty"` | ||
// +optional | ||
Values []string `json:"values,omitempty"` | ||
// +optional | ||
Wait bool `json:"wait,omitempty"` | ||
} | ||
|
||
type Yaml struct { | ||
// +required | ||
Path Storage `json:"path"` | ||
} | ||
|
||
type Storage struct { | ||
// +optional | ||
HostPath HostPath `json:"hostPath,omitempty"` | ||
|
||
// +optional | ||
PVPath string `json:"pvPath,omitempty"` | ||
|
||
// +optional | ||
URI string `json:"uri,omitempty"` | ||
} | ||
|
||
type HostPath struct { | ||
// +optional | ||
Path string `json:"path,omitempty"` | ||
|
||
// +optional | ||
NodeName string `json:"nodeName,omitempty"` | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
type VirtualClusterPluginList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata"` | ||
Items []VirtualClusterPlugin `json:"items"` | ||
} |
Oops, something went wrong.