Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.8k 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 Answer

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...