github.com/oam-dev/kubevela@v1.9.11/references/docgen/def-doc/trait/sidecar.eg.md (about)

     1  ```yaml
     2  apiVersion: core.oam.dev/v1beta1
     3  kind: Application
     4  metadata:
     5    name: vela-app-with-sidecar
     6  spec:
     7    components:
     8      - name: log-gen-worker
     9        type: worker
    10        properties:
    11          image: busybox
    12          cmd:
    13            - /bin/sh
    14            - -c
    15            - >
    16              i=0;
    17              while true;
    18              do
    19                echo "$i: $(date)" >> /var/log/date.log;
    20                i=$((i+1));
    21                sleep 1;
    22              done
    23          volumes:
    24            - name: varlog
    25              mountPath: /var/log
    26              type: emptyDir
    27        traits:
    28          - type: sidecar
    29            properties:
    30              name: count-log
    31              image: busybox
    32              cmd: [ /bin/sh, -c, 'tail -n+1 -f /var/log/date.log']
    33              volumes:
    34                - name: varlog
    35                  path: /var/log
    36  ```