-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add the leader election (#230)
Co-authored-by: Ryan Zhang <[email protected]>
- Loading branch information
1 parent
57a4d98
commit c8dcdd5
Showing
15 changed files
with
816 additions
and
687 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
413 changes: 245 additions & 168 deletions
413
charts/hub-agent/templates/crds/multicluster.x-k8s.io_works.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
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
192 changes: 111 additions & 81 deletions
192
charts/member-agent/templates/crds/multicluster.x-k8s.io_appliedworks.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 |
---|---|---|
@@ -1,94 +1,124 @@ | ||
# Copyright 2021 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.8.0 | ||
creationTimestamp: null | ||
name: appliedworks.multicluster.x-k8s.io | ||
spec: | ||
group: multicluster.x-k8s.io | ||
names: | ||
categories: | ||
- fleet | ||
kind: AppliedWork | ||
listKind: AppliedWorkList | ||
plural: appliedworks | ||
singular: appliedwork | ||
scope: Cluster | ||
versions: | ||
- name: v1alpha1 | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} | ||
"schema": | ||
"openAPIV3Schema": | ||
description: AppliedWork represents an applied work on managed cluster that is placed on a managed cluster. An appliedwork links to a work on a hub recording resources deployed in the managed cluster. When the agent is removed from managed cluster, cluster-admin on managed cluster can delete appliedmanifestwork to remove resources deployed by the agent. The name of the appliedwork must be the same as {manifestwork name} The namespace of the appliedwork should be the same as the resource applied on the managed cluster. | ||
type: object | ||
required: | ||
- spec | ||
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 represents the desired configuration of AppliedManifestWork. | ||
type: object | ||
required: | ||
- workName | ||
- workNamespace | ||
properties: | ||
workName: | ||
description: WorkName represents the name of the related work on the hub. | ||
type: string | ||
workNamespace: | ||
description: WorkNamespace represents the namespace of the related work on the hub. | ||
type: string | ||
status: | ||
description: Status represents the current status of AppliedManifestWork. | ||
type: object | ||
properties: | ||
appliedResources: | ||
description: AppliedResources represents a list of resources defined within the manifestwork that are applied. Only resources with valid GroupVersionResource, namespace, and name are suitable. An item in this slice is deleted when there is no mapped manifest in manifestwork.Spec or by finalizer. The resource relating to the item will also be removed from managed cluster. The deleted resource may still be present until the finalizers for that resource are finished. However, the resource will not be undeleted, so it can be removed from this list and eventual consistency is preserved. | ||
type: array | ||
items: | ||
description: AppliedResourceMeta represents the group, version, resource, name and namespace of a resource. Since these resources have been created, they must have valid group, version, resource, namespace, and name. | ||
type: object | ||
properties: | ||
group: | ||
description: Group is the group of the resource. | ||
type: string | ||
kind: | ||
description: Kind is the kind of the resource. | ||
type: string | ||
name: | ||
description: Name is the name of the resource | ||
type: string | ||
namespace: | ||
description: Namespace is the namespace of the resource, the resource is cluster scoped if the value is empty | ||
type: string | ||
ordinal: | ||
description: Ordinal represents an index in manifests list, so the condition can still be linked to a manifest even thougth manifest cannot be parsed successfully. | ||
type: integer | ||
resource: | ||
description: Resource is the resource type of the resource | ||
type: string | ||
uid: | ||
description: UID is set on successful deletion of the Kubernetes resource by controller. The resource might be still visible on the managed cluster after this field is set. It is not directly settable by a client. | ||
type: string | ||
version: | ||
description: Version is the version of the resource. | ||
type: string | ||
- name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
description: AppliedWork represents an applied work on managed cluster that | ||
is placed on a managed cluster. An appliedwork links to a work on a hub | ||
recording resources deployed in the managed cluster. When the agent is removed | ||
from managed cluster, cluster-admin on managed cluster can delete appliedmanifestwork | ||
to remove resources deployed by the agent. The name of the appliedwork must | ||
be the same as {manifestwork name} The namespace of the appliedwork should | ||
be the same as the resource applied on the managed cluster. | ||
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 represents the desired configuration of AppliedManifestWork. | ||
properties: | ||
workName: | ||
description: WorkName represents the name of the related work on the | ||
hub. | ||
type: string | ||
workNamespace: | ||
description: WorkNamespace represents the namespace of the related | ||
work on the hub. | ||
type: string | ||
required: | ||
- workName | ||
- workNamespace | ||
type: object | ||
status: | ||
description: Status represents the current status of AppliedManifestWork. | ||
properties: | ||
appliedResources: | ||
description: AppliedResources represents a list of resources defined | ||
within the manifestwork that are applied. Only resources with valid | ||
GroupVersionResource, namespace, and name are suitable. An item | ||
in this slice is deleted when there is no mapped manifest in manifestwork.Spec | ||
or by finalizer. The resource relating to the item will also be | ||
removed from managed cluster. The deleted resource may still be | ||
present until the finalizers for that resource are finished. However, | ||
the resource will not be undeleted, so it can be removed from this | ||
list and eventual consistency is preserved. | ||
items: | ||
description: AppliedResourceMeta represents the group, version, | ||
resource, name and namespace of a resource. Since these resources | ||
have been created, they must have valid group, version, resource, | ||
namespace, and name. | ||
properties: | ||
group: | ||
description: Group is the group of the resource. | ||
type: string | ||
kind: | ||
description: Kind is the kind of the resource. | ||
type: string | ||
name: | ||
description: Name is the name of the resource | ||
type: string | ||
namespace: | ||
description: Namespace is the namespace of the resource, the | ||
resource is cluster scoped if the value is empty | ||
type: string | ||
ordinal: | ||
description: Ordinal represents an index in manifests list, | ||
so the condition can still be linked to a manifest even thougth | ||
manifest cannot be parsed successfully. | ||
type: integer | ||
resource: | ||
description: Resource is the resource type of the resource | ||
type: string | ||
uid: | ||
description: UID is set on successful deletion of the Kubernetes | ||
resource by controller. The resource might be still visible | ||
on the managed cluster after this field is set. It is not | ||
directly settable by a client. | ||
type: string | ||
version: | ||
description: Version is the version of the resource. | ||
type: string | ||
required: | ||
- ordinal | ||
type: object | ||
type: array | ||
type: object | ||
required: | ||
- spec | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
Oops, something went wrong.