Skip to content

Commit 6d33001

Browse files
committed
Add list-op CRD summary docs
1 parent f11e635 commit 6d33001

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

src/commons/listener.rs

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
11
//! This modules provides resource types used to interact with [listener-operator](https://docs.stackable.tech/listener-operator/stable/index.html)
2+
//!
3+
//! # Custom Resources
4+
//!
5+
//! ## [`Listener`]
6+
//!
7+
//! Exposes a set of pods, either internally to the cluster or to the outside world. The mechanism for how it is exposed
8+
//! is managed by the [`ListenerClass`].
9+
//!
10+
//! It can be either created manually by the application administrator (for applications that expose a single load-balanced endpoint),
11+
//! or automatically when mounting a [listener volume](`ListenerOperatorVolumeSourceBuilder`) (for applications that expose a separate endpoint
12+
//! per replica).
13+
//!
14+
//! All exposed pods *must* have a mounted [listener volume](`ListenerOperatorVolumeSourceBuilder`), regardless of whether the [`Listener`] is created automatically.
15+
//!
16+
//! ## [`ListenerClass`]
17+
//!
18+
//! Declares a policy for how [`Listener`]s are exposed to users.
19+
//!
20+
//! It is created by the cluster administrator.
21+
//!
22+
//! ## [`PodListeners`]
23+
//!
24+
//! Informs users and other operators about the state of all [`Listener`]s associated with a [`Pod`].
25+
//!
26+
//! It is created by the Stackable Secret Operator, and always named `pod-{pod.metadata.uid}`.
227
328
use std::collections::BTreeMap;
429

@@ -11,6 +36,9 @@ use k8s_openapi::api::core::v1::{
1136
Node, PersistentVolume, PersistentVolumeClaim, Pod, Service, Volume,
1237
};
1338

39+
#[cfg(doc)]
40+
use crate::builder::ListenerOperatorVolumeSourceBuilder;
41+
1442
/// Defines a policy for how [`Listener`]s should be exposed.
1543
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema)]
1644
#[kube(
@@ -39,7 +67,7 @@ pub enum ServiceType {
3967

4068
/// Exposes a set of pods to the outside world.
4169
///
42-
/// Essentially a Stackable extension of a Kubernetes [`Service`]. Compared to [`Service`], [`Listener`] changes two things:
70+
/// Essentially a Stackable extension of a Kubernetes [`Service`]. Compared to [`Service`], [`Listener`] changes three things:
4371
/// 1. It uses a cluster-level policy object ([`ListenerClass`]) to define how exactly the exposure works
4472
/// 2. It has a consistent API for reading back the exposed address(es) of the service
4573
/// 3. The [`Pod`] must mount a [`Volume`] referring to the `Listener`, which also allows us to control stickiness
@@ -119,10 +147,11 @@ pub enum AddressType {
119147
Ip,
120148
}
121149

122-
/// Informs users about [`Listener`] objects that are bound by a given [`Pod`].
150+
/// Informs users about [`Listener`]s that are bound by a given [`Pod`].
123151
///
124152
/// This is not expected to be created or modified by users. It will be created by
125-
/// the Stackable Listener Operator when mounting the listener volume.
153+
/// the Stackable Listener Operator when mounting the listener volume, and is always.
154+
/// named `pod-{pod.metadata.uid}`.
126155
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
127156
#[kube(
128157
group = "listeners.stackable.tech",

0 commit comments

Comments
 (0)