Skip to content

Commit 3a47b8a

Browse files
committed
add mcs crd
Signed-off-by: duanmengkk <[email protected]>
1 parent ed72168 commit 3a47b8a

File tree

2 files changed

+294
-0
lines changed

2 files changed

+294
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# Copyright 2020 The Kubernetes Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
apiVersion: apiextensions.k8s.io/v1
15+
kind: CustomResourceDefinition
16+
metadata:
17+
name: serviceexports.multicluster.x-k8s.io
18+
spec:
19+
group: multicluster.x-k8s.io
20+
scope: Namespaced
21+
names:
22+
plural: serviceexports
23+
singular: serviceexport
24+
kind: ServiceExport
25+
shortNames:
26+
- svcex
27+
versions:
28+
- name: v1alpha1
29+
served: true
30+
storage: true
31+
subresources:
32+
status: {}
33+
additionalPrinterColumns:
34+
- name: Age
35+
type: date
36+
jsonPath: .metadata.creationTimestamp
37+
"schema":
38+
"openAPIV3Schema":
39+
description: ServiceExport declares that the Service with the same name and
40+
namespace as this export should be consumable from other clusters.
41+
type: object
42+
properties:
43+
apiVersion:
44+
description: 'APIVersion defines the versioned schema of this representation
45+
of an object. Servers should convert recognized schemas to the latest
46+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
47+
type: string
48+
kind:
49+
description: 'Kind is a string value representing the REST resource this
50+
object represents. Servers may infer this from the endpoint the client
51+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
52+
type: string
53+
metadata:
54+
type: object
55+
status:
56+
description: status describes the current state of an exported service.
57+
Service configuration comes from the Service that had the same name
58+
and namespace as this ServiceExport. Populated by the multi-cluster
59+
service implementation's controller.
60+
type: object
61+
properties:
62+
conditions:
63+
type: array
64+
items:
65+
description: "Condition contains details for one aspect of the current
66+
state of this API Resource. --- This struct is intended for direct
67+
use as an array at the field path .status.conditions. For example,
68+
type FooStatus struct{ // Represents the observations of a
69+
foo's current state. // Known .status.conditions.type are:
70+
\"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type
71+
\ // +patchStrategy=merge // +listType=map // +listMapKey=type
72+
\ Conditions []metav1.Condition `json:\"conditions,omitempty\"
73+
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`
74+
\n // other fields }"
75+
type: object
76+
required:
77+
- lastTransitionTime
78+
- message
79+
- reason
80+
- status
81+
- type
82+
properties:
83+
lastTransitionTime:
84+
description: lastTransitionTime is the last time the condition
85+
transitioned from one status to another. This should be when
86+
the underlying condition changed. If that is not known, then
87+
using the time when the API field changed is acceptable.
88+
type: string
89+
format: date-time
90+
message:
91+
description: message is a human readable message indicating
92+
details about the transition. This may be an empty string.
93+
type: string
94+
maxLength: 32768
95+
observedGeneration:
96+
description: observedGeneration represents the .metadata.generation
97+
that the condition was set based upon. For instance, if .metadata.generation
98+
is currently 12, but the .status.conditions[x].observedGeneration
99+
is 9, the condition is out of date with respect to the current
100+
state of the instance.
101+
type: integer
102+
format: int64
103+
minimum: 0
104+
reason:
105+
description: reason contains a programmatic identifier indicating
106+
the reason for the condition's last transition. Producers
107+
of specific condition types may define expected values and
108+
meanings for this field, and whether the values are considered
109+
a guaranteed API. The value should be a CamelCase string.
110+
This field may not be empty.
111+
type: string
112+
maxLength: 1024
113+
minLength: 1
114+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
115+
status:
116+
description: status of the condition, one of True, False, Unknown.
117+
type: string
118+
enum:
119+
- "True"
120+
- "False"
121+
- Unknown
122+
type:
123+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
124+
--- Many .condition.type values are consistent across resources
125+
like Available, but because arbitrary conditions can be useful
126+
(see .node.status.conditions), the ability to deconflict is
127+
important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
128+
type: string
129+
maxLength: 316
130+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
131+
x-kubernetes-list-map-keys:
132+
- type
133+
x-kubernetes-list-type: map
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
# Copyright 2020 The Kubernetes Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
apiVersion: apiextensions.k8s.io/v1
15+
kind: CustomResourceDefinition
16+
metadata:
17+
name: serviceimports.multicluster.x-k8s.io
18+
spec:
19+
group: multicluster.x-k8s.io
20+
scope: Namespaced
21+
names:
22+
plural: serviceimports
23+
singular: serviceimport
24+
kind: ServiceImport
25+
shortNames:
26+
- svcim
27+
versions:
28+
- name: v1alpha1
29+
served: true
30+
storage: true
31+
subresources:
32+
status: {}
33+
additionalPrinterColumns:
34+
- name: Type
35+
type: string
36+
description: The type of this ServiceImport
37+
jsonPath: .spec.type
38+
- name: IP
39+
type: string
40+
description: The VIP for this ServiceImport
41+
jsonPath: .spec.ips
42+
- name: Age
43+
type: date
44+
jsonPath: .metadata.creationTimestamp
45+
"schema":
46+
"openAPIV3Schema":
47+
description: ServiceImport describes a service imported from clusters in a
48+
ClusterSet.
49+
type: object
50+
properties:
51+
apiVersion:
52+
description: 'APIVersion defines the versioned schema of this representation
53+
of an object. Servers should convert recognized schemas to the latest
54+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
55+
type: string
56+
kind:
57+
description: 'Kind is a string value representing the REST resource this
58+
object represents. Servers may infer this from the endpoint the client
59+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
60+
type: string
61+
metadata:
62+
type: object
63+
spec:
64+
description: spec defines the behavior of a ServiceImport.
65+
type: object
66+
required:
67+
- ports
68+
- type
69+
properties:
70+
ips:
71+
description: ip will be used as the VIP for this service when type
72+
is ClusterSetIP.
73+
type: array
74+
maxItems: 1
75+
items:
76+
type: string
77+
ports:
78+
type: array
79+
items:
80+
description: ServicePort represents the port on which the service
81+
is exposed
82+
type: object
83+
required:
84+
- port
85+
properties:
86+
appProtocol:
87+
description: The application protocol for this port. This field
88+
follows standard Kubernetes label syntax. Un-prefixed names
89+
are reserved for IANA standard service names (as per RFC-6335
90+
and http://www.iana.org/assignments/service-names). Non-standard
91+
protocols should use prefixed names such as mycompany.com/my-custom-protocol.
92+
Field can be enabled with ServiceAppProtocol feature gate.
93+
type: string
94+
name:
95+
description: The name of this port within the service. This
96+
must be a DNS_LABEL. All ports within a ServiceSpec must have
97+
unique names. When considering the endpoints for a Service,
98+
this must match the 'name' field in the EndpointPort. Optional
99+
if only one ServicePort is defined on this service.
100+
type: string
101+
port:
102+
description: The port that will be exposed by this service.
103+
type: integer
104+
format: int32
105+
protocol:
106+
description: The IP protocol for this port. Supports "TCP",
107+
"UDP", and "SCTP". Default is TCP.
108+
type: string
109+
x-kubernetes-list-type: atomic
110+
sessionAffinity:
111+
description: 'Supports "ClientIP" and "None". Used to maintain session
112+
affinity. Enable client IP based session affinity. Must be ClientIP
113+
or None. Defaults to None. Ignored when type is Headless More info:
114+
https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies'
115+
type: string
116+
sessionAffinityConfig:
117+
description: sessionAffinityConfig contains session affinity configuration.
118+
type: object
119+
properties:
120+
clientIP:
121+
description: clientIP contains the configurations of Client IP
122+
based session affinity.
123+
type: object
124+
properties:
125+
timeoutSeconds:
126+
description: timeoutSeconds specifies the seconds of ClientIP
127+
type session sticky time. The value must be >0 && <=86400(for
128+
1 day) if ServiceAffinity == "ClientIP". Default value is
129+
10800(for 3 hours).
130+
type: integer
131+
format: int32
132+
type:
133+
description: type defines the type of this service. Must be ClusterSetIP
134+
or Headless.
135+
type: string
136+
enum:
137+
- ClusterSetIP
138+
- Headless
139+
status:
140+
description: status contains information about the exported services that
141+
form the multi-cluster service referenced by this ServiceImport.
142+
type: object
143+
properties:
144+
clusters:
145+
description: clusters is the list of exporting clusters from which
146+
this service was derived.
147+
type: array
148+
items:
149+
description: ClusterStatus contains service configuration mapped
150+
to a specific source cluster
151+
type: object
152+
required:
153+
- cluster
154+
properties:
155+
cluster:
156+
description: cluster is the name of the exporting cluster. Must
157+
be a valid RFC-1123 DNS label.
158+
type: string
159+
x-kubernetes-list-map-keys:
160+
- cluster
161+
x-kubernetes-list-type: map

0 commit comments

Comments
 (0)