【问题标题】:error: Ignoring /etc/logrotate.conf because it is writable by group or others in kubernetes错误:忽略 /etc/logrotate.conf,因为它可以由 kubernetes 中的组或其他人写入
【发布时间】:2021-02-16 05:00:14
【问题描述】:

我正在尝试通过使用以下代码 sn-ps 来旋转 kubernetes 内的日志:

containers:
  - name: logrotate
    image: docker.io/kicm/logrotate
    securityContext:
      runAsUser: 0
    volumeMounts:
      - name: logrotate-conf
        mountPath: /etc/logrotate.d
volumes:
  - name: logrotate-conf
    configMap:
      name: logrotation-config
  - name: app-logs
    persistentVolumeClaim:
      claimName: my-var-pvc
restartPolicy: OnFailure

在pod运行阶段,我遇到了如下错误:

Potentially dangerous mode on /etc/logrotate.conf: 0664
error: Ignoring /etc/logrotate.conf because it is writable by group or others.
Reading state from file: /tmp/logrotate.status
Allocating hash table for state file, size 64 entries

Handling 0 logs

请告诉我如何解决这个问题,谢谢。

【问题讨论】:

    标签: kubernetes logrotate


    【解决方案1】:

    如果这是您的图像,请使用适当的权限重建它,将其推送到注册表并使用它。

    如果这不是您的图片,请在使用其他人的图片之前三思而后行(出于安全原因)。您仍然认为使用某人的图像是个好主意吗?使用此镜像作为基础镜像构建具有更改权限的新镜像,将其推送到注册表并使用它。

    【讨论】:

      猜你喜欢
      • 2019-09-18
      • 2012-10-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-31
      相关资源
      最近更新 更多