Skip to main content

KanidmSpec

Struct KanidmSpec 

Source
pub struct KanidmSpec {
Show 39 fields pub domain: String, pub origin: Option<String>, pub replica_groups: Vec<ReplicaGroup>, pub external_replication_nodes: Vec<ExternalReplicationNode>, pub image: String, pub disable_upgrade_checks: bool, pub log_level: KanidmLogLevel, pub port_name: String, pub image_pull_policy: Option<String>, pub env: Option<Vec<EnvVar>>, pub oauth2_client_namespace_selector: Option<LabelSelector>, pub group_namespace_selector: Option<LabelSelector>, pub person_namespace_selector: Option<LabelSelector>, pub service_account_namespace_selector: Option<LabelSelector>, pub storage: Option<KanidmStorage>, pub ldap_port_name: Option<String>, pub tls_secret_name: Option<String>, pub service: Option<KanidmService>, pub ingress: Option<KanidmIngress>, pub region_ingress: Option<KanidmRegionIngress>, pub gateway: Option<KanidmGateway>, pub volumes: Option<Vec<Volume>>, pub volume_mounts: Option<Vec<VolumeMount>>, pub persistent_volume_claim_retention_policy: Option<StatefulSetPersistentVolumeClaimRetentionPolicy>, pub security_context: Option<PodSecurityContext>, pub dns_policy: Option<String>, pub dns_config: Option<PodDNSConfig>, pub containers: Option<Vec<Container>>, pub init_containers: Option<Vec<Container>>, pub min_ready_seconds: Option<i32>, pub host_aliases: Option<Vec<HostAlias>>, pub host_network: Option<bool>, pub ip_family: IpFamily, pub runtime_class_name: Option<String>, pub automount_service_account_token: Option<bool>, pub enable_service_links: bool, pub host_users: Option<bool>, pub domain_appearance: Option<DomainAppearanceSpec>, pub mail_sender: Option<MailSenderSpec>,
}
Expand description

Specification of the desired behavior of the Kanidm cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status

Fields§

§domain: String

The DNS domain name of the server. This is used in a number of security-critical contexts such as webauthn, so it must match your DNS hostname. It is used to create security principal names such as william@idm.example.com so that in a (future) trust configuration it is possible to have unique Security Principal Names (spns) throughout the topology.

This cannot be changed after creation.

§origin: Option<String>

The origin for webauthn. This is the url to the server, with the port included if it is non-standard (any port except 443). This must match or be a descendent of the domain name you configure above. If these two items are not consistent, the server WILL refuse to start! origin = “https://idm.example.com”

§OR

origin = “https://idm.example.com:8443”

Defaults to https://<domain> if not specified.

§replica_groups: Vec<ReplicaGroup>

Different group of replicas with specific configuration as role, resources, affinity rules, and more. Each group will be deployed as a separate StatefulSet.

§external_replication_nodes: Vec<ExternalReplicationNode>

List of external replication nodes. This is used to configure replication between different Kanidm clusters.

WARNING: admin and idm_admin passwords are going to be reset.

§image: String

Container image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like StatefulSets.

§disable_upgrade_checks: bool

Before starting an upgrade, perform pre-upgrade checks to ensure that data can be safely migrated to the new version. If pre-checks fail, image change is disallowed. If set to true, upgrade pre-checks are skipped. Defaults to false.

§log_level: KanidmLogLevel

Log level for Kanidm.

§port_name: String

Port name used for the pods and governing service. Defaults to https.

§image_pull_policy: Option<String>

Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images

§env: Option<Vec<EnvVar>>

List of environment variables to set in the kanidm container. This can be used to set Kanidm configuration options. More info: https://kanidm.github.io/kanidm/master/server_configuration.html

§oauth2_client_namespace_selector: Option<LabelSelector>

Namespaces to match for KanidmOAuth2Clients discovery.

  • Not defined (default): matches only the current namespace where this Kanidm resource is deployed
  • Empty selector {}: matches all namespaces in the cluster
  • Selector with labels: matches namespaces with matching labels

Example for all namespaces: oauth2ClientNamespaceSelector: {}

§group_namespace_selector: Option<LabelSelector>

Namespaces to match for KanidmGroups discovery.

  • Not defined (default): matches only the current namespace where this Kanidm resource is deployed
  • Empty selector {}: matches all namespaces in the cluster
  • Selector with labels: matches namespaces with matching labels

Example for all namespaces: groupNamespaceSelector: {}

§person_namespace_selector: Option<LabelSelector>

Namespaces to match for KanidmPersonAccounts discovery.

  • Not defined (default): matches only the current namespace where this Kanidm resource is deployed
  • Empty selector {}: matches all namespaces in the cluster
  • Selector with labels: matches namespaces with matching labels

Example for all namespaces: personNamespaceSelector: {}

§service_account_namespace_selector: Option<LabelSelector>

Namespaces to match for KanidmServiceAccounts discovery.

  • Not defined (default): matches only the current namespace where this Kanidm resource is deployed
  • Empty selector {}: matches all namespaces in the cluster
  • Selector with labels: matches namespaces with matching labels

Example for all namespaces: serviceAccountNamespaceSelector: {}

§storage: Option<KanidmStorage>

StorageSpec defines the configured storage for a group Kanidm servers. If no storage option is specified, then by default an EmptyDir will be used.

If multiple storage options are specified, priority will be given as follows:

  1. emptyDir
  2. ephemeral
  3. volumeClaimTemplate

Note: Kaniop does not resize PVCs until Kubernetes fix KEP-4650. Changes to volumeClaimTemplates (e.g., PVC resize or StorageClass changes) are applied non-destructively; the operator does not delete/recreate the StatefulSet for PVC template modifications.

§ldap_port_name: Option<String>

Defines the port name used for the LDAP service. If not defined, LDAP service will not be configured. Service port will be 3636.

StartTLS is not supported due to security risks such as credential leakage and MITM attacks that are fundamental in how StartTLS works. StartTLS can not be repaired to prevent this. LDAPS is the only secure method of communicating to any LDAP server. Kanidm will use its certificates for both HTTPS and LDAPS.

§tls_secret_name: Option<String>

Specifies the name of the secret holding the TLS private key and certificate for the server. If not provided, the ingress secret will be used. The server will not start if the secret is missing.

§service: Option<KanidmService>

Service defines the service configuration for the Kanidm server.

§ingress: Option<KanidmIngress>

Ingress configuration for the Kanidm cluster.

The domain specified in the Kanidm spec will be used as the ingress host. TLS is required and must be configured at the ingress controller level (termination or passthrough). When running multiple replicas, configure session affinity on your ingress controller to ensure proper session handling.

§region_ingress: Option<KanidmRegionIngress>

Region-specific ingress configuration for multi-region deployments.

Allows defining ingress settings for a specific region, using a subdomain of the main Kanidm domain. TLS is required and must be configured at the ingress controller level (termination or passthrough). For multi-region deployments, configure session affinity on your ingress controller to ensure proper session handling.

§gateway: Option<KanidmGateway>

Gateway API configuration for the Kanidm cluster.

Allows configuring an HTTPRoute for Gateway API-based ingress routing. The HTTPRoute will route traffic to the Kanidm service using the specified parentRefs to attach to Gateway(s). Both ingress and gateway can be configured simultaneously for migration scenarios.

§volumes: Option<Vec<Volume>>

Volumes allows the configuration of additional volumes on the output StatefulSet definition. Volumes specified will be appended to other volumes that are generated as a result of StorageSpec objects.

§volume_mounts: Option<Vec<VolumeMount>>

VolumeMounts allows the configuration of additional VolumeMounts.

VolumeMounts will be appended to other VolumeMounts in the kanidm’ container, that are generated as a result of StorageSpec objects.

§persistent_volume_claim_retention_policy: Option<StatefulSetPersistentVolumeClaimRetentionPolicy>

The field controls if and how PVCs are deleted during the lifecycle of a StatefulSet. The default behavior is all PVCs are retained. This is a beta field from 1.27. It requires enabling the StatefulSetAutoDeletePVC feature gate.

§security_context: Option<PodSecurityContext>

SecurityContext holds pod-level security attributes and common container settings. This defaults to the default PodSecurityContext.

§dns_policy: Option<String>

Defines the DNS policy for the pods.

§dns_config: Option<PodDNSConfig>

Defines the DNS configuration for the pods.

§containers: Option<Vec<Container>>

Containers allows injecting additional containers or modifying operator generated containers. This can be used to allow adding an authentication proxy to the Pods or to change the behavior of an operator generated container. Containers described here modify an operator generated container if they share the same name and modifications are done via a strategic merge patch.

The name of container managed by the operator is: kanidm

Overriding containers is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice.

§init_containers: Option<Vec<Container>>

InitContainers allows injecting initContainers to the Pod definition. Those can be used to e.g. fetch secrets for injection into the Kanidm configuration from external sources. Any errors during the execution of an initContainer will lead to a restart of the Pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ InitContainers described here modify an operator generated init containers if they share the same name and modifications are done via a strategic merge patch.

The names of init container name managed by the operator are: * init-config-reloader.

Overriding init containers is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice.

§min_ready_seconds: Option<i32>

Minimum number of seconds for which a newly created Pod should be ready without any of its container crashing for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)

§host_aliases: Option<Vec<HostAlias>>

Optional list of hosts and IPs that will be injected into the Pod’s hosts file if specified.

§host_network: Option<bool>

Use the host’s network namespace if true.

Make sure to understand the security implications if you want to enable it (https://kubernetes.io/docs/concepts/configuration/overview/).

When hostNetwork is enabled, this will set the DNS policy to ClusterFirstWithHostNet automatically.

§ip_family: IpFamily

IP family for bind addresses. Defaults to IPv4.

  • ipv4: Uses 0.0.0.0 for bind addresses (default)
  • ipv6: Uses [::] for bind addresses
§runtime_class_name: Option<String>

RuntimeClassName refers to a RuntimeClass object in the node.k8s.io API group, which should be used to run the pods in this Kanidm cluster. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the “legacy” RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://kubernetes.io/docs/concepts/containers/runtime-class/

§automount_service_account_token: Option<bool>

AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. If not specified, defaults to true (the token is mounted). Setting this to false is recommended for security-sensitive applications. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/

§enable_service_links: bool

EnableServiceLinks indicates whether information about services should be injected into pod’s environment variables, matching the syntax of Docker links. Defaults to false for security reasons (prevents service environment variable injection). Set to true only if you need Kubernetes to inject service information as environment variables. More info: https://kubernetes.io/docs/concepts/services-networking/service/#environment-variables

§host_users: Option<bool>

HostUsers controls how the user namespace is configured for the pod. If set to true, the pod will use the host’s user namespace. If set to false or not specified, the pod will use a user namespace configured by the runtime. This feature requires support in the container runtime and Kubernetes 1.27+. More info: https://kubernetes.io/docs/concepts/workloads/pods/user-namespaces/

§domain_appearance: Option<DomainAppearanceSpec>

Domain appearance customization settings. Allows customizing the display name and site image (logo) shown on the Kanidm signin page.

§mail_sender: Option<MailSenderSpec>

Mail sender configuration for sending emails (password reset links, notifications). When enabled, the operator automatically creates a service account in Kanidm’s idm_message_senders group, generates an API token, and deploys the kanidm-mail-sender component.

Trait Implementations§

Source§

impl Clone for KanidmSpec

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for KanidmSpec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for KanidmSpec

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for KanidmSpec

Source§

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 JsonSchema for KanidmSpec

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

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

Generates a JSON Schema for this type. Read more
Source§

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 more
Source§

impl Serialize for KanidmSpec

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ServiceExt for T

Source§

fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>
where Self: Sized,

Apply a transformation to the response body. Read more
Source§

fn decompression(self) -> Decompression<Self>
where Self: Sized,

Decompress response bodies. Read more
Source§

fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using HTTP status codes. Read more
Source§

fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using gRPC headers. Read more
Source§

fn follow_redirects(self) -> FollowRedirect<Self>
where Self: Sized,

Follow redirect resposes using the Standard policy. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more