簡體   English   中英

掌舵在Amazon EKS上安裝Fluentd-Cloudwatch

[英]Helm to install Fluentd-Cloudwatch on Amazon EKS

在亞馬遜EKS上嘗試使用helm安裝“孵化器/流利雲計划”,並將用戶設置為root時,我的響應低於響應。

使用的命令:

helm install --name fluentd incubator/fluentd-cloudwatch --set awsRegion=eu-west-1,rbac.create=true --set extraVars[0]="{ name: FLUENT_UID, value: '0' }"

錯誤:

Error: YAML parse error on fluentd-cloudwatch/templates/daemonset.yaml: error converting YAML to JSON: yaml: line 38: did not find expected ',' or ']'

如果我們不將用戶設置為root,則默認情況下,fluentd以“fluent”用戶運行,其日志顯示:

[error]: unexpected error error_class=Errno::EACCES error=#<Errno::
EACCES: Permission denied @ rb_sysopen - /var/log/fluentd-containers.log.pos>`

基於看起來它只是試圖將eu-west-1,rbac.create=true轉換為JSON字段作為字段,並且有一個額外的逗號(,)導致它失敗。

如果你看看values.yaml,你會看到正確的單獨選項是awsRegionrbac.create所以--set awsRegion=eu-west-1 --set rbac.create=true應該修復第一個錯誤。

關於/var/log/... Permission denied錯誤,你可以在這里看到它作為hostPath掛載,所以如果你這樣做:

# (means read/write user/group/world)
$ sudo chmod 444 /var/log 

和你的所有節點,錯誤應該消失。 請注意,您需要將其添加到所有節點,因為您的pod可以位於群集中的任何位置。

下載並更新values.yaml,如下所示。 更改位於awsRegion,rbac.create = true和extraVars字段中。

annotations: {}

awsRegion: us-east-1
awsRole:
awsAccessKeyId:
awsSecretAccessKey:
logGroupName: kubernetes

rbac:
## If true, create and use RBAC resources
create: true

## Ignored if rbac.create is true
serviceAccountName: default
# Add extra environment variables if specified (must be specified as a single line 
object and be quoted)
extraVars:
- "{ name: FLUENT_UID, value: '0' }"

然后運行以下命令在Kubernetes集群上設置流利的日志以將日志發送到CloudWatch Logs。

$ helm install --name fluentd -f .\fluentd-cloudwatch-values.yaml incubator/fluentd-cloudwatch

我這樣做了,它對我有用。 日志已發送到CloudWatch Logs。 還要確保您的ec2節點具有IAM角色,並具有適用於CloudWatch Logs的權限。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM