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

     1  ```yaml
     2  apiVersion: core.oam.dev/v1beta1
     3  kind: Application
     4  metadata:
     5    name: application-with-update-strategy
     6  spec:
     7    components:
     8      - name: helloworld
     9        type: webservice
    10        properties:
    11          cpu: "0.5"
    12          exposeType: ClusterIP
    13          image: oamdev/hello-world:latest
    14          memory: 1024Mi
    15          ports:
    16            - expose: true
    17              port: 80
    18              protocol: TCP
    19        traits:
    20          - type: scaler
    21            properties:
    22              replicas: 5
    23          - type: k8s-update-strategy
    24            properties:
    25              targetAPIVersion: apps/v1
    26              targetKind: Deployment
    27              strategy:
    28                type: RollingUpdate
    29                rollingStrategy:
    30                  maxSurge: 20%
    31                  maxUnavailable: 30%
    32  ---
    33  apiVersion: core.oam.dev/v1beta1
    34  kind: Application
    35  metadata:
    36    name: application-node-exporter
    37  spec:
    38    components:
    39      - name: node-exporter
    40        type: daemon
    41        properties:
    42          image: prom/node-exporter
    43          imagePullPolicy: IfNotPresent
    44          volumeMounts:
    45            hostPath:
    46              - mountPath: /host/sys
    47                mountPropagation: HostToContainer
    48                name: sys
    49                path: /sys
    50                readOnly: true
    51              - mountPath: /host/root
    52                mountPropagation: HostToContainer
    53                name: root
    54                path: /
    55                readOnly: true
    56        traits:
    57          - properties:
    58              args:
    59                - --path.sysfs=/host/sys
    60                - --path.rootfs=/host/root
    61                - --no-collector.wifi
    62                - --no-collector.hwmon
    63                - --collector.filesystem.ignored-mount-points=^/(dev|proc|sys|var/lib/docker/.+|var/lib/kubelet/pods/.+)($|/)
    64                - --collector.netclass.ignored-devices=^(veth.*)$
    65            type: command
    66          - properties:
    67              annotations:
    68                prometheus.io/path: /metrics
    69                prometheus.io/port: "8080"
    70                prometheus.io/scrape: "true"
    71              port:
    72                - 9100
    73            type: expose
    74          - properties:
    75              cpu: 0.1
    76              memory: 250Mi
    77            type: resource
    78          - type: k8s-update-strategy
    79            properties:
    80              targetAPIVersion: apps/v1
    81              targetKind: DaemonSet
    82              strategy:
    83                type: RollingUpdate
    84                rollingStrategy:
    85                  maxSurge: 20%
    86                  maxUnavailable: 30%
    87  
    88  
    89  
    90  
    91  ```