pub struct RndcSecretRef {
pub name: String,
pub algorithm: RndcAlgorithm,
pub key_name_key: String,
pub secret_key: String,
}Expand description
Reference to a Kubernetes Secret containing RNDC/TSIG credentials.
This allows you to use an existing external Secret for RNDC authentication instead
of having the operator auto-generate one. The Secret is mounted as a directory at
/etc/bind/keys/ in the BIND9 container, and BIND9 uses the rndc.key file.
§External (User-Managed) Secrets
For external secrets, you ONLY need to provide the rndc.key field containing
the complete BIND9 key file content. The other fields (key-name, algorithm,
secret) are optional metadata used by operator-generated secrets.
§Minimal External Secret Example
apiVersion: v1
kind: Secret
metadata:
name: my-rndc-key
namespace: dns-system
type: Opaque
stringData:
rndc.key: |
key "bindy-operator" {
algorithm hmac-sha256;
secret "base64EncodedSecretKeyMaterial==";
};§Auto-Generated (Operator-Managed) Secrets
When the operator auto-generates a Secret (no rndcSecretRef specified), it
creates a Secret with all 4 fields for internal metadata tracking:
apiVersion: v1
kind: Secret
metadata:
name: bind9-instance-rndc
namespace: dns-system
type: Opaque
stringData:
key-name: "bindy-operator" # Operator metadata
algorithm: "hmac-sha256" # Operator metadata
secret: "randomBase64Key==" # Operator metadata
rndc.key: | # Used by BIND9
key "bindy-operator" {
algorithm hmac-sha256;
secret "randomBase64Key==";
};§Using with Bind9Instance
apiVersion: bindy.firestoned.io/v1beta1
kind: Bind9Instance
metadata:
name: production-dns-primary-0
spec:
clusterRef: production-dns
role: primary
rndcSecretRef:
name: my-rndc-key
algorithm: hmac-sha256§How It Works
When the Secret is mounted at /etc/bind/keys/, Kubernetes creates individual
files for each Secret key:
/etc/bind/keys/rndc.key(the BIND9 key file) ← This is what BIND9 uses/etc/bind/keys/key-name(optional metadata for operator-generated secrets)/etc/bind/keys/algorithm(optional metadata for operator-generated secrets)/etc/bind/keys/secret(optional metadata for operator-generated secrets)
The rndc.conf file includes /etc/bind/keys/rndc.key, so BIND9 only needs
that one file to exist
Fields§
§name: StringName of the Kubernetes Secret containing RNDC credentials
algorithm: RndcAlgorithmHMAC algorithm for this key
key_name_key: StringKey within the secret for the key name (default: “key-name”)
secret_key: StringKey within the secret for the secret value (default: “secret”)
Trait Implementations§
Source§impl Clone for RndcSecretRef
impl Clone for RndcSecretRef
Source§fn clone(&self) -> RndcSecretRef
fn clone(&self) -> RndcSecretRef
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RndcSecretRef
impl Debug for RndcSecretRef
Source§impl<'de> Deserialize<'de> for RndcSecretRef
impl<'de> Deserialize<'de> for RndcSecretRef
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 RndcSecretRef
impl JsonSchema for RndcSecretRef
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 moreAuto Trait Implementations§
impl Freeze for RndcSecretRef
impl RefUnwindSafe for RndcSecretRef
impl Send for RndcSecretRef
impl Sync for RndcSecretRef
impl Unpin for RndcSecretRef
impl UnwindSafe for RndcSecretRef
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