Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support non-default cluster domain #591

Merged
merged 12 commits into from
Oct 23, 2024
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Added

- The operator can now run on Kubernetes clusters using a non-default cluster domain. It should automatically detect the
correct domain to use, but you can also use the env var `KUBERNETES_CLUSTER_DOMAIN` to set the domain explicitly
or use the helm-chart property `kubernetesClusterDomain` ([#591]).

### Changed

- Reduce CRD size from `1.4MB` to `136KB` by accepting arbitrary YAML input instead of the underlying schema for the following fields ([#574]):
- `podOverrides`
- `affinity`

[#574]: https://github.com/stackabletech/hdfs-operator/pull/574
[#591]: https://github.com/stackabletech/hdfs-operator/pull/591

## [24.7.0] - 2024-07-24

Expand Down
46 changes: 30 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yaml = "0.9"
snafu = "0.8"
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.76.0" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.79.0" }
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" }
strum = { version = "0.26", features = ["derive"] }
tokio = { version = "1.40", features = ["full"] }
Expand Down
5 changes: 5 additions & 0 deletions deploy/helm/hdfs-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@ nodeSelector: {}
tolerations: []

affinity: {}

# When running on a non-default Kubernetes cluster domain and the auto detections is not working correctly,
sbernauer marked this conversation as resolved.
Show resolved Hide resolved
# you can set your custom cluster domain here.
# See the https://docs.stackable.tech/home/stable/guides/kubernetes-cluster-domain guide for details
# kubernetesClusterDomain: my-cluster.local
15 changes: 9 additions & 6 deletions rust/crd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ use stackable_operator::{
},
},
config::{
fragment,
fragment::{Fragment, ValidationError},
fragment::{self, Fragment, ValidationError},
merge::Merge,
},
k8s_openapi::{
Expand All @@ -34,12 +33,15 @@ use stackable_operator::{
kube::{runtime::reflector::ObjectRef, CustomResource, ResourceExt},
kvp::{LabelError, Labels},
product_config_utils::{Configuration, Error as ConfigError},
product_logging,
product_logging::spec::{ContainerLogConfig, Logging},
product_logging::{
self,
spec::{ContainerLogConfig, Logging},
},
role_utils::{GenericRoleConfig, Role, RoleGroup, RoleGroupRef},
schemars::{self, JsonSchema},
status::condition::{ClusterCondition, HasStatusCondition},
time::Duration,
utils::cluster_domain::KUBERNETES_CLUSTER_DOMAIN,
};
use strum::{Display, EnumIter, EnumString, IntoStaticStr};

Expand Down Expand Up @@ -985,8 +987,9 @@ impl HdfsPodRef {
self.fqdn_override.as_deref().map_or_else(
|| {
Cow::Owned(format!(
"{}.{}.{}.svc.cluster.local",
self.pod_name, self.role_group_service_name, self.namespace
"{}.{}.{}.svc.{}",
self.pod_name, self.role_group_service_name, self.namespace,
KUBERNETES_CLUSTER_DOMAIN.get().expect("KUBERNETES_CLUSTER_DOMAIN must first be set by calling initialize_operator"),
))
},
Cow::Borrowed,
Expand Down
Loading
Loading