k8s部署daemonset代码示例:每个节点都会运行的守护进程
2023-09-14 09:01:51 时间
[root@m-1 test]# cat daemonset.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: ds-test
labels:
app: filebeat
spec:
selector:
matchLabels:
app: filebeat
template:
metadata:
labels:
app: filebeat
spec:
containers:
- name: logs
image: nginx:1.14-alpine
ports:
- containerPort: 80
volumeMounts:
- name: varlog
mountPath: /tmp/log
volumes:
- name: varlog
hostPath:
path: /var/log
挂载情况查看:
[root@m-1 test]# ls /var/log
anaconda boot.log-20201231 cron-20210110 maillog messages-20210117 secure-20210124 wtmp
audit boot.log-20210101 cron-20210117 maillog-20210103 messages-20210124 spooler wtmp-20201009
boot.log btmp cron-20210124 maillog-20210110 pods spooler-20210103 yum.log
boot.log-20200916 btmp-20210101 dmesg maillog-20210117 rhsm spooler-20210110 yum.log-20210101
boot.log-20201009 chrony dmesg.old maillog-20210124 secure spooler-20210117
boot.log-20201016 containers firewalld messages secure-20210103 spooler-20210124
boot.log-20201107 cron grubby_prune_debug messages-20210103 secure-20210110 tallylog
boot.log-20201207 cron-20210103 lastlog messages-20210110 secure-20210117 tuned
相关文章
- k8s系列(1)-腾讯云CVM手动部署K8S_Dashboard安装1
- k8s报错The connection to the server 192.168.X.X:6443 was refused -did you specify...?docker images镜像丢失
- 基于K8s插件版的Jenkins动态节点实践【内含最佳实践】
- 博客(halo)迁移到 K8s 上了
- K8S 生态周报| K8s v1.25 将 GlusterFS 卷插件废弃
- K8s降本增效之Descheduler篇
- 教你使用k8s来部署springboot服务
- 部署基于K8s的Oracle容器云(k8s 安装oracle)
- K8s与Oracle的完美结合赋能企业数字化转型(k8s和oracle)
- Redis如何用K8s进行自动部署与扩容(redis需要k8s吗)