株式会社ヴァンデミックシステム

Blog

<スポンサーリンク>

securityContextをつける。つけない場合で、そのマウントポイントにユーザー権限で書き込み操作がある場合はPermissionErrorが出力される。
ちなみに、fluentdのDockerfileで実行されるfluentduserのidはこのような感じ。

uid=100(fluent) gid=65533(nogroup) groups=65533(nogroup)
      securityContext:
        runAsUser: 100
        runAsNonRoot: true
        fsGroup: 65533

全体

apiVersion: apps/v1
kind: StatefulSet
spec:
  selector:
    matchLabels:
      app: fluentd
  serviceName: fluentd
  template:
    spec:
      securityContext:
        runAsUser: 100
        runAsNonRoot: true
        fsGroup: 65533
      containers:
      - image: fluent/fluentd
        args:
        imagePullPolicy: Always
        volumeMounts:
        - name: recive
          mountPath: /fluentd/log
        name: fluentd-container
  replicas: 1
  volumeClaimTemplates:
  - spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 2Gi

<スポンサーリンク>

コメントを残す

Allowed tags:  you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>
Please note:  all comments go through moderation.

*

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)