pub struct Kanidm {
pub metadata: ObjectMeta,
pub spec: KanidmSpec,
pub status: Option<KanidmStatus>,
}Expand description
The Kanidm custom resource definition (CRD) defines a desired Kanidm
setup to run in a Kubernetes cluster. It allows to specify many options such as the number of replicas,
persistent storage, and many more.
For each `Kanidm` resource, the Operator deploys one or several `StatefulSet` objects in the same namespace. The number of StatefulSets is equal to the number of replicas.Fields§
§metadata: ObjectMeta§spec: KanidmSpec§status: Option<KanidmStatus>Implementations§
Source§impl Kanidm
impl Kanidm
Sourcepub fn new(name: &str, spec: KanidmSpec) -> Self
pub fn new(name: &str, spec: KanidmSpec) -> Self
Spec based constructor for derived custom resource
Source§impl Kanidm
impl Kanidm
pub async fn delete<K>(&self, ctx: &Context, resource: &K) -> Result<()>where
K: Resource<Scope = NamespaceResourceScope> + Serialize + Clone + Debug + for<'de> Deserialize<'de>,
<K as Resource>::DynamicType: Default,
<K as Resource>::Scope: Sized,
pub async fn patch<K>(&self, ctx: &Context, resource: K) -> Result<K>where
K: Resource<Scope = NamespaceResourceScope> + Serialize + Clone + Debug + for<'de> Deserialize<'de>,
<K as Resource>::DynamicType: Default,
<K as Resource>::Scope: Sized,
Trait Implementations§
Source§impl BackoffContext<Kanidm> for Context
impl BackoffContext<Kanidm> for Context
Source§impl CustomResourceExt for Kanidm
impl CustomResourceExt for Kanidm
Source§fn crd() -> CustomResourceDefinition
fn crd() -> CustomResourceDefinition
Helper to generate the CRD including the JsonSchema Read more
Source§fn crd_name() -> &'static str
fn crd_name() -> &'static str
Helper to return the name of this
CustomResourceDefinition in kubernetes. Read moreSource§fn api_resource() -> ApiResource
fn api_resource() -> ApiResource
Helper to generate the api information type for use with the dynamic
ApiSource§fn shortnames() -> &'static [&'static str]
fn shortnames() -> &'static [&'static str]
Shortnames of this resource type. Read more
Source§impl<'de> Deserialize<'de> for Kanidm
impl<'de> Deserialize<'de> for Kanidm
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl HasSpec for Kanidm
impl HasSpec for Kanidm
Source§type Spec = KanidmSpec
type Spec = KanidmSpec
The type of the
spec of this resourceSource§fn spec(&self) -> &KanidmSpec
fn spec(&self) -> &KanidmSpec
Returns a reference to the
spec of the objectSource§fn spec_mut(&mut self) -> &mut KanidmSpec
fn spec_mut(&mut self) -> &mut KanidmSpec
Returns a mutable reference to the
spec of the objectSource§impl HasStatus for Kanidm
impl HasStatus for Kanidm
Source§type Status = KanidmStatus
type Status = KanidmStatus
The type of the
status objectSource§fn status(&self) -> Option<&KanidmStatus>
fn status(&self) -> Option<&KanidmStatus>
Returns an optional reference to the
status of the objectSource§fn status_mut(&mut self) -> &mut Option<KanidmStatus>
fn status_mut(&mut self) -> &mut Option<KanidmStatus>
Returns an optional mutable reference to the
status of the objectSource§impl JsonSchema for Kanidm
impl JsonSchema for Kanidm
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Resource for Kanidm
impl Resource for Kanidm
Source§type DynamicType = ()
type DynamicType = ()
Type information for types that do not know their resource information at compile time. Read more
Source§type Scope = NamespaceResourceScope
type Scope = NamespaceResourceScope
Type information for the api scope of the resource when known at compile time Read more
Source§fn meta(&self) -> &ObjectMeta
fn meta(&self) -> &ObjectMeta
Metadata that all persisted resources must have
Source§fn meta_mut(&mut self) -> &mut ObjectMeta
fn meta_mut(&mut self) -> &mut ObjectMeta
Metadata that all persisted resources must have
Source§fn url_path(dt: &Self::DynamicType, namespace: Option<&str>) -> String
fn url_path(dt: &Self::DynamicType, namespace: Option<&str>) -> String
Creates a url path for http requests for this resource
Source§fn object_ref(&self, dt: &Self::DynamicType) -> ObjectReference
fn object_ref(&self, dt: &Self::DynamicType) -> ObjectReference
Generates an object reference for the resource
Source§fn controller_owner_ref(&self, dt: &Self::DynamicType) -> Option<OwnerReference>
fn controller_owner_ref(&self, dt: &Self::DynamicType) -> Option<OwnerReference>
Generates a controller owner reference pointing to this resource Read more
Source§fn owner_ref(&self, dt: &Self::DynamicType) -> Option<OwnerReference>
fn owner_ref(&self, dt: &Self::DynamicType) -> Option<OwnerReference>
Generates an owner reference pointing to this resource Read more
Source§impl SecretExt for Kanidm
impl SecretExt for Kanidm
fn admins_secret_name(&self) -> String
fn replica_secret_name(&self, pod_name: &str) -> String
async fn generate_admins_secret(&self, ctx: Arc<Context>) -> Result<Secret>
async fn generate_replica_secret( &self, ctx: Arc<Context>, pod_name: &str, ) -> Result<Secret>
async fn update_replica_secret( &self, ctx: Arc<Context>, pod_name: &str, ) -> Result<Secret>
Source§impl StatefulSetExt for Kanidm
impl StatefulSetExt for Kanidm
fn statefulset_name(&self, rg_name: &str) -> String
fn pod_name(&self, rg_name: &str, i: i32) -> String
fn pod_env_prefix(&self, pod_name: &str) -> String
fn create_statefulset( &self, replica_group: &ReplicaGroup, ctx: &Arc<Context>, ) -> StatefulSet
Auto Trait Implementations§
impl Freeze for Kanidm
impl RefUnwindSafe for Kanidm
impl Send for Kanidm
impl Sync for Kanidm
impl Unpin for Kanidm
impl UnwindSafe for Kanidm
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T, K> KubeOperations<T, K> for Twhere
T: Resource + ResourceExt + Lookup + Clone + 'static,
<T as Lookup>::DynamicType: Eq + Hash + Clone,
K: Resource<Scope = NamespaceResourceScope> + Serialize + Clone + Debug + for<'de> Deserialize<'de>,
<K as Resource>::DynamicType: Default,
<K as Resource>::Scope: Sized,
impl<T, K> KubeOperations<T, K> for Twhere
T: Resource + ResourceExt + Lookup + Clone + 'static,
<T as Lookup>::DynamicType: Eq + Hash + Clone,
K: Resource<Scope = NamespaceResourceScope> + Serialize + Clone + Debug + for<'de> Deserialize<'de>,
<K as Resource>::DynamicType: Default,
<K as Resource>::Scope: Sized,
async fn kube_delete( &self, client: Client, _metrics: &ControllerMetrics, obj: &K, ) -> Result<(), Error>
async fn kube_patch( &self, client: Client, metrics: &ControllerMetrics, obj: K, operator_name: &str, ) -> Result<K, Error>
Source§impl<K> Lookup for Kwhere
K: Resource,
impl<K> Lookup for Kwhere
K: Resource,
Source§type DynamicType = <K as Resource>::DynamicType
type DynamicType = <K as Resource>::DynamicType
Type information for types that do not know their resource information at compile time.
This is equivalent to
Resource::DynamicType.Source§fn resource_version(&self) -> Option<Cow<'_, str>>
fn resource_version(&self) -> Option<Cow<'_, str>>
The resource version of the object.
Source§fn api_version(dyntype: &Self::DynamicType) -> Cow<'_, str>
fn api_version(dyntype: &Self::DynamicType) -> Cow<'_, str>
The apiVersion for this object.
Source§fn to_object_ref(&self, dyntype: Self::DynamicType) -> ObjectRef<Self>
fn to_object_ref(&self, dyntype: Self::DynamicType) -> ObjectRef<Self>
Constructs an
ObjectRef for this object.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<K> ResourceExt for Kwhere
K: Resource,
impl<K> ResourceExt for Kwhere
K: Resource,
Source§fn name_unchecked(&self) -> String
fn name_unchecked(&self) -> String
Returns the name of the resource, panicking if it is unset Read more
Source§fn resource_version(&self) -> Option<String>
fn resource_version(&self) -> Option<String>
The resource version
Source§fn uid(&self) -> Option<String>
fn uid(&self) -> Option<String>
Unique ID (if you delete resource and then create a new
resource with the same name, it will have different ID)
Source§fn labels_mut(&mut self) -> &mut BTreeMap<String, String>
fn labels_mut(&mut self) -> &mut BTreeMap<String, String>
Provides mutable access to the labels
Source§fn annotations_mut(&mut self) -> &mut BTreeMap<String, String>
fn annotations_mut(&mut self) -> &mut BTreeMap<String, String>
Provider mutable access to the annotations
Source§fn owner_references(&self) -> &[OwnerReference]
fn owner_references(&self) -> &[OwnerReference]
Returns resource owner references
Source§fn owner_references_mut(&mut self) -> &mut Vec<OwnerReference>
fn owner_references_mut(&mut self) -> &mut Vec<OwnerReference>
Provides mutable access to the owner references
Source§fn finalizers(&self) -> &[String]
fn finalizers(&self) -> &[String]
Returns resource finalizers
Source§fn finalizers_mut(&mut self) -> &mut Vec<String>
fn finalizers_mut(&mut self) -> &mut Vec<String>
Provides mutable access to the finalizers
Source§fn managed_fields(&self) -> &[ManagedFieldsEntry]
fn managed_fields(&self) -> &[ManagedFieldsEntry]
Returns managed fields
Source§fn managed_fields_mut(&mut self) -> &mut Vec<ManagedFieldsEntry>
fn managed_fields_mut(&mut self) -> &mut Vec<ManagedFieldsEntry>
Provides mutable access to managed fields