Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: unified CRDs for FederatedObject and CollectedStatus #121

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions config/crds/core.kubeadmiral.io_clustercollectedstatuses.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: clustercollectedstatuses.core.kubeadmiral.io
spec:
group: core.kubeadmiral.io
names:
kind: ClusterCollectedStatus
listKind: ClusterCollectedStatusList
plural: clustercollectedstatuses
shortNames:
- ccs
singular: clustercollectedstatus
scope: Cluster
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: ClusterCollectedStatus stores the collected fields of Kubernetes
objects from member clusters, that are propagated by a ClusterFederatedObject.
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
clusters:
description: Clusters is the list of member clusters and collected fields
for its propagated Kubernetes object.
items:
description: CollectedFieldsWithCluster stores the collected fields
of a Kubernetes object in a member cluster.
properties:
cluster:
description: Cluster is the name of the member cluster.
type: string
collectedFields:
description: CollectedFields is the the set of fields collected
for the Kubernetes object.
x-kubernetes-preserve-unknown-fields: true
error:
description: Error records any errors encountered while collecting
fields from the cluster.
type: string
required:
- cluster
- collectedFields
type: object
type: array
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
lastUpdateTime:
description: LastUpdateTime is the last time that a collection was performed.
format: date-time
type: string
metadata:
type: object
required:
- clusters
- lastUpdateTime
type: object
served: true
storage: true
228 changes: 228 additions & 0 deletions config/crds/core.kubeadmiral.io_clusterfederatedobjects.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: clusterfederatedobjects.core.kubeadmiral.io
spec:
group: core.kubeadmiral.io
names:
kind: ClusterFederatedObject
listKind: ClusterFederatedObjectList
plural: clusterfederatedobjects
shortNames:
- cfo
singular: clusterfederatedobject
scope: Cluster
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: ClusterFederatedObject describes a cluster-scoped Kubernetes
object and how it should be propagated to different member clusters.
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: Spec defines the desired behavior of the ClusterFederatedObject.
properties:
follows:
description: Follows defines other objects, or "leaders", that the
Kubernetes object should follow during propagation, i.e. the Kubernetes
object should be propagated to all member clusters that its "leaders"
are placed in.
items:
description: LeaderReference contains the identifying metadata of
a "leader" Kubernetes object.
properties:
group:
type: string
kind:
type: string
name:
type: string
namespace:
type: string
required:
- kind
- name
type: object
type: array
overrides:
description: Overrides describe the overrides that should be applied
to the base template of the Kubernetes object before it is propagated
to individual member clusters.
items:
description: OverrideWithController describes the overrides that
will be applied to a Kubernetes object before it is propagated
to individual member clusters.
properties:
clusters:
description: Override is the list of member clusters and their
respective override patches.
items:
description: ClusterReferenceWithPatches represents a single
member cluster and a list of override patches for the cluster.
properties:
cluster:
description: Cluster is the name of the member cluster.
type: string
patches:
description: Patches is the list of override patches for
the member cluster.
items:
description: OverridePatch defines a JSON patch.
properties:
op:
type: string
path:
type: string
value:
x-kubernetes-preserve-unknown-fields: true
required:
- path
type: object
type: array
required:
- cluster
type: object
type: array
controller:
description: Controller identifies the controller responsible
for this override.
type: string
required:
- clusters
- controller
type: object
type: array
placements:
description: Placements describe the member clusters that the Kubernetes
object will be propagated to, which is a union of all the listed
clusters.
items:
description: PlacementWithController describes the member clusters
that a Kubernetes object should be propagated to.
properties:
controller:
description: Controller identifies the controller responsible
for this placement.
type: string
placement:
description: Placement is the list of member clusters that the
Kubernetes object should be propagated to.
items:
description: ClusterReference represents a single member cluster.
properties:
cluster:
description: Cluster is the name of the member cluster.
type: string
required:
- cluster
type: object
type: array
required:
- controller
- placement
type: object
type: array
template:
description: Template is the base template of the Kubernetes object
to be propagated.
x-kubernetes-preserve-unknown-fields: true
required:
- follows
- overrides
- placements
- template
type: object
status:
description: Status describes the most recently observed status of the
ClusterFederatedObject.
properties:
clusters:
description: Clusters contains the propagation status of the Kubernetes
object for individual member clusters.
items:
description: PropagationStatus describes the propagation of a Kubernetes
object to a given member cluster.
properties:
cluster:
description: Cluster is the name of the member cluster.
type: string
lastObservedGeneration:
description: LastObservedGeneration is the last observed generation
of the Kubernetes object in the member cluster.
format: int64
type: integer
status:
description: Status describes the current status of propagating
the Kubernetes object to the member cluster.
type: string
required:
- cluster
- status
type: object
type: array
collisionCount:
description: CollisionCount can be used in conjunction with RevisionHistory
to implement rollbacks.
format: int32
type: integer
conditions:
description: Conditions describe the current state of this FederatedObject.
items:
description: GenericFederatedObjectCondition contains the current
details about a particular condition of a FederatedObject.
properties:
lastTransitionTime:
description: LastTransitionTime is the last time the status
of this condition changed.
format: date-time
type: string
lastUpdateTime:
description: LastUpdateTime is the last time a reconciliation
for this condition occurred.
format: date-time
type: string
reason:
description: Reason is the reason for the last status change
of this condition.
type: string
status:
description: Status is the status of the condition, one of True,
False or Unknown.
type: string
type:
description: Type is the type of the condition.
type: string
required:
- status
- type
type: object
type: array
syncedGeneration:
description: SyncedGeneration is the generation of this FederatedObject
when it was last synced to selected member clusters.
format: int64
type: integer
type: object
required:
- spec
type: object
served: true
storage: true
subresources:
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ spec:
description: DisableFollowerScheduling is a boolean that determines if follower scheduling is disabled. Resources that depend on other resources (e.g. deployments) are called leaders, and resources that are depended on (e.g. configmaps and secrets) are called followers. If a leader enables follower scheduling, its followers will additionally be scheduled to clusters where the leader is scheduled.
type: boolean
maxClusters:
description: MaxClusters is the maximum number of replicas that the federated object can be propagated to The maximum number of clusters is unbounded if no value is provided.
description: MaxClusters is the maximum number of replicas that the federated object can be propagated to. The maximum number of clusters is unbounded if no value is provided.
format: int64
type: integer
placement:
description: Placement is an explicit list of clusters used to select member clusters to propagate resources
description: Placement is an explicit list of clusters used to select member clusters to propagate resources to.
items:
description: Placement describes a cluster that a federated object can be propagated to and its propagation preferences.
description: DesiredPlacement describes a cluster that a federated object can be propagated to and its propagation preferences.
properties:
cluster:
description: Cluster is the name of the FederatedCluster to propagate to.
Expand Down Expand Up @@ -180,7 +180,7 @@ spec:
description: StickyCluster determines if a federated object can be rescheduled.
type: boolean
tolerations:
description: Tolerations describe a set of cluster taints that the policy tolerates
description: Tolerations describe a set of cluster taints that the policy tolerates.
items:
description: The pod this Toleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator <operator>.
properties:
Expand Down
70 changes: 70 additions & 0 deletions config/crds/core.kubeadmiral.io_collectedstatuses.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: collectedstatuses.core.kubeadmiral.io
spec:
group: core.kubeadmiral.io
names:
kind: CollectedStatus
listKind: CollectedStatusList
plural: collectedstatuses
shortNames:
- cs
singular: collectedstatus
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: CollectedStatus stores the collected fields of Kubernetes objects
from member clusters, that are propagated by a FederatedObject.
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
clusters:
description: Clusters is the list of member clusters and collected fields
for its propagated Kubernetes object.
items:
description: CollectedFieldsWithCluster stores the collected fields
of a Kubernetes object in a member cluster.
properties:
cluster:
description: Cluster is the name of the member cluster.
type: string
collectedFields:
description: CollectedFields is the the set of fields collected
for the Kubernetes object.
x-kubernetes-preserve-unknown-fields: true
error:
description: Error records any errors encountered while collecting
fields from the cluster.
type: string
required:
- cluster
- collectedFields
type: object
type: array
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
lastUpdateTime:
description: LastUpdateTime is the last time that a collection was performed.
format: date-time
type: string
metadata:
type: object
required:
- clusters
- lastUpdateTime
type: object
served: true
storage: true
Loading
Loading