Skip to content

Commit

Permalink
add b3scale-operator
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Hoß <[email protected]>
  • Loading branch information
sebhoss committed Nov 4, 2023
1 parent 014a0ba commit 2af96b0
Show file tree
Hide file tree
Showing 7 changed files with 238 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ Files: crd-catalog/aws-controllers-k8s/sfn-controller/*
Copyright: The aws-controllers-k8s/sfn-controller Authors
License: Apache-2.0

Files: crd-catalog/b3scale/b3scale-operator/*
Copyright: The b3scale/b3scale-operator Authors
License: Apache-2.0

Files: crd-catalog/bitnami-labs/sealed-secrets/*
Copyright: The bitnami-labs/sealed-secrets Authors
License: Apache-2.0
Expand Down
7 changes: 7 additions & 0 deletions code-generator/src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,13 @@ pub const CRD_V1_SOURCES: &'static [UpstreamSource] = &[
"https://github.com/aws-controllers-k8s/sfn-controller/blob/main/config/crd/bases/sfn.services.k8s.aws_statemachines.yaml",
],
},
UpstreamSource {
project_name: "b3scale/b3scale-operator",
license: APACHE_V2,
urls: &[
"https://github.com/b3scale/b3scale-operator/blob/main/kubernetes/crd.yaml",
],
},
UpstreamSource {
project_name: "bitnami-labs/sealed-secrets",
license: APACHE_V2,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: bbbfrontends.b3scale.infra.run
spec:
group: b3scale.infra.run
names:
kind: BBBFrontend
listKind: BBBFrontendList
plural: bbbfrontends
singular: bbbfrontend
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
properties:
spec:
description: Desired state of the BBBFrontend resource.
properties:
credentials:
description: Predefined credentials for the B3scale instance
nullable: true
properties:
key:
description: Predefined key for B3scale instance, will be defined if not set
type: string
secretRef:
description: SecretRef is a reference to a key in a Secret resource containing the key to connect to the BBB instance.
properties:
key:
description: The key of the entry in the Secret resource's `data` field to be used.
type: string
name:
description: 'Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
required:
- name
- key
type: object
type: object
settings:
description: Settings defines the B3Scale instance settings
properties:
create_default_params:
additionalProperties:
type: string
description: See https://github.com/b3scale/b3scale#configure-create-parameter-defaults-and-overrides
nullable: true
type: object
create_override_params:
additionalProperties:
type: string
description: See https://github.com/b3scale/b3scale#configure-create-parameter-defaults-and-overrides
nullable: true
type: object
default_presentation:
description: See https://github.com/b3scale/b3scale#middleware-configuration
nullable: true
properties:
force:
type: boolean
url:
type: string
type: object
required_tags:
description: See https://github.com/b3scale/b3scale#middleware-configuration
items:
type: string
nullable: true
type: array
type: object
type: object
status:
description: Status of the BBBFrontend. This is set and managed automatically.
properties:
conditions:
description: List of status conditions to indicate the status of the BBB frontend. Known condition types are `Ready`.
items:
description: BBBFrontendCondition contains condition information for an BBBFrontend.
properties:
lastTransitionTime:
description: LastTransitionTime is the timestamp corresponding to the last status change of this condition.
format: date-time
type: string
message:
description: Message is a human readable description of the details of the last transition, complementing reason.
type: string
observedGeneration:
description: If set, this represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.condition[x].observedGeneration is 9, the condition is out of date with respect to the current state of the BBBFrontend.
format: int64
type: integer
reason:
description: Reason is a brief machine readable explanation for the condition's last transition.
type: string
status:
description: Status of the condition, one of (`True`, `False`, `Unknown`).
enum:
- 'True'
- 'False'
- Unknown
type: string
type:
description: Type of the condition, known values are (`Ready`).
type: string
required:
- status
- type
type: object
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
1 change: 1 addition & 0 deletions kube-custom-resources-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ asdb_aerospike_com_v1beta1 = []
autoscaling_k8s_io_v1 = []
autoscaling_k8s_io_v1beta2 = []
autoscaling_karmada_io_v1alpha1 = []
b3scale_infra_run_v1 = []
batch_volcano_sh_v1alpha1 = []
beat_k8s_elastic_co_v1beta1 = []
binding_operators_coreos_com_v1alpha1 = []
Expand Down
107 changes: 107 additions & 0 deletions kube-custom-resources-rs/src/b3scale_infra_run_v1/bbbfrontends.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium --docs --filename ./crd-catalog/b3scale/b3scale-operator/b3scale.infra.run/v1/bbbfrontends.yaml
// kopium version: 0.16.1

use kube::CustomResource;
use serde::{Serialize, Deserialize};
use std::collections::BTreeMap;

/// Desired state of the BBBFrontend resource.
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug)]
#[kube(group = "b3scale.infra.run", version = "v1", kind = "BBBFrontend", plural = "bbbfrontends")]
#[kube(namespaced)]
#[kube(status = "BBBFrontendStatus")]
#[kube(schema = "disabled")]
pub struct BBBFrontendSpec {
/// Predefined credentials for the B3scale instance
#[serde(default, skip_serializing_if = "Option::is_none")]
pub credentials: Option<BBBFrontendCredentials>,
/// Settings defines the B3Scale instance settings
#[serde(default, skip_serializing_if = "Option::is_none")]
pub settings: Option<BBBFrontendSettings>,
}

/// Predefined credentials for the B3scale instance
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct BBBFrontendCredentials {
/// Predefined key for B3scale instance, will be defined if not set
#[serde(default, skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
/// SecretRef is a reference to a key in a Secret resource containing the key to connect to the BBB instance.
#[serde(default, skip_serializing_if = "Option::is_none", rename = "secretRef")]
pub secret_ref: Option<BBBFrontendCredentialsSecretRef>,
}

/// SecretRef is a reference to a key in a Secret resource containing the key to connect to the BBB instance.
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct BBBFrontendCredentialsSecretRef {
/// The key of the entry in the Secret resource's `data` field to be used.
pub key: String,
/// Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
pub name: String,
}

/// Settings defines the B3Scale instance settings
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct BBBFrontendSettings {
/// See https://github.com/b3scale/b3scale#configure-create-parameter-defaults-and-overrides
#[serde(default, skip_serializing_if = "Option::is_none")]
pub create_default_params: Option<BTreeMap<String, String>>,
/// See https://github.com/b3scale/b3scale#configure-create-parameter-defaults-and-overrides
#[serde(default, skip_serializing_if = "Option::is_none")]
pub create_override_params: Option<BTreeMap<String, String>>,
/// See https://github.com/b3scale/b3scale#middleware-configuration
#[serde(default, skip_serializing_if = "Option::is_none")]
pub default_presentation: Option<BBBFrontendSettingsDefaultPresentation>,
/// See https://github.com/b3scale/b3scale#middleware-configuration
#[serde(default, skip_serializing_if = "Option::is_none")]
pub required_tags: Option<Vec<String>>,
}

/// See https://github.com/b3scale/b3scale#middleware-configuration
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct BBBFrontendSettingsDefaultPresentation {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub force: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
}

/// Status of the BBBFrontend. This is set and managed automatically.
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct BBBFrontendStatus {
/// List of status conditions to indicate the status of the BBB frontend. Known condition types are `Ready`.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub conditions: Option<Vec<BBBFrontendStatusConditions>>,
}

/// BBBFrontendCondition contains condition information for an BBBFrontend.
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct BBBFrontendStatusConditions {
/// LastTransitionTime is the timestamp corresponding to the last status change of this condition.
#[serde(default, skip_serializing_if = "Option::is_none", rename = "lastTransitionTime")]
pub last_transition_time: Option<String>,
/// Message is a human readable description of the details of the last transition, complementing reason.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
/// If set, this represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.condition[x].observedGeneration is 9, the condition is out of date with respect to the current state of the BBBFrontend.
#[serde(default, skip_serializing_if = "Option::is_none", rename = "observedGeneration")]
pub observed_generation: Option<i64>,
/// Reason is a brief machine readable explanation for the condition's last transition.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub reason: Option<String>,
/// Status of the condition, one of (`True`, `False`, `Unknown`).
pub status: BBBFrontendStatusConditionsStatus,
/// Type of the condition, known values are (`Ready`).
#[serde(rename = "type")]
pub r#type: String,
}

/// BBBFrontendCondition contains condition information for an BBBFrontend.
#[derive(Serialize, Deserialize, Clone, Debug)]
pub enum BBBFrontendStatusConditionsStatus {
True,
False,
Unknown,
}

1 change: 1 addition & 0 deletions kube-custom-resources-rs/src/b3scale_infra_run_v1/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod bbbfrontends;
2 changes: 2 additions & 0 deletions kube-custom-resources-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ pub mod autoscaling_k8s_io_v1;
pub mod autoscaling_k8s_io_v1beta2;
#[cfg(feature = "autoscaling_karmada_io_v1alpha1")]
pub mod autoscaling_karmada_io_v1alpha1;
#[cfg(feature = "b3scale_infra_run_v1")]
pub mod b3scale_infra_run_v1;
#[cfg(feature = "batch_volcano_sh_v1alpha1")]
pub mod batch_volcano_sh_v1alpha1;
#[cfg(feature = "beat_k8s_elastic_co_v1beta1")]
Expand Down

0 comments on commit 2af96b0

Please sign in to comment.