kcr_jetstream_nats_io 3.20260118.103134

Kubernetes Custom Resource Bindings
Documentation
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium --docs --derive=Default --derive=PartialEq --smart-derive-elision --filename crd-catalog/nats-io/nack/jetstream.nats.io/v1beta2/objectstores.yaml
// kopium version: 0.22.5

#[allow(unused_imports)]
mod prelude {
    pub use kube::CustomResource;
    pub use serde::{Serialize, Deserialize};
    pub use std::collections::BTreeMap;
    pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
}
use self::prelude::*;

#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[kube(group = "jetstream.nats.io", version = "v1beta2", kind = "ObjectStore", plural = "objectstores")]
#[kube(namespaced)]
#[kube(status = "ObjectStoreStatus")]
#[kube(schema = "disabled")]
#[kube(derive="Default")]
#[kube(derive="PartialEq")]
pub struct ObjectStoreSpec {
    /// Name of the account to which the Object Store belongs.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub account: Option<String>,
    /// A unique name for the Object Store.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub bucket: Option<String>,
    /// Object Store compression.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub compression: Option<bool>,
    /// NATS user credentials for connecting to servers. Please make sure your controller has mounted the creds on its path.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub creds: Option<String>,
    /// The description of the Object Store.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// The JetStream domain to use for the Object Store.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "jsDomain")]
    pub js_domain: Option<String>,
    /// The maximum size of the Store in bytes.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxBytes")]
    pub max_bytes: Option<i64>,
    /// Additional Object Store metadata.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub metadata: Option<BTreeMap<String, String>>,
    /// NATS user NKey for connecting to servers.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub nkey: Option<String>,
    /// The Object Store placement via tags or cluster name.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub placement: Option<ObjectStorePlacement>,
    /// When true, the managed Object Store will not be deleted when the resource is deleted.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "preventDelete")]
    pub prevent_delete: Option<bool>,
    /// When true, the managed Object Store will not be updated when the resource is updated.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "preventUpdate")]
    pub prevent_update: Option<bool>,
    /// The number of replicas to keep for the Object Store in clustered JetStream.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub replicas: Option<i64>,
    /// A list of servers for creating the Object Store.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub servers: Option<Vec<String>>,
    /// The storage backend to use for the Object Store.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub storage: Option<ObjectStoreStorage>,
    /// A client's TLS certs and keys.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tls: Option<ObjectStoreTls>,
    /// When true, the Object Store will initiate TLS before server INFO.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "tlsFirst")]
    pub tls_first: Option<bool>,
    /// The time expiry for keys.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ttl: Option<String>,
}

/// The Object Store placement via tags or cluster name.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ObjectStorePlacement {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub cluster: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<String>>,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum ObjectStoreStorage {
    #[serde(rename = "file")]
    File,
    #[serde(rename = "memory")]
    Memory,
}

/// A client's TLS certs and keys.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ObjectStoreTls {
    /// A client's cert filepath. Should be mounted.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "clientCert")]
    pub client_cert: Option<String>,
    /// A client's key filepath. Should be mounted.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "clientKey")]
    pub client_key: Option<String>,
    /// A list of filepaths to CAs. Should be mounted.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "rootCas")]
    pub root_cas: Option<Vec<String>>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ObjectStoreStatus {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub conditions: Option<Vec<Condition>>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "observedGeneration")]
    pub observed_generation: Option<i64>,
}