Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ All notable changes to this project will be documented in this file.
### Added

- Made RSA key length configurable for certificates issued by cert-manager ([#528]).

### Changed

- Append a dot (`.`) to the default cluster domain to reduce DNS requests ([#543]).
- Kerberos principal backends now also provision principals for IP address, not just DNS hostnames ([#552]).

### Fixed

Expand All @@ -26,8 +23,8 @@ All notable changes to this project will be documented in this file.

[#528]: https://github.com/stackabletech/secret-operator/pull/528
[#536]: https://github.com/stackabletech/secret-operator/pull/536
[#543]: https://github.com/stackabletech/secret-operator/pull/543
[#548]: https://github.com/stackabletech/secret-operator/pull/548
[#552]: https://github.com/stackabletech/secret-operator/pull/552

## [24.11.0] - 2024-11-18

Expand Down
19 changes: 12 additions & 7 deletions rust/operator-binary/src/backend/kerberos_keytab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,18 @@ cluster.local = {realm_name}
scope: scope.clone(),
})?
{
if let Address::Dns(hostname) = addr {
pod_principals.push(
format!("{service_name}/{hostname}")
.try_into()
.context(PodPrincipalSnafu)?,
);
}
pod_principals.push(
match addr {
Address::Dns(hostname) => {
format!("{service_name}/{hostname}")
}
Address::Ip(ip) => {
format!("{service_name}/{ip}")
}
}
.try_into()
.context(PodPrincipalSnafu)?,
);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions tests/templates/kuttl/kerberos/01-install-kdc.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: envsubst '$NAMESPACE' < secretclass.yaml | kubectl apply -f -
- script: envsubst '$NAMESPACE' < listenerclass.yaml | kubectl apply -f -
---
apiVersion: apps/v1
kind: StatefulSet
Expand Down
24 changes: 23 additions & 1 deletion tests/templates/kuttl/kerberos/kinit-client.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ spec:
klist -k /stackable/krb/keytab -teKC
echo kiniting node
kinit -kt /stackable/krb/keytab -p HTTP/$NODE_NAME
echo kiniting node ip
NODE_IP="$(cat /stackable/listener/nodeport-ip/default-address/address)"
echo node ip is "$NODE_IP"
kinit -kt /stackable/krb/keytab -p "HTTP/$NODE_IP"
echo kiniting service
kinit -kt /stackable/krb/keytab -p HTTP/krb5-client.$NAMESPACE.svc.cluster.local
echo kiniting pod
Expand All @@ -39,21 +43,39 @@ spec:
volumeMounts:
- mountPath: /stackable/krb
name: kerberos
- mountPath: /stackable/listener/nodeport-ip
name: listener-nodeport-ip
ports:
- name: dummy
containerPort: 9999
volumes:
- name: kerberos
ephemeral:
volumeClaimTemplate:
metadata:
annotations:
secrets.stackable.tech/class: kerberos-$NAMESPACE
secrets.stackable.tech/scope: node,pod
secrets.stackable.tech/scope: node,pod,listener-volume=listener-nodeport-ip
spec:
storageClassName: secrets.stackable.tech
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "1"
- name: listener-nodeport-ip
ephemeral:
volumeClaimTemplate:
metadata:
annotations:
listeners.stackable.tech/listener-class: nodeport-ip-$NAMESPACE
spec:
storageClassName: listeners.stackable.tech
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "1"
restartPolicy: Never
terminationGracePeriodSeconds: 0
subdomain: krb5-client
9 changes: 9 additions & 0 deletions tests/templates/kuttl/kerberos/listenerclass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# $NAMESPACE will be replaced with the namespace of the test case.
---
apiVersion: listeners.stackable.tech/v1alpha1
kind: ListenerClass
metadata:
name: nodeport-ip-$NAMESPACE
spec:
serviceType: NodePort
preferredAddressType: IP
Loading