Service Binding

    1. apiVersion: core.oam.dev/v1beta1
    2. kind: Application
    3. metadata:
    4. name: webapp
    5. spec:
    6. components:
    7. - name: express-server
    8. type: webservice
    9. properties:
    10. traits:
    11. - type: service-binding
    12. properties:
    13. envMappings:
    14. # environments refer to db-conn secret
    15. DB_PASSWORD:
    16. secret: db-conn
    17. key: password # 1) If the env name is different from secret key, secret key has to be set.
    18. endpoint:
    19. secret: db-conn # 2) If the env name is the same as the secret key, secret key can be omitted.
    20. secret: db-conn
    21. - name: sample-db
    22. type: alibaba-rds
    23. properties:
    24. name: sample-db
    25. engine: mysql
    26. engineVersion: "8.0"
    27. instanceClass: rds.mysql.c1.large