k8s.io/test-infra@v0.0.0-20240520184403-27c6b4c223d8/logexporter/cluster/logexporter-daemonset.yaml (about)

     1  # Template job config for running the log exporter on the cluster as a daemonset.
     2  # Creates everything within 'logexporter' namespace.
     3  #
     4  # Note: Since daemonsets have "AlwaysRestart" policy for pods, we provide a long
     5  # sleep-duration (24 hr) to the logexporter pods so they don't finish the work and
     6  # get restarted while some pods are still running. So it is your duty to detect
     7  # the work has been done (or use some timeout) and delete the daemonset yourself.
     8  
     9  apiVersion: v1
    10  kind: Namespace
    11  metadata:
    12      name: {{.LogexporterNamespace}}
    13  ---
    14  apiVersion: v1
    15  kind: Secret
    16  metadata:
    17    name: google-service-account
    18    namespace: {{.LogexporterNamespace}}
    19  type: Opaque
    20  data:
    21    service-account.json: {{.ServiceAccountCredentials}}
    22  ---
    23  apiVersion: apps/v1
    24  kind: DaemonSet
    25  metadata:
    26    name: logexporter
    27    namespace: {{.LogexporterNamespace}}
    28  spec:
    29    selector:
    30      matchLabels:
    31        app: logexporter
    32    template:
    33      metadata:
    34        labels:
    35          app: logexporter
    36      spec:
    37        containers:
    38        - name: logexporter-test
    39          image: gcr.io/k8s-testimages/logexporter:v20220831-a9d3b0ad39
    40          env:
    41          - name: NODE_NAME
    42            valueFrom:
    43              fieldRef:
    44                fieldPath: spec.nodeName
    45          command:
    46          - logexporter
    47          - --node-name=$(NODE_NAME)
    48          - --cloud-provider={{.CloudProvider}}
    49          - --gcs-path={{.GCSPath}}
    50          - --use-application-default-credentials={{.UseApplicationDefaultCredentials}}
    51          - --enable-hollow-node-logs={{.EnableHollowNodeLogs}}
    52          - --dump-systemd-journal={{.DumpSystemdJournal}}
    53          - --extra-log-files={{.ExtraLogFiles}}
    54          - --extra-systemd-services={{.ExtraSystemdServices}}
    55          - --sleep-duration=24h
    56          volumeMounts:
    57          - mountPath: /etc/service-account
    58            name: service
    59            readOnly: true
    60          - mountPath: /var/log
    61            name: varlog
    62            readOnly: true
    63          - mountPath: /workspace/etc
    64            name: hostetc
    65            readOnly: true
    66          resources:
    67            requests:
    68              cpu: 10m
    69              memory: 10Mi
    70        nodeSelector:
    71          {{.NodeSelector}}
    72        volumes:
    73        - name: service
    74          secret:
    75            secretName: google-service-account
    76        - name: varlog
    77          hostPath:
    78            path: /var/log
    79        - name: hostetc
    80          hostPath:
    81            path: /etc