Config Template

    The config data save as a Secret default, but you also could generate resources of any type by defining the template. Even, you can define the extend writer to write the config data to the Nacos server.

    Config Template defined with the CUE file. The schema of the specification:

    • metadata.name This is required. Specify the name of the template.
    • metadata.alias Specify the alias of the template.
    • metadata.description Specify the description of the template.
    • metadata.scope Specify the scope of the config created by this template. In VelaUX, the template belonging to the project scope means this template could be used to create the config in the project. If created in the system, this config could be shared with all projects.
    • metadata.sensitive Is it sensitive the config created by this template? If the config is sensitive, it can not be read directly and could only mount the Secret.

    Template

    • template.output This is not required. You could specify if you want to customize the data structure of the Secret.

    • template.outputs This is not required. You could specify any resources that you want to generate by this config.

    • List the Config Templates
    1. vela config-template list
    • Create a Config Template
    1. vela config-template apply -f example.cue
    • Show the schema and document of the Config Template
    • Delete a Config Template
    1. vela config-template delete <Template Name>

    More usages, refer to:

    1. vela config-template --help

    Nacos Server

    1. metadata: {
    2. name: "nacos-server"
    3. alias: "Nacos Server"
    4. description: "Config the Nacos server connectors"
    5. sensitive: false
    6. scope: "system"
    7. }
    8. template: {
    9. parameter: {
    10. // +usage=Directly configure the Nacos server address
    11. servers?: [...{
    12. ipAddr: string
    13. // +usage=nacos server port
    14. port: *8849 | int
    15. // +usage=nacos server grpc port, default=server port + 1000, this is not required
    16. grpcPort?: int
    17. }]
    18. client?: {
    19. // +usage=the endpoint for get Nacos server addresses
    20. endpoint: string
    21. // +usage=the AccessKey for kms
    22. accessKey?: string
    23. // +usage=the SecretKey for kms
    24. secretKey?: string
    25. // +usage=the regionId for kms
    26. regionId?: string
    27. // +usage=the username for nacos auth
    28. username?: string
    29. // +usage=the password for nacos auth
    30. password?: string
    31. // +usage=it's to open kms,default is false. https://help.aliyun.com/product/28933.html
    32. openKMS?: bool
    33. }
    34. }
    35. }
    1. metadata: {
    2. name: "nacos-config"
    3. alias: "Nacos Configuration"
    4. description: "Write the configuration to the nacos"
    5. sensitive: false
    6. scope: "system"
    7. }
    8. template: {
    9. nacos: {
    10. // The endpoint can not references the parameter.
    11. endpoint: {
    12. // Users must create a config base the nacos-server template firstly.
    13. name: "nacos"
    14. }
    15. // could references the parameter
    16. dataId: parameter.dataId
    17. group: parameter.group
    18. if parameter.appName != _|_ {
    19. appName: parameter.appName
    20. }
    21. if parameter.namespaceId != _|_ {
    22. namespaceId: parameter.namespaceId
    23. }
    24. if parameter.tenant != _|_ {
    25. tenant: parameter.tenant
    26. }
    27. if parameter.tag != _|_ {
    28. tag: parameter.tag
    29. }
    30. }
    31. content: parameter.content
    32. }
    33. parameter: {
    34. // +usage=Configuration ID
    35. dataId: string
    36. // +usage=Configuration group
    37. group: *"DEFAULT_GROUP" | string
    38. // +usage=The configuration content.
    39. content: {
    40. ...
    41. }
    42. contentType: *"json" | "yaml" | "properties" | "toml"
    43. // +usage=The app name of the configuration
    44. appName?: string
    45. // +usage=The namespaceId of the configuration
    46. namespaceId?: string
    47. // +usage=The tenant, corresponding to the namespace ID field of Nacos
    48. tenant?: string
    49. // +usage=The tag of the configuration
    50. tag?: string
    51. }

    Alibaba Cloud Provider

    The Config Template is part of the . You could get or share the templates via addons.