Version: v1.1

Labels and Annotations

labels and annotations traits allow us to mark annotations and labels on Pod for workload.

Specification

  1. $ vela show annotations
  2. # Properties
  3. +-----------+-------------+-------------------+----------+---------+
  4. | NAME | DESCRIPTION | TYPE | REQUIRED | DEFAULT |
  5. +-----------+-------------+-------------------+----------+---------+
  6. | - | | map[string]string | true | |
  7. +-----------+-------------+-------------------+----------+---------+
  1. $ vela show labels
  2. # Properties
  3. +-----------+-------------+-------------------+----------+---------+
  4. | NAME | DESCRIPTION | TYPE | REQUIRED | DEFAULT |
  5. +-----------+-------------+-------------------+----------+---------+
  6. | - | | map[string]string | true | |
  7. +-----------+-------------+-------------------+----------+---------+

They’re all string Key-Value pairs.

How to use

  1. # myapp.yaml
  2. apiVersion: core.oam.dev/v1beta1
  3. kind: Application
  4. metadata:
  5. name: myapp
  6. spec:
  7. components:
  8. - name: express-server
  9. type: webservice
  10. properties:
  11. image: crccheck/hello-world
  12. port: 8000
  13. traits:
  14. - type: labels
  15. properties:
  16. "release": "stable"
  17. - type: annotations
  18. properties:
  19. "description": "web application"

Then the labels and annotations will mark on pods.