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

Listener support/external access #450

Merged
merged 34 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9634d61
Remove pod svc controller
sbernauer Apr 25, 2023
5b74ac9
Add listener volume
sbernauer Apr 25, 2023
5432701
Dont deploy rolegroup Service
sbernauer Apr 25, 2023
d41a0c3
Deploy rolegroup services again, namenode/journalnode listeners
nightkr Dec 4, 2023
9cb6ad5
Advertise as pod address
nightkr Dec 11, 2023
e65207b
Run manual tests against 3.3.4, fix børked registration keys
nightkr Dec 21, 2023
9d3e541
Use listener addresses to generate discovery
nightkr Jan 4, 2024
2cb5c79
Merge branch 'main' into feat/listener
nightkr Jan 4, 2024
c1e0fae
Fix datanode port for HTTPS
nightkr Jan 4, 2024
2cd93ad
Use configured listenerclasses
nightkr Jan 8, 2024
a223e6e
Move listenerclass into role config
nightkr Jan 11, 2024
bfa4035
Remove useless journalnode listenerclass option
nightkr Jan 12, 2024
29f1290
Docs
nightkr Jan 12, 2024
e37b364
Changelog
nightkr Jan 12, 2024
668ffc6
Disabled start of test
nightkr Jan 15, 2024
010a6ea
Update CRD
nightkr Jan 15, 2024
14d0b1b
Remove reference to custom image
nightkr Jan 15, 2024
416c1fa
Document namenode_listener_refs
nightkr Jan 15, 2024
bff35cd
Break out the listener volume name to a constant
nightkr Jan 15, 2024
a2482e3
Merge branch 'main' into feat/listener
nightkr Jan 15, 2024
2d11d59
Update tests/templates/kuttl/external-access/operate-on-cluster.sh
nightkr Jan 15, 2024
aadaa7c
Avoid cloning FQDN override path
nightkr Jan 15, 2024
99345c6
Merge branch 'feat/listener' of github.com:stackabletech/hdfs-operato…
nightkr Jan 15, 2024
ef80833
Use the port name constants we already have
nightkr Jan 16, 2024
fa5fe56
Re-remove redundant role argument from ContainerConfig::volumes
nightkr Jan 16, 2024
351aea6
Bounds-check port number
nightkr Jan 16, 2024
86f42a0
Separate data volumes from listener volume
nightkr Jan 16, 2024
f4144ec
Add a comment on discovery ordering
nightkr Jan 16, 2024
ed6b229
Remove stale TODO
nightkr Jan 16, 2024
467f752
bash != fish
nightkr Jan 16, 2024
3169a4f
Break other volumes out of `container_log_config`
nightkr Jan 19, 2024
cb2dab3
Merge branch 'main' into feat/listener
nightkr Jan 23, 2024
1898601
Update docs/modules/hdfs/pages/usage-guide/listenerclass.adoc
nightkr Jan 23, 2024
86a3229
Drop external access test limit range
nightkr Jan 23, 2024
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ All notable changes to this project will be documented in this file.
### Added

- More CRD documentation ([#433]).
- Support for exposing HDFS clusters to clients outside of Kubernetes ([#450]).

### Changed

- `operator-rs` `0.56.1` -> `0.57.0` ([#433]).
- [BREAKING] `.spec.clusterConfig.listenerClass` has been renamed to `.spec.nameNodes.config.listenerClass`, migration will be required when using `external-unstable` ([#450]).
- Change default value of `dfs.ha.nn.not-become-active-in-safemode` from `true` to `false` ([#458]).

### Fixed
Expand All @@ -19,6 +21,7 @@ All notable changes to this project will be documented in this file.
and `dfs.datanode.kerberos.principal` in the discovery ConfigMap in case Kerberos is enabled ([#451]).

[#433]: https://github.com/stackabletech/hdfs-operator/pull/433
[#450]: https://github.com/stackabletech/hdfs-operator/pull/450
[#451]: https://github.com/stackabletech/hdfs-operator/pull/451
[#458]: https://github.com/stackabletech/hdfs-operator/pull/458

Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

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

30 changes: 16 additions & 14 deletions deploy/helm/hdfs-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,6 @@ spec:
format: uint8
minimum: 0.0
type: integer
listenerClass:
default: cluster-internal
description: |-
This field controls which type of Service the Operator creates for this HdfsCluster:

* cluster-internal: Use a ClusterIP service

* external-unstable: Use a NodePort service

This is a temporary solution with the goal to keep yaml manifests forward compatible. In the future, this setting will control which [ListenerClass](https://docs.stackable.tech/home/nightly/listener-operator/listenerclass.html) will be used to expose the service, and ListenerClass names will stay the same, allowing for a non-breaking change.
enum:
- cluster-internal
- external-unstable
type: string
vectorAggregatorConfigMapName:
description: Name of the Vector aggregator [discovery ConfigMap](https://docs.stackable.tech/home/nightly/concepts/service_discovery). It must contain the key `ADDRESS` with the address of the Vector aggregator. Follow the [logging tutorial](https://docs.stackable.tech/home/nightly/tutorials/logging-vector-aggregator) to learn how to configure log aggregation with Vector.
nullable: true
Expand Down Expand Up @@ -585,6 +571,10 @@ spec:
description: Time period Pods have to gracefully shut down, e.g. `30m`, `1h` or `2d`. Consult the operator documentation for details.
nullable: true
type: string
listenerClass:
description: This field controls which [ListenerClass](https://docs.stackable.tech/home/nightly/listener-operator/listenerclass.html) is used to expose this rolegroup. DataNodes should have a direct ListenerClass, such as `cluster-internal` or `external-unstable`.
nullable: true
type: string
logging:
default:
enableVectorAgent: null
Expand Down Expand Up @@ -4093,6 +4083,10 @@ spec:
description: Time period Pods have to gracefully shut down, e.g. `30m`, `1h` or `2d`. Consult the operator documentation for details.
nullable: true
type: string
listenerClass:
description: This field controls which [ListenerClass](https://docs.stackable.tech/home/nightly/listener-operator/listenerclass.html) is used to expose this rolegroup. DataNodes should have a direct ListenerClass, such as `cluster-internal` or `external-unstable`.
nullable: true
type: string
logging:
default:
enableVectorAgent: null
Expand Down Expand Up @@ -14669,6 +14663,10 @@ spec:
description: Time period Pods have to gracefully shut down, e.g. `30m`, `1h` or `2d`. Consult the operator documentation for details.
nullable: true
type: string
listenerClass:
description: This field controls which [ListenerClass](https://docs.stackable.tech/home/nightly/listener-operator/listenerclass.html) is used to expose this rolegroup. NameNodes should have a stable ListenerClass, such as `cluster-internal` or `external-stable`.
nullable: true
type: string
logging:
default:
enableVectorAgent: null
Expand Down Expand Up @@ -18168,6 +18166,10 @@ spec:
description: Time period Pods have to gracefully shut down, e.g. `30m`, `1h` or `2d`. Consult the operator documentation for details.
nullable: true
type: string
listenerClass:
description: This field controls which [ListenerClass](https://docs.stackable.tech/home/nightly/listener-operator/listenerclass.html) is used to expose this rolegroup. NameNodes should have a stable ListenerClass, such as `cluster-internal` or `external-stable`.
nullable: true
type: string
logging:
default:
enableVectorAgent: null
Expand Down
6 changes: 6 additions & 0 deletions deploy/helm/hdfs-operator/templates/roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ rules:
- events
verbs:
- create
- apiGroups:
- listeners.stackable.tech
resources:
- listeners
verbs:
- get
- apiGroups:
- {{ include "operator.name" . }}.stackable.tech
resources:
Expand Down
7 changes: 5 additions & 2 deletions docs/modules/hdfs/examples/getting_started/hdfs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ metadata:
name: simple-hdfs
spec:
image:
productVersion: 3.3.6
productVersion: 3.3.4
clusterConfig:
zookeeperConfigMapName: simple-hdfs-znode
listenerClass: external-unstable
dfsReplication: 1
nameNodes:
config:
listenerClass: external-stable
roleGroups:
default:
replicas: 2
dataNodes:
config:
listenerClass: external-unstable
roleGroups:
default:
replicas: 1
Expand Down
17 changes: 10 additions & 7 deletions docs/modules/hdfs/pages/usage-guide/listenerclass.adoc
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
= Service exposition with ListenerClasses

The Operator deploys a service called `<name>-<role>-<rolegroup>` (where `<name>` is the name of the HdfsCluster, `<role>` is the role and `<rolegroup>` the name of the role group) through which the different HDFS processes can be accessed. Unlike many other Stackable Operators, the HDFS Operator does not deploy role-level Services.
The operator deploys a xref:listener-operator:listener.adoc[Listener] for each DataNode and NameNode pod. They both default to only being accessible from within the Kubernetes cluster, but this can be changed by setting `.spec.{data,name}Nodes.config.listenerClass`.

These services can have either the `cluster-internal` or `external-unstable` type. `external-stable` is not supported for HDFS at the moment. Read more about the types in the xref:concepts:service-exposition.adoc[service exposition] documentation at platform level.

This is how the listener class is configured:
The cluster can be configured to be accessible from outside of Kubernetes like this:

[source,yaml]
----
spec:
clusterConfig:
listenerClass: cluster-internal # <1>
dataNodes:
config:
listenerClass: external-unstable # <1>
nameNodes:
config:
listenerClass: external-stable # <2>
----
<1> The default `cluster-internal` setting.
<1> DataNode listeners should prioritize having a direct connection, to minimize network transfer overhead.
<2> NameNode listeners should prioritize having a stable address, since they will be baked into the client configuration.
1 change: 1 addition & 0 deletions rust/crd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ stackable-operator.workspace = true
product-config.workspace = true
strum.workspace = true
tracing.workspace = true
futures.workspace = true

[dev-dependencies]
serde_yaml.workspace = true
Expand Down
8 changes: 5 additions & 3 deletions rust/crd/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ pub const FIELD_MANAGER_SCOPE_POD: &str = "pod-service";

pub const APP_NAME: &str = "hdfs";

pub const LABEL_ENABLE: &str = "hdfs.stackable.tech/pod-service";
pub const LABEL_STS_POD_NAME: &str = "statefulset.kubernetes.io/pod-name";

pub const HDFS_SITE_XML: &str = "hdfs-site.xml";
pub const CORE_SITE_XML: &str = "core-site.xml";
pub const HADOOP_POLICY_XML: &str = "hadoop-policy.xml";
Expand All @@ -27,6 +24,8 @@ pub const SERVICE_PORT_NAME_HTTPS: &str = "https";
pub const SERVICE_PORT_NAME_DATA: &str = "data";
pub const SERVICE_PORT_NAME_METRICS: &str = "metrics";

pub const DEFAULT_LISTENER_CLASS: &str = "cluster-internal";

pub const DEFAULT_NAME_NODE_METRICS_PORT: u16 = 8183;
pub const DEFAULT_NAME_NODE_HTTP_PORT: u16 = 9870;
pub const DEFAULT_NAME_NODE_HTTPS_PORT: u16 = 9871;
Expand Down Expand Up @@ -77,4 +76,7 @@ pub const JOURNALNODE_ROOT_DATA_DIR: &str = "/stackable/data/journalnode";
pub const DATANODE_ROOT_DATA_DIR_PREFIX: &str = "/stackable/data/";
pub const DATANODE_ROOT_DATA_DIR_SUFFIX: &str = "/datanode";

pub const LISTENER_VOLUME_NAME: &str = "listener";
pub const LISTENER_VOLUME_DIR: &str = "/stackable/listener";

pub const HDFS_UID: i64 = 1000;
Loading