Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.
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
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,15 @@ The name of the node from which the plugin should collect metrics. This enables

Array of the nodes from which the this plugin should collect metrics. This enables the plugin to fetch metrics from kubeapiserver. Used only when use_rest_client configuration parameter is not enabled.

### kubelet_address (string) (optional)

The hostname or IP address that kubelet will use to connect to. If not supplied, status.hostIP of the node is used to fetch metrics from the Kubelet API (via the $KUBERNETES_NODE_IP environment variable).

Default value: `"#{ENV['KUBERNETES_NODE_IP']}"`.

### kubelet_port (integer) (optional)

The port that kubelet is listening to.
The port that kubelet is listening on.

Default value: `10250`.

Expand Down
5 changes: 4 additions & 1 deletion lib/fluent/plugin/in_kubernetes_metrics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ class KubernetesMetricsInput < Fluent::Plugin::Input
desc 'Name of the nodes that this plugin should collect metrics from.'
config_param :node_names, :array, default: [], value_type: :string

desc 'The hostname or IP address that kubelet will use to connect to. If not supplied, status.hostIP of the node is used to fetch metrics from the Kubelet API (via the $KUBERNETES_NODE_IP environment variable)'
config_param :kubelet_address, :string, default: "#{ENV['KUBERNETES_NODE_IP']}"

desc 'The port that kubelet is listening to.'
config_param :kubelet_port, :integer, default: 10_250

Expand Down Expand Up @@ -193,7 +196,7 @@ def initialize_client
end

def initialize_rest_client
env_host = @node_name
env_host = @kubelet_address
env_port = @kubelet_port

if env_host && env_port
Expand Down