-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 #3107 from sedefsavas/clusterresourceset_
✨ Introduce ClusterResourceSet experimental API and controllers
- Loading branch information
Showing
36 changed files
with
3,030 additions
and
65 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
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
91 changes: 91 additions & 0 deletions
91
config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesetbindings.yaml
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,91 @@ | ||
|
||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.2.9 | ||
creationTimestamp: null | ||
name: clusterresourcesetbindings.addons.cluster.x-k8s.io | ||
spec: | ||
group: addons.cluster.x-k8s.io | ||
names: | ||
categories: | ||
- cluster-api | ||
kind: ClusterResourceSetBinding | ||
listKind: ClusterResourceSetBindingList | ||
plural: clusterresourcesetbindings | ||
singular: clusterresourcesetbinding | ||
scope: Namespaced | ||
versions: | ||
- name: v1alpha3 | ||
schema: | ||
openAPIV3Schema: | ||
description: ClusterResourceSetBinding lists all matching ClusterResourceSets | ||
with the cluster it belongs to. | ||
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: ClusterResourceSetBindingSpec defines the desired state of | ||
ClusterResourceSetBinding | ||
properties: | ||
bindings: | ||
additionalProperties: | ||
description: ResourcesSetBinding keeps info on all of the resources | ||
in a ClusterResourceSet. | ||
properties: | ||
resources: | ||
additionalProperties: | ||
description: ResourceBinding shows the status of a resource | ||
that belongs to a ClusterResourceSet matched by the owner | ||
cluster of the ClusterResourceSetBinding object. | ||
properties: | ||
applied: | ||
description: Applied is to track if a resource is applied | ||
to the cluster or not. | ||
type: boolean | ||
hash: | ||
description: Hash is the hash of a resource's data. This | ||
can be used to decide if a resource is changed. For | ||
"ApplyOnce" ClusterResourceSet.spec.strategy, this is | ||
no-op as that strategy does not act on change. | ||
type: string | ||
lastAppliedTime: | ||
description: LastAppliedTime identifies when this resource | ||
was last applied to the cluster. | ||
format: date-time | ||
type: string | ||
required: | ||
- applied | ||
type: object | ||
description: 'Resources is a map of Secrets/ConfigMaps and their | ||
ResourceBinding. The map''s key is a concatenated string of | ||
form: <resource-type>/<resource-name>.' | ||
type: object | ||
type: object | ||
description: Bindings is a map of ClusterResourceSet name and its | ||
resources which is also a map. | ||
type: object | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
183 changes: 183 additions & 0 deletions
183
config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesets.yaml
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,183 @@ | ||
|
||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.2.9 | ||
creationTimestamp: null | ||
name: clusterresourcesets.addons.cluster.x-k8s.io | ||
spec: | ||
group: addons.cluster.x-k8s.io | ||
names: | ||
categories: | ||
- cluster-api | ||
kind: ClusterResourceSet | ||
listKind: ClusterResourceSetList | ||
plural: clusterresourcesets | ||
singular: clusterresourceset | ||
scope: Namespaced | ||
versions: | ||
- name: v1alpha3 | ||
schema: | ||
openAPIV3Schema: | ||
description: ClusterResourceSet is the Schema for the clusterresourcesets | ||
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: | ||
description: ClusterResourceSetSpec defines the desired state of ClusterResourceSet | ||
properties: | ||
clusterSelector: | ||
description: Label selector for Clusters. The Clusters that are selected | ||
by this will be the ones affected by this ClusterResourceSet. It | ||
must match the Cluster labels. This field is immutable. | ||
properties: | ||
matchExpressions: | ||
description: matchExpressions is a list of label selector requirements. | ||
The requirements are ANDed. | ||
items: | ||
description: A label selector requirement is a selector that | ||
contains values, a key, and an operator that relates the key | ||
and values. | ||
properties: | ||
key: | ||
description: key is the label key that the selector applies | ||
to. | ||
type: string | ||
operator: | ||
description: operator represents a key's relationship to | ||
a set of values. Valid operators are In, NotIn, Exists | ||
and DoesNotExist. | ||
type: string | ||
values: | ||
description: values is an array of string values. If the | ||
operator is In or NotIn, the values array must be non-empty. | ||
If the operator is Exists or DoesNotExist, the values | ||
array must be empty. This array is replaced during a strategic | ||
merge patch. | ||
items: | ||
type: string | ||
type: array | ||
required: | ||
- key | ||
- operator | ||
type: object | ||
type: array | ||
matchLabels: | ||
additionalProperties: | ||
type: string | ||
description: matchLabels is a map of {key,value} pairs. A single | ||
{key,value} in the matchLabels map is equivalent to an element | ||
of matchExpressions, whose key field is "key", the operator | ||
is "In", and the values array contains only "value". The requirements | ||
are ANDed. | ||
type: object | ||
type: object | ||
resources: | ||
description: Resources is a list of Secrets/ConfigMaps where each | ||
contains 1 or more resources to be applied to remote clusters. | ||
items: | ||
description: ResourceRef specifies a resource. | ||
properties: | ||
kind: | ||
description: 'Kind of the resource. Supported kinds are: Secrets | ||
and ConfigMaps.' | ||
enum: | ||
- Secret | ||
- ConfigMap | ||
type: string | ||
name: | ||
description: Name of the resource that is in the same namespace | ||
with ClusterResourceSet object. | ||
minLength: 1 | ||
type: string | ||
required: | ||
- kind | ||
- name | ||
type: object | ||
type: array | ||
strategy: | ||
description: Strategy is the strategy to be used during applying resources. | ||
Defaults to ApplyOnce. This field is immutable. | ||
enum: | ||
- ApplyOnce | ||
type: string | ||
required: | ||
- clusterSelector | ||
type: object | ||
status: | ||
description: ClusterResourceSetStatus defines the observed state of ClusterResourceSet | ||
properties: | ||
conditions: | ||
description: Conditions defines current state of the ClusterResourceSet. | ||
items: | ||
description: Condition defines an observation of a Cluster API resource | ||
operational state. | ||
properties: | ||
lastTransitionTime: | ||
description: Last time the condition transitioned from one status | ||
to another. This should be when the underlying condition changed. | ||
If that is not known, then using the time when the API field | ||
changed is acceptable. | ||
format: date-time | ||
type: string | ||
message: | ||
description: A human readable message indicating details about | ||
the transition. This field may be empty. | ||
type: string | ||
reason: | ||
description: The reason for the condition's last transition | ||
in CamelCase. The specific API may choose whether or not this | ||
field is considered a guaranteed API. This field may not be | ||
empty. | ||
type: string | ||
severity: | ||
description: Severity provides an explicit classification of | ||
Reason code, so the users or machines can immediately understand | ||
the current situation and act accordingly. The Severity field | ||
MUST be set only when Status=False. | ||
type: string | ||
status: | ||
description: Status of the condition, one of True, False, Unknown. | ||
type: string | ||
type: | ||
description: Type of condition in CamelCase or in foo.example.com/CamelCase. | ||
Many .condition.type values are consistent across resources | ||
like Available, but because arbitrary conditions can be useful | ||
(see .node.status.conditions), the ability to deconflict is | ||
important. | ||
type: string | ||
required: | ||
- status | ||
- type | ||
type: object | ||
type: array | ||
observedGeneration: | ||
description: ObservedGeneration reflects the generation of the most | ||
recently observed ClusterResourceSet. | ||
format: int64 | ||
type: integer | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
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.