-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add aws/zone-aware-controllers-for-k8s
Signed-off-by: Sebastian Hoß <[email protected]>
- Loading branch information
Showing
10 changed files
with
370 additions
and
0 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
88 changes: 88 additions & 0 deletions
88
crd-catalog/aws/zone-aware-controllers-for-k8s/zonecontrol.k8s.aws/v1/zoneawareupdates.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,88 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.9.2 | ||
name: zoneawareupdates.zonecontrol.k8s.aws | ||
spec: | ||
group: zonecontrol.k8s.aws | ||
names: | ||
kind: ZoneAwareUpdate | ||
listKind: ZoneAwareUpdateList | ||
plural: zoneawareupdates | ||
shortNames: | ||
- zau | ||
singular: zoneawareupdate | ||
scope: Namespaced | ||
versions: | ||
- name: v1 | ||
schema: | ||
openAPIV3Schema: | ||
description: ZoneAwareUpdate is the Schema for the zoneawareupdates 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: ZoneAwareUpdateSpec defines the desired state of ZoneAwareUpdate | ||
properties: | ||
dryRun: | ||
description: Dryn-run mode that can be used to test the new controller before enable it | ||
type: boolean | ||
exponentialFactor: | ||
default: '2.0' | ||
description: The exponential growth rate in float string. Default value is 2.0. It's possible to disable exponential updates by setting the ExponentialFactor to 0. In this case, the number of pods updated at each step is defined only by the MaxUnavailable param. | ||
type: string | ||
ignoreAlarm: | ||
description: Flag to ignore the PauseRolloutAlarm (default false) | ||
type: boolean | ||
maxUnavailable: | ||
anyOf: | ||
- type: integer | ||
- type: string | ||
description: Max number (or %) of pods that can be updated at the same time. | ||
x-kubernetes-int-or-string: true | ||
pauseRolloutAlarm: | ||
description: CW alarm name used to pause/skip updates. Alarm should be on the same account and region. | ||
type: string | ||
statefulset: | ||
description: The name of the StatefulSet for which the ZoneAwareUpdate applies to. | ||
type: string | ||
type: object | ||
status: | ||
description: ZoneAwareUpdateStatus defines the observed state of ZoneAwareUpdate | ||
properties: | ||
currentRevision: | ||
description: CurrentRevision indicates the version of the StatefulSet used to generate Pods | ||
type: string | ||
deletedReplicas: | ||
description: DeletedReplicas is the number of replicas deleted in the last reconcile loop. | ||
format: int32 | ||
type: integer | ||
oldReplicas: | ||
additionalProperties: | ||
format: int32 | ||
type: integer | ||
description: OldReplicas is the number of Pods *per zone* in the CurrentRevision, when there is new UpdateRevision. It becomes zero for all zones when all pods are in the new revision. | ||
type: object | ||
pausedRollout: | ||
description: PausedRollout indicates if the rollout was paused becaused the PauseRolloutAlarm is in alarm. | ||
type: boolean | ||
updateRevision: | ||
description: UpdateRevision indicates the new version of the StatefulSet | ||
type: string | ||
updateStep: | ||
description: UpdateStep is used to track the rollout progress. Everytime pods are deleted/updated this is increased. It becomes zero when all pods are in the new revision. | ||
format: int32 | ||
type: integer | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} |
123 changes: 123 additions & 0 deletions
123
...alog/aws/zone-aware-controllers-for-k8s/zonecontrol.k8s.aws/v1/zonedisruptionbudgets.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,123 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.9.2 | ||
name: zonedisruptionbudgets.zonecontrol.k8s.aws | ||
spec: | ||
group: zonecontrol.k8s.aws | ||
names: | ||
kind: ZoneDisruptionBudget | ||
listKind: ZoneDisruptionBudgetList | ||
plural: zonedisruptionbudgets | ||
shortNames: | ||
- zdb | ||
singular: zonedisruptionbudget | ||
scope: Namespaced | ||
versions: | ||
- name: v1 | ||
schema: | ||
openAPIV3Schema: | ||
description: ZoneDisruptionBudget is the Schema for the zonedisruptionbudgets 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: ZoneDisruptionBudgetSpec defines the desired state of ZoneDisruptionBudget | ||
properties: | ||
dryRun: | ||
description: Dryn-run mode that can be used to test the new controller before enable it | ||
type: boolean | ||
maxUnavailable: | ||
anyOf: | ||
- type: integer | ||
- type: string | ||
description: Evict pod specification is allowed if at most "maxUnavailable" pods selected by "selector" are unavailable in the same zone after the above operation for pod. Evictions are not allowed if there are unavailable pods in other zones. | ||
x-kubernetes-int-or-string: true | ||
selector: | ||
description: Selector label query over pods managed by the budget | ||
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 | ||
x-kubernetes-map-type: atomic | ||
type: object | ||
status: | ||
description: ZoneDisruptionBudgetStatus defines the observed state of ZoneDisruptionBudget | ||
properties: | ||
currentHealthy: | ||
additionalProperties: | ||
format: int32 | ||
type: integer | ||
description: Current number of healthy pods per zone | ||
type: object | ||
currentUnhealthy: | ||
additionalProperties: | ||
format: int32 | ||
type: integer | ||
description: Current number of unhealthy pods per zone | ||
type: object | ||
desiredHealthy: | ||
additionalProperties: | ||
format: int32 | ||
type: integer | ||
description: Minimum desired number of healthy pods per zone | ||
type: object | ||
disruptedPods: | ||
additionalProperties: | ||
format: date-time | ||
type: string | ||
description: DisruptedPods contains information about pods whose eviction was processed by the API server eviction subresource handler but has not yet been observed by the ZoneDisruptionBudget controller. A pod will be in this map from the time when the API server processed the eviction request to the time when the pod is seen by ZDB controller as having been marked for deletion (or after a timeout). The key in the map is the name of the pod and the value is the time when the API server processed the eviction request. If the deletion didn't occur and a pod is still there it will be removed from the list automatically by ZoneDisruptionBudget controller after some time. | ||
type: object | ||
disruptionsAllowed: | ||
additionalProperties: | ||
format: int32 | ||
type: integer | ||
description: Number of pod disruptions that are currently allowed *per zone* | ||
type: object | ||
expectedPods: | ||
additionalProperties: | ||
format: int32 | ||
type: integer | ||
description: Total number of expected replicas per zone | ||
type: object | ||
observedGeneration: | ||
description: Most recent generation observed when updating this ZDB status. DisruptionsAllowed and other status information is valid only if observedGeneration equals to ZDB's object generation. | ||
format: int64 | ||
type: integer | ||
type: object | ||
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 @@ | ||
pub mod v1; |
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,2 @@ | ||
pub mod zoneawareupdates; | ||
pub mod zonedisruptionbudgets; |
59 changes: 59 additions & 0 deletions
59
kube-custom-resources-rs/src/zonecontrol_k8s_aws/v1/zoneawareupdates.rs
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,59 @@ | ||
// WARNING: generated by kopium - manual changes will be overwritten | ||
// kopium command: kopium --docs --filename=./crd-catalog/aws/zone-aware-controllers-for-k8s/zonecontrol.k8s.aws/v1/zoneawareupdates.yaml --derive=Default --derive=PartialEq | ||
// kopium version: 0.16.5 | ||
|
||
use kube::CustomResource; | ||
use serde::{Serialize, Deserialize}; | ||
use std::collections::BTreeMap; | ||
use k8s_openapi::apimachinery::pkg::util::intstr::IntOrString; | ||
|
||
/// ZoneAwareUpdateSpec defines the desired state of ZoneAwareUpdate | ||
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)] | ||
#[kube(group = "zonecontrol.k8s.aws", version = "v1", kind = "ZoneAwareUpdate", plural = "zoneawareupdates")] | ||
#[kube(namespaced)] | ||
#[kube(status = "ZoneAwareUpdateStatus")] | ||
#[kube(schema = "disabled")] | ||
pub struct ZoneAwareUpdateSpec { | ||
/// Dryn-run mode that can be used to test the new controller before enable it | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "dryRun")] | ||
pub dry_run: Option<bool>, | ||
/// The exponential growth rate in float string. Default value is 2.0. It's possible to disable exponential updates by setting the ExponentialFactor to 0. In this case, the number of pods updated at each step is defined only by the MaxUnavailable param. | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "exponentialFactor")] | ||
pub exponential_factor: Option<String>, | ||
/// Flag to ignore the PauseRolloutAlarm (default false) | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "ignoreAlarm")] | ||
pub ignore_alarm: Option<bool>, | ||
/// Max number (or %) of pods that can be updated at the same time. | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "maxUnavailable")] | ||
pub max_unavailable: Option<IntOrString>, | ||
/// CW alarm name used to pause/skip updates. Alarm should be on the same account and region. | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "pauseRolloutAlarm")] | ||
pub pause_rollout_alarm: Option<String>, | ||
/// The name of the StatefulSet for which the ZoneAwareUpdate applies to. | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub statefulset: Option<String>, | ||
} | ||
|
||
/// ZoneAwareUpdateStatus defines the observed state of ZoneAwareUpdate | ||
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] | ||
pub struct ZoneAwareUpdateStatus { | ||
/// CurrentRevision indicates the version of the StatefulSet used to generate Pods | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "currentRevision")] | ||
pub current_revision: Option<String>, | ||
/// DeletedReplicas is the number of replicas deleted in the last reconcile loop. | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "deletedReplicas")] | ||
pub deleted_replicas: Option<i32>, | ||
/// OldReplicas is the number of Pods *per zone* in the CurrentRevision, when there is new UpdateRevision. It becomes zero for all zones when all pods are in the new revision. | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "oldReplicas")] | ||
pub old_replicas: Option<BTreeMap<String, i32>>, | ||
/// PausedRollout indicates if the rollout was paused becaused the PauseRolloutAlarm is in alarm. | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "pausedRollout")] | ||
pub paused_rollout: Option<bool>, | ||
/// UpdateRevision indicates the new version of the StatefulSet | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "updateRevision")] | ||
pub update_revision: Option<String>, | ||
/// UpdateStep is used to track the rollout progress. Everytime pods are deleted/updated this is increased. It becomes zero when all pods are in the new revision. | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "updateStep")] | ||
pub update_step: Option<i32>, | ||
} | ||
|
Oops, something went wrong.