Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.2k views
in Technique[技术] by (71.8m points)

Using filebeats in Kubernetes how do I mount my own module as a configmap?

I am using this official helm chart for filebeat:

https://artifacthub.io/packages/helm/elastic/filebeat

I have my own filebeat module on my system like:

- module
 - _meta
   - fields.yaml
 - error_logs
   - config
     -log.yaml

This is not the exact structure. Just giving you an idea of the nested nature of it.

Now how do I mount this onto filebeats as a configmap?

I tried just doing:

kubectl create configmap filebeats-module --from-file filebeats-module/

but the resulting configmap doesn't look right:

apiVersion: v1
data:
  module.yml: |+
    dashboards:

kind: ConfigMap
metadata:
  creationTimestamp: "2021-01-12T15:56:13Z"
  managedFields:
  - apiVersion: v1
    fieldsType: FieldsV1
    fieldsV1:
      f:data:
        .: {}
        f:module.yml: {}
    manager: kubectl-create
    operation: Update
    time: "2021-01-12T15:56:13Z"
  name: filebeats-module
  namespace: logging
  resourceVersion: "10611775"
  selfLink: /api/v1/namespaces/logging/configmaps/filebeats-module
  uid: 8a6e9309-b34d-4399-8386-ad02a5f25fa3

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...