Daemonset
HUATUO 为减少理解成本,提供了最简单的 daemonset 部署方式。
通过 daemonset 方式部署 HUATUO 采集器有如下步骤。
1 拉取采集器配置文件
curl -L -o huatuo-bamai.conf https://github.com/ccfos/huatuo/raw/v2.1.0/huatuo-bamai.conf
配置文件需要根据你的实际环境作修改,如连接 kubelet 和 elasticsrearch 的相关配置。
2 创建 configMap
kubectl create configmap huatuo-bamai-config --from-file=./huatuo-bamai.conf
3 部署采集器
kubectl apply -f huatuo-daemonset.minimal.yaml
文件 huatuo-daemonset.minimal.yaml 内容:
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: huatuo
namespace: default
labels:
app: huatuo
spec:
selector:
matchLabels:
app: huatuo
template:
metadata:
labels:
app: huatuo
spec:
containers:
- name: huatuo
image: docker.io/huatuo/huatuo-bamai:v2.1.0
resources:
limits:
cpu: '1'
memory: 2Gi
requests:
cpu: 500m
memory: 512Mi
securityContext:
privileged: true
volumeMounts:
- name: proc
mountPath: /proc
- name: sys
mountPath: /sys
- name: run
mountPath: /run
- name: var
mountPath: /var
- name: etc
mountPath: /etc
- name: record
mountPath: /home/huatuo-bamai/record
- name: huatuo-bamai-config-volume
mountPath: /home/huatuo-bamai/conf/huatuo-bamai.conf
subPath: huatuo-bamai.conf
volumes:
- name: proc
hostPath:
path: /proc
- name: sys
hostPath:
path: /sys
- name: run
hostPath:
path: /run
- name: var
hostPath:
path: /var
- name: etc
hostPath:
path: /etc
- name: record
hostPath:
path: /var/log/huatuo/record
type: DirectoryOrCreate
- name: huatuo-bamai-config-volume
configMap:
name: huatuo-bamai-config
hostNetwork: true
hostPID: true
页面反馈
此页面对您有帮助吗?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.