You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the fluent-operator to deploy fluentdbit to collect logs and fluentd to process and send to an OpenSearch domain with advanced security configuration.
It works with open domains, but not with secured ones.
I noticed the Operator creates a Service Account for Fluentbit and Fluentd by default. I then proceeded to attach an IAM Role for Service Account(IRSA) to Fluentd's Service Account with the following inlinePolicy:
But the Fluentd pod still can't communicate with the specified domain:
The client is unable to verify distribution due to security privileges on the server side. Some functionality may not be compatible if the server is running an unsupported product.
2023-03-15 09:27:50 +0000 [warn]: #0 [ClusterFluentdConfig-cluster-fluentd-config::cluster::clusteroutput::fluentd-output-opensearch-0] Could not communicate to OpenSearch, resetting connection and trying again. [401]
2023-03-15 09:27:50 +0000 [warn]: #0 [ClusterFluentdConfig-cluster-fluentd-config::cluster::clusteroutput::fluentd-output-opensearch-0] Remaining retry: 14. Retry to communicate after 2 second(s).
2023-03-15 09:27:54 +0000 [warn]: #0 [ClusterFluentdConfig-cluster-fluentd-config::cluster::clusteroutput::fluentd-output-opensearch-0] Could not communicate to OpenSearch, resetting connection and trying again. [401]
After applying the IRSA, its irsa-operator generates the equivalent role in AWS with the correct inlinePolicy and even mentions the OpenSearch Service as "Allowed Services". It also correctly attaches the IRSA to the fluentd service account in the EKS cluster.
I've also used the IAM Policy Simulator, which seems to indicate my role/policy is correct:
I'm starting to wonder if it's possible at all to use IRSA to give fluentd access to a secured OpenSearch domain...
Is it an unavoidable limitation? Has anyone ever used the fluent-operator in a fluentbit-fluentd mode with fluentd using IRSA to connect to AWS OpenSearch?
To Reproduce
Provision an OpenSearch domain with advanced security options using this Terraform provider.
apiVersion: fluentd.fluent.io/v1alpha1
kind: Fluentd
metadata:
name: fluentd
namespace: fluent-system
labels:
app.kubernetes.io/name: fluentd
spec:
globalInputs:
- forward:
bind: 0.0.0.0
port: 24224
replicas: 1
image: kubesphere/fluentd:v1.15.3
resources:
limits:
cpu: 500m
memory: 500Mi
requests:
cpu: 100m
memory: 128Mi
fluentdCfgSelector:
matchLabels:
config.fluentd.fluent.io/enabled: "true"
---
apiVersion: fluentd.fluent.io/v1alpha1
kind: ClusterFluentdConfig
metadata:
labels:
config.fluentd.fluent.io/enabled: "true"
name: fluentd-config
spec:
clusterFilterSelector:
matchLabels:
filter.fluentd.fluent.io/enabled: "true"
clusterOutputSelector:
matchLabels:
output.fluentd.fluent.io/enabled: "true"
watchedNamespaces: # find an easier way to do this or open an issue
- kube-system
- fluent-system
- default
---
apiVersion: fluentd.fluent.io/v1alpha1
kind: ClusterOutput
metadata:
labels:
output.fluentd.fluent.io/enabled: "true"
name: fluentd-output-opensearch
spec:
outputs:
- opensearch:
host: vpc-XXX-us-XXX-XXXX-XXXX.us-XXX-XXX.es.amazonaws.com
logstashFormat: true
logstashPrefix: logs
port: 443
scheme: https
logLevel: debug # change to info after OpenSearchErrorHandler is fixed
The text was updated successfully, but these errors were encountered:
kaiohenricunha
changed the title
[fluent-operator] Fluentd access to secured OpenSearch domain using IRSA
[fluent-operator] Fluentd access to secured OpenSearch domain using IAM
Mar 20, 2023
Describe the issue
I'm using the fluent-operator to deploy fluentdbit to collect logs and fluentd to process and send to an OpenSearch domain with advanced security configuration.
It works with open domains, but not with secured ones.
I noticed the Operator creates a Service Account for Fluentbit and Fluentd by default. I then proceeded to attach an IAM Role for Service Account(IRSA) to Fluentd's Service Account with the following
inlinePolicy
:But the Fluentd pod still can't communicate with the specified domain:
After applying the IRSA, its irsa-operator generates the equivalent role in AWS with the correct inlinePolicy and even mentions the OpenSearch Service as "Allowed Services". It also correctly attaches the IRSA to the fluentd service account in the EKS cluster.
I've also used the IAM Policy Simulator, which seems to indicate my role/policy is correct:
I'm starting to wonder if it's possible at all to use IRSA to give fluentd access to a secured OpenSearch domain...
I noticed that fluentbit output plugin for opensearch has some parameters to deal with authentication and IAM roles, but fluentd's doesn't.
Is it an unavoidable limitation? Has anyone ever used the fluent-operator in a fluentbit-fluentd mode with fluentd using IRSA to connect to AWS OpenSearch?
To Reproduce
I used the following inputs:
How did you install fluent operator?
section below.Expected behavior
Your Environment
How did you install fluent operator?
I installed the operator via helm chart with fluentbit and fluentd disabled:
My custom values.yaml had the following configuration:
I then, applied fluentbit and fluentd manifests manually:
The text was updated successfully, but these errors were encountered: