pub struct PrimaryConfig {
pub replicas: Option<i32>,
pub labels: Option<BTreeMap<String, String>>,
pub service: Option<ServiceConfig>,
pub allow_transfer: Option<Vec<String>>,
pub rndc_secret_ref: Option<RndcSecretRef>,
pub rndc_key: Option<RndcKeyConfig>,
}Expand description
Primary instance configuration
Groups all configuration specific to primary (authoritative) DNS instances.
Fields§
§replicas: Option<i32>Number of primary instance replicas (default: 1)
This controls how many replicas each primary instance in this cluster should have. Can be overridden at the instance level.
labels: Option<BTreeMap<String, String>>Additional labels to apply to primary Bind9Instance resources
These labels are propagated from the cluster/provider to all primary instances. They are merged with standard labels (app.kubernetes.io/*) and can be used for:
- Instance selection via
DNSZone.spec.bind9InstancesFromlabel selectors - Pod selectors in network policies
- Monitoring and alerting label filters
- Custom organizational taxonomy
Example:
primary:
labels:
environment: production
tier: frontend
region: us-east-1These labels will appear on the Bind9Instance metadata and can be referenced
by DNSZone resources using bind9InstancesFrom.selector.matchLabels.
service: Option<ServiceConfig>Custom Kubernetes Service configuration for primary instances
Allows full customization of the Kubernetes Service created for primary DNS servers, including both Service spec fields and metadata annotations.
Annotations are commonly used for:
MetalLBaddress pool selection- Cloud provider load balancer configuration
- External DNS integration
- Linkerd service mesh annotations
Fields specified here are merged with defaults. Unspecified fields use safe defaults:
type: ClusterIP(if not specified)- Ports 53/TCP and 53/UDP (always set)
- Selector matching the instance labels (always set)
allow_transfer: Option<Vec<String>>Allow-transfer ACL for primary instances
Overrides the default auto-detected Pod CIDR allow-transfer configuration for all primary instances in this cluster. Use this to restrict or expand which IP addresses can perform zone transfers from primary servers.
If not specified, defaults to cluster Pod CIDRs (auto-detected from Kubernetes Nodes).
Examples:
["10.0.0.0/8"]- Allow transfers from entire 10.x network["any"]- Allow transfers from any IP (public internet)[]- Deny all zone transfers (empty list means “none”)
Can be overridden at the instance level via spec.config.allowTransfer.
rndc_secret_ref: Option<RndcSecretRef>rndc_key instead. This field will be removed in v1.0.0Reference to an existing Kubernetes Secret containing RNDC key for all primary instances.
If specified, all primary instances in this cluster will use this existing Secret instead of auto-generating individual secrets. This allows sharing the same RNDC key across all primary instances.
Can be overridden at the instance level via spec.rndcSecretRef.
rndc_key: Option<RndcKeyConfig>RNDC key configuration for all primary instances with lifecycle management.
Supports automatic key rotation, Secret references, and inline Secret specifications. Overrides global RNDC configuration for primary instances.
Precedence order:
- Instance level (
spec.rndcKey) - Role level (
spec.primary.rndcKeyorspec.secondary.rndcKey) - Global level (cluster-wide RNDC configuration)
- Auto-generated (default)
Can be overridden at the instance level via spec.rndcKey.
Backward compatibility: If both rndc_key and rndc_secret_ref are specified,
rndc_key takes precedence. For smooth migration, rndc_secret_ref will continue
to work but is deprecated.
§Example
primary:
replicas: 1
rndcKey:
autoRotate: true
rotateAfter: 720h # 30 days
algorithm: hmac-sha256Trait Implementations§
Source§impl Clone for PrimaryConfig
impl Clone for PrimaryConfig
Source§fn clone(&self) -> PrimaryConfig
fn clone(&self) -> PrimaryConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PrimaryConfig
impl Debug for PrimaryConfig
Source§impl Default for PrimaryConfig
impl Default for PrimaryConfig
Source§fn default() -> PrimaryConfig
fn default() -> PrimaryConfig
Source§impl<'de> Deserialize<'de> for PrimaryConfig
impl<'de> Deserialize<'de> for PrimaryConfig
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>,
Source§impl JsonSchema for PrimaryConfig
impl JsonSchema for PrimaryConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for PrimaryConfig
impl PartialEq for PrimaryConfig
Source§impl Serialize for PrimaryConfig
impl Serialize for PrimaryConfig
impl StructuralPartialEq for PrimaryConfig
Auto Trait Implementations§
impl Freeze for PrimaryConfig
impl RefUnwindSafe for PrimaryConfig
impl Send for PrimaryConfig
impl Sync for PrimaryConfig
impl Unpin for PrimaryConfig
impl UnwindSafe for PrimaryConfig
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].