-
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.
Signed-off-by: Sebastian Hoß <[email protected]>
- Loading branch information
Showing
9 changed files
with
264 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
1 change: 1 addition & 0 deletions
1
...catalog/redhat-cop/keepalived-operator/redhatcop.redhat.io/v1alpha1/keepalivedgroups.args
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 @@ | ||
--derive=PartialEq |
146 changes: 146 additions & 0 deletions
146
...catalog/redhat-cop/keepalived-operator/redhatcop.redhat.io/v1alpha1/keepalivedgroups.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,146 @@ | ||
apiVersion: "apiextensions.k8s.io/v1" | ||
kind: "CustomResourceDefinition" | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: "v0.9.0" | ||
name: "keepalivedgroups.redhatcop.redhat.io" | ||
spec: | ||
group: "redhatcop.redhat.io" | ||
names: | ||
kind: "KeepalivedGroup" | ||
listKind: "KeepalivedGroupList" | ||
plural: "keepalivedgroups" | ||
singular: "keepalivedgroup" | ||
scope: "Namespaced" | ||
versions: | ||
- name: "v1alpha1" | ||
schema: | ||
openAPIV3Schema: | ||
description: "KeepalivedGroup is the Schema for the keepalivedgroups 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: "KeepalivedGroupSpec defines the desired state of KeepalivedGroup" | ||
properties: | ||
blacklistRouterIDs: | ||
description: "// +kubebuilder:validation:UniqueItems=true" | ||
items: | ||
type: "integer" | ||
type: "array" | ||
x-kubernetes-list-type: "set" | ||
daemonsetPodAnnotations: | ||
additionalProperties: | ||
type: "string" | ||
type: "object" | ||
x-kubernetes-map-type: "granular" | ||
daemonsetPodPriorityClassName: | ||
type: "string" | ||
image: | ||
default: "registry.redhat.io/openshift4/ose-keepalived-ipfailover" | ||
description: "//+kubebuilder:validation:Optional" | ||
type: "string" | ||
interface: | ||
type: "string" | ||
interfaceFromIP: | ||
format: "ipv4" | ||
type: "string" | ||
nodeSelector: | ||
additionalProperties: | ||
type: "string" | ||
type: "object" | ||
x-kubernetes-map-type: "granular" | ||
passwordAuth: | ||
description: "PasswordAuth references a Kubernetes secret to extract the password for VRRP authentication" | ||
properties: | ||
secretKey: | ||
default: "password" | ||
type: "string" | ||
secretRef: | ||
description: "LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace." | ||
properties: | ||
name: | ||
description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?" | ||
type: "string" | ||
type: "object" | ||
required: | ||
- "secretRef" | ||
type: "object" | ||
unicastEnabled: | ||
type: "boolean" | ||
verbatimConfig: | ||
additionalProperties: | ||
type: "string" | ||
type: "object" | ||
x-kubernetes-map-type: "granular" | ||
required: | ||
- "image" | ||
- "interface" | ||
type: "object" | ||
status: | ||
description: "KeepalivedGroupStatus defines the observed state of KeepalivedGroup" | ||
properties: | ||
conditions: | ||
description: "INSERT ADDITIONAL STATUS FIELD - define observed state of cluster" | ||
items: | ||
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" | ||
properties: | ||
lastTransitionTime: | ||
description: "lastTransitionTime is the 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: "message is a human readable message indicating details about the transition. This may be an empty string." | ||
maxLength: 32768 | ||
type: "string" | ||
observedGeneration: | ||
description: "observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance." | ||
format: "int64" | ||
minimum: 0.0 | ||
type: "integer" | ||
reason: | ||
description: "reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty." | ||
maxLength: 1024 | ||
minLength: 1 | ||
pattern: "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$" | ||
type: "string" | ||
status: | ||
description: "status of the condition, one of True, False, Unknown." | ||
enum: | ||
- "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. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)" | ||
maxLength: 316 | ||
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])$" | ||
type: "string" | ||
required: | ||
- "lastTransitionTime" | ||
- "message" | ||
- "reason" | ||
- "status" | ||
- "type" | ||
type: "object" | ||
type: "array" | ||
x-kubernetes-list-map-keys: | ||
- "type" | ||
x-kubernetes-list-type: "map" | ||
routerIDs: | ||
additionalProperties: | ||
type: "integer" | ||
type: "object" | ||
x-kubernetes-map-type: "granular" | ||
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 v1alpha1; |
96 changes: 96 additions & 0 deletions
96
kube-custom-resources-rs/src/redhatcop_redhat_io/v1alpha1/keepalivedgroups.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,96 @@ | ||
// WARNING: generated by kopium - manual changes will be overwritten | ||
// kopium command: kopium --docs --filename=./crd-catalog/redhat-cop/keepalived-operator/redhatcop.redhat.io/v1alpha1/keepalivedgroups.yaml --derive=PartialEq | ||
// kopium version: 0.16.5 | ||
|
||
use kube::CustomResource; | ||
use serde::{Serialize, Deserialize}; | ||
use std::collections::BTreeMap; | ||
|
||
/// KeepalivedGroupSpec defines the desired state of KeepalivedGroup | ||
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, PartialEq)] | ||
#[kube(group = "redhatcop.redhat.io", version = "v1alpha1", kind = "KeepalivedGroup", plural = "keepalivedgroups")] | ||
#[kube(namespaced)] | ||
#[kube(status = "KeepalivedGroupStatus")] | ||
#[kube(schema = "disabled")] | ||
pub struct KeepalivedGroupSpec { | ||
/// // +kubebuilder:validation:UniqueItems=true | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "blacklistRouterIDs")] | ||
pub blacklist_router_i_ds: Option<Vec<i64>>, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "daemonsetPodAnnotations")] | ||
pub daemonset_pod_annotations: Option<BTreeMap<String, String>>, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "daemonsetPodPriorityClassName")] | ||
pub daemonset_pod_priority_class_name: Option<String>, | ||
/// //+kubebuilder:validation:Optional | ||
pub image: String, | ||
pub interface: String, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "interfaceFromIP")] | ||
pub interface_from_ip: Option<String>, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeSelector")] | ||
pub node_selector: Option<BTreeMap<String, String>>, | ||
/// PasswordAuth references a Kubernetes secret to extract the password for VRRP authentication | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "passwordAuth")] | ||
pub password_auth: Option<KeepalivedGroupPasswordAuth>, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "unicastEnabled")] | ||
pub unicast_enabled: Option<bool>, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "verbatimConfig")] | ||
pub verbatim_config: Option<BTreeMap<String, String>>, | ||
} | ||
|
||
/// PasswordAuth references a Kubernetes secret to extract the password for VRRP authentication | ||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] | ||
pub struct KeepalivedGroupPasswordAuth { | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKey")] | ||
pub secret_key: Option<String>, | ||
/// LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. | ||
#[serde(rename = "secretRef")] | ||
pub secret_ref: KeepalivedGroupPasswordAuthSecretRef, | ||
} | ||
|
||
/// LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. | ||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] | ||
pub struct KeepalivedGroupPasswordAuthSecretRef { | ||
/// Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub name: Option<String>, | ||
} | ||
|
||
/// KeepalivedGroupStatus defines the observed state of KeepalivedGroup | ||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] | ||
pub struct KeepalivedGroupStatus { | ||
/// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub conditions: Option<Vec<KeepalivedGroupStatusConditions>>, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "routerIDs")] | ||
pub router_i_ds: Option<BTreeMap<String, i64>>, | ||
} | ||
|
||
/// Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` | ||
/// // other fields } | ||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] | ||
pub struct KeepalivedGroupStatusConditions { | ||
/// lastTransitionTime is the 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. | ||
#[serde(rename = "lastTransitionTime")] | ||
pub last_transition_time: String, | ||
/// message is a human readable message indicating details about the transition. This may be an empty string. | ||
pub message: String, | ||
/// observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "observedGeneration")] | ||
pub observed_generation: Option<i64>, | ||
/// reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. | ||
pub reason: String, | ||
/// status of the condition, one of True, False, Unknown. | ||
pub status: KeepalivedGroupStatusConditionsStatus, | ||
/// 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. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) | ||
#[serde(rename = "type")] | ||
pub r#type: String, | ||
} | ||
|
||
/// Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` | ||
/// // other fields } | ||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] | ||
pub enum KeepalivedGroupStatusConditionsStatus { | ||
True, | ||
False, | ||
Unknown, | ||
} | ||
|
1 change: 1 addition & 0 deletions
1
kube-custom-resources-rs/src/redhatcop_redhat_io/v1alpha1/mod.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 @@ | ||
pub mod keepalivedgroups; |