filebeate configmap自定义

Posted malukang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了filebeate configmap自定义相关的知识,希望对你有一定的参考价值。

样例:

apiVersion: v1
kind: ConfigMap
metadata:
  name: appjobs-filebeat-config
  namespace: dev
data:
  filebeat.yml: |
    logging.level: warning
    filebeat.inputs:
    - type: log
    
      paths:
        - "/logs/*"

      multiline.pattern: ^s*(d{4}|d{2})-(d{2}|[a-zA-Z]{3})-(d{2}|d{4})
      multiline.negate: true
      multiline.match: after

      fields:
        k8s-app: log-contanier-file-filebeat
    output.elasticsearch:
      hosts: ["elasticsearch-logging.logging:9200"]
      indices:
        - index: "appjobs-log-%{+YYYY.MM.dd}"
          default: true

---
kind: Service
apiVersion: v1
metadata:
  namespace: dev
  name: service-appjobs
  labels:
    app: service-appjobs
spec:
  ports:
    - port: 8080
      targetPort: 8080
  selector:
    app: pod-appjobs
  type: ClusterIP

---
kind: Deployment
apiVersion: apps/v1beta2
metadata:
  namespace: dev
  name: deployment-appjobs
  labels:
    app: deployment-appjobs
spec:
  replicas: 1
  selector:
    matchLabels:
      app: pod-appjobs
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: pod-appjobs
    spec:
      containers:
      - name: filebeat-logging
        image: registry-vpc.cn-shanghai.aliyuncs.com/ilebeat:6.3.2
        volumeMounts:
        - name: app-logs
          mountPath: /logs
        - name: appjobs-filebeat-config
          mountPath: /usr/local/filebeat/config
      - image: registry-vpc.cn-shanghai.aliyuncs.com/appjobs-boot:25fa7c5 
        securityContext:
          privileged: true
        imagePullPolicy: Always
        name: container-appjobs
        ports:

        - containerPort: 8080
        volumeMounts:
        - name: app-logs
          mountPath: /appjobs/logs
        readinessProbe:
          tcpSocket:
            port: 8080
          initialDelaySeconds: 10
          periodSeconds: 5
        
        livenessProbe:
          tcpSocket:
            port: 8080
          initialDelaySeconds: 120
          periodSeconds: 10
        
      volumes:
      - name: app-logs
        emptyDir: {}
      - name: appjobs-filebeat-config
        configMap:
          name: appjobs-filebeat-config

      imagePullSecrets:
      - name: dev-pullimages-secret
    
      dnsPolicy: ClusterFirst
      restartPolicy: Always

 

以上是关于filebeate configmap自定义的主要内容,如果未能解决你的问题,请参考以下文章

kubernetes configMap详解

configMap和secret

configMap和secret

九,configMap及secret的基本使用

Android 自定义View 多片叶子叶子旋转滑动

怎么自定义android 下拉刷新动画