k8s
组件 资源清单
pod 生命周期
pod 控制器
服务发现
runcher
KubeSphere
Helm
helm命令
helm 常用内置对象
helm 内置函数
helm 的逻辑 和 流程控制
helm 中变量在作用域、列表、元祖、字典中的引用
helm 使用define定义子模版、template和include调用
helm 获取其他文件的内容和文件名
社区的Helm chart仓库
helm几个常用仓库
存储 configMap
进入k8s pod
k8s Node节点的调试
k8s 部署
sealos 部署
kubeadm 1.28部署
增加 node 节点
在aws 上自建k8s
利用NFS动态提供Kubernetes后端存储卷
rook-ceph
CephFS挂载
Ceph Dashboard
ingress
k8s集成kube-prometheus
ServiceMonitor 添加配置
Prometheus 长期远程存储方案 VictoriaMetrics
解决ControllerManager、Scheduler、watchdog监控问题
抓取配置说明
kubernetes配置imagePullSecrets秘钥来拉取镜像
在 Kubernetes 裡跑 curl 來測試內部服務
MetalLB
cloudflare-tunnel-ingress-controller
K8S kubectl 自动补全
argocd
helm部署redis-culster集群
改变默认 StorageClass
自定义指标HPA
istio
kiali
k8s接入graylog
Labels
DNS
HPA
ConfigMap挂载导致容器目录覆盖的问题
污点容忍度
身份认证与权限 RBAC
command
运行crictl ps -a 报错
etcd
cka证书
cert-manager
Kubernetes 创建普通账号
部署 metrics-server 指标
deployment 重启
Kubernetes中如何优雅的解决Pod时区问题
alertmanager
oom killed
eks挂载efs
eks创建集群
eksctl awscli kubectl
污点和容忍度
Kubernetes 删除namespace Terminating解决脚本
k8s 部署 kafka 集群
ack ingress获取客户端客户端真实IP
ingress 反向代理 ws
本文档使用 MrDoc 发布
-
+
首页
k8s接入graylog
https://zhangzhuo.ltd/articles/2022/03/12/1647093697299.html ![](/media/202310/2023-10-17_154715_7681260.2508311633082051.png) * filebeat.inputs:输入也就是采集日志的源设置,这里需要使用container输入读取容器日志文件。 * processors:解析器,可以配置解析日志来源添加一些有用字段 * output.elasticsearch:输出配置 ```yaml --- apiVersion: v1 kind: ConfigMap metadata: name: filebeat-config namespace: kube-system labels: k8s-app: filebeat data: filebeat.yml: |- logging.level: info filebeat.inputs: #日志来源container,这里无需修改默认 - type: container ignore_older: 2h combine_partial: true cri.parse_flags: true cri.force: true ids: - "*" paths: - /var/log/containers/*.log processors: - add_kubernetes_metadata: in_cluster: true host: ${NODE_NAME} matchers: - logs_path: logs_path: "/var/log/containers/" processors: #日志的具体处理 - drop_event.when: #不需要采集那些容器日志 or: - equals: kubernetes.container.name: "filebeat" - rename: #重写kubernetes源数据信息 fields: - from: "kubernetes.node.name" to: "node" - from: "kubernetes.pod.name" to: "pod" - from: "kubernetes.namespace" to: "namespace" - drop_fields: #不需要那些字段 fields: ["input","agent","stream","log","host","ecs","kubernetes.container","kubernetes.pod.uid","kubernetes.replicaset.name"] output.logstash: hosts: ["192.168.1.161:5044"] #输出到logstash配置 输出到es 或者 logstash 只能二选一 output.elasticsearch: hosts: ["192.168.10.71:9200"] #输出es配置 username: "elastic" password: "123456" --- apiVersion: apps/v1 kind: DaemonSet metadata: name: filebeat namespace: kube-system labels: k8s-app: filebeat spec: selector: matchLabels: k8s-app: filebeat template: metadata: labels: k8s-app: filebeat spec: serviceAccountName: filebeat terminationGracePeriodSeconds: 30 hostNetwork: true dnsPolicy: ClusterFirstWithHostNet containers: - name: filebeat image: elastic/filebeat:7.6.1 args: [ "-c", "/etc/filebeat.yml", "-e", ] env: - name: NODE_NAME valueFrom: fieldRef: fieldPath: spec.nodeName securityContext: runAsUser: 0 # If using Red Hat OpenShift uncomment this: #privileged: true resources: limits: memory: 200Mi requests: cpu: 100m memory: 100Mi volumeMounts: - name: config mountPath: /etc/filebeat.yml readOnly: true subPath: filebeat.yml - name: data mountPath: /usr/share/filebeat/data - name: varlibdockercontainers mountPath: /var/log/containers readOnly: true - name: varlog mountPath: /var/log readOnly: true volumes: - name: config configMap: defaultMode: 0600 name: filebeat-config - name: varlibdockercontainers hostPath: path: /var/log/containers - name: varlog hostPath: path: /var/log # data folder stores a registry of read status for all files, so we don't send everything again on a Filebeat pod restart - name: data hostPath: path: /var/lib/filebeat type: DirectoryOrCreate --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: filebeat subjects: - kind: ServiceAccount name: filebeat namespace: kube-system roleRef: kind: ClusterRole name: filebeat apiGroup: rbac.authorization.k8s.io --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: filebeat labels: k8s-app: filebeat rules: - apiGroups: [""] # "" indicates the core API group resources: - namespaces - pods verbs: - get - watch - list --- apiVersion: v1 kind: ServiceAccount metadata: name: filebeat namespace: kube-system labels: k8s-app: filebeat --- ``` graylog 新建 input ![](/media/202310/2023-10-17_153458_9175730.45613800449423325.png) ![](/media/202310/2023-10-17_153611_0152900.043889046136085685.png) ![](/media/202310/2023-10-17_153820_6347270.030725180057562418.png) ![](/media/202310/2023-10-17_153918_1931440.5706126413677647.png) ![](/media/202310/2023-10-17_154224_3216700.08580120085614196.png) ![](/media/202310/2023-10-17_154626_0752550.8736716693962867.png)
admin
2023年10月17日 15:47
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
Markdown文件
分享
链接
类型
密码
更新密码