diff --git a/addons/dex/config-templates/dex-connector.cue b/addons/dex/config-templates/dex-connector.cue new file mode 100644 index 00000000..b1926456 --- /dev/null +++ b/addons/dex/config-templates/dex-connector.cue @@ -0,0 +1,136 @@ +import ( + "encoding/json" +) + +metadata: { + scope: "system" + name: "dex-connector" + alias: "Dex Connector" + description: "Configure the connectors for the Dex" + sensitive: false +} + +template: { + output: { + apiVersion: "v1" + kind: "Secret" + metadata: { + name: context.name + namespace: context.namespace + labels: { + "config.oam.dev/sub-type": parameter.type + } + } + type: "Opaque" + + if parameter.type == "github" && parameter.github != _|_ { + stringData: github: json.Marshal(parameter.github) + } + if parameter.type == "ldap" && parameter.ldap != _|_ { + stringData: ldap: json.Marshal(parameter.ldap) + } + if parameter.type == "oidc" && parameter.oidc != _|_ { + stringData: oidc: json.Marshal(parameter.oidc) + } + if parameter.type == "gitlab" && parameter.gitlab != _|_ { + stringData: gitlab: json.Marshal(parameter.gitlab) + } + if parameter.type == "saml" && parameter.saml != _|_ { + stringData: saml: json.Marshal(parameter.saml) + } + if parameter.type == "google" && parameter.google != _|_ { + stringData: google: json.Marshal(parameter.google) + } + } + parameter: { + // +usage=Connetor type + type: *"github" | "ldap" | "gitlab" | "oidc" | "saml" | "google" + // +usage=GitHub connector + github?: { + // +usage=GitHub client ID + clientID: string + // +usage=GitHub client secret + clientSecret: string + // +usage=GitHub redirect URI + redirectURI: string + } + // +usage=LDAP connector + ldap?: { + // +usage=Host and optional port of the LDAP server in the form "host:port". + host: string + // +usage=The DN and password for an application service account. The connector uses these credentials to search for users and groups. Not required if the LDAP server provides access for anonymous auth. + bindDN?: string + // +usage=The password of the DN + bindPW?: string + // +usage=This field is required if the LDAP host is not using TLS (port 389). + insecureNoSSL: *true | bool + // +usage=If a custom certificate isn't provide, this option can be used to turn on + insecureSkipVerify?: bool + // +usage=If unspecified, connections will use the ldaps:// protocol + startTLS?: bool + // +usage=Path to a trusted root certificate file. Default: use the host's root CA. + rootCA?: string + // +usage=The attribute to display in the provided password prompt. If unset, will display "Username" + usernamePrompt?: string + // +usage=User search maps a username and password entered by a user to a LDAP entry. + userSearch: { + // +usage=BaseDN to start the search from. It will translate to the query "(&(objectClass=person)(uid=))". + baseDN: string + // +usage=username attribute used for comparing user entries. This will be translated and combined with the other filter as "(=)". + username: *"uid" | string + // +usage=The following three fields are direct mappings of attributes on the user entry. String representation of the user. + idAttr: *"uid" | string + // +usage=Attribute to map to Email. + emailAttr: *"mail" | string + // +usage=Maps to display name of users. No default value. + nameAttr: *"uid" | string + // +usage=Optional filter to apply when searching the directory. + filter?: string + } + } + // +usage=GitLab connector + gitlab?: { + // +usage=default to https://gitlab.com + baseURL?: string + // +usage=GitLab client ID + clientID: string + // +usage=GitLab client secret + clientSecret: string + // +usage=GitLab redirect URI + redirectURI: string + } + // +usage=OIDC connector + oidc?: { + // +usage=Canonical URL of the provider, also used for configuration discovery. This value MUST match the value returned in the provider config discovery. See: https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig + issuer: string + // +usage=OIDC client ID + clientID: string + // +usage=OIDC client secret + clientSecret: string + // +usage=OIDC redirect URI + redirectURI: string + } + // +usage=Google connector + google?: { + // +usage=Google client ID + clientID: string + // +usage=Google client secret + clientSecret: string + // +usage=Google redirect URI + redirectURI: string + } + // +usage=SAML connector + saml?: { + // +usage=SSO URL used for POST value. + ssoURL: string + // +usage=CA to use when validating the signature of the SAML response. + ca: string + // +usage=SAML redirect URI + redirectURI: string + // +usage=Name of attributes in the returned assertions to map to ID token claims. + usernameAttr: string + // +usage=Email of attributes in the returned assertions to map to ID token claims. + emailAttr: string + } + } +} diff --git a/addons/dex/definitions/dex-connectors-def.yaml b/addons/dex/definitions/dex-connectors-def.yaml deleted file mode 100644 index ddaaa362..00000000 --- a/addons/dex/definitions/dex-connectors-def.yaml +++ /dev/null @@ -1,148 +0,0 @@ -apiVersion: core.oam.dev/v1beta1 -kind: ComponentDefinition -metadata: - annotations: - custom.definition.oam.dev/alias.config.oam.dev: Dex Connector - definition.oam.dev/description: Config information to authenticate Dex connectors - labels: - custom.definition.oam.dev/catalog.config.oam.dev: velacore-config - custom.definition.oam.dev/multi-cluster.config.oam.dev: "false" - custom.definition.oam.dev/type.config.oam.dev: dex-connector - custom.definition.oam.dev/ui-hidden: "true" - name: config-dex-connector -spec: - schematic: - cue: - template: | - import ( - "encoding/json" - ) - - output: { - apiVersion: "v1" - kind: "Secret" - metadata: { - name: context.name - namespace: context.namespace - labels: { - "config.oam.dev/catalog": "velacore-config" - "config.oam.dev/type": "dex-connector" - "config.oam.dev/multi-cluster": "false" - "config.oam.dev/identifier": context.name - "config.oam.dev/sub-type": parameter.type - } - } - type: "Opaque" - - if parameter.type == "github" { - stringData: github: json.Marshal(parameter.github) - } - if parameter.type == "ldap" { - stringData: ldap: json.Marshal(parameter.ldap) - } - if parameter.type == "oidc" { - stringData: oidc: json.Marshal(parameter.oidc) - } - if parameter.type == "gitlab" { - stringData: gitlab: json.Marshal(parameter.gitlab) - } - if parameter.type == "saml" { - stringData: saml: json.Marshal(parameter.saml) - } - if parameter.type == "google" { - stringData: google: json.Marshal(parameter.google) - } - } - parameter: { - // +usage=Config type - type: "github" | "ldap" | "gitlab" | "oidc" | "saml" | "google" - // +usage=GitHub connector - github?: { - // +usage=GitHub client ID - clientID: string - // +usage=GitHub client secret - clientSecret: string - // +usage=GitHub redirect URI - redirectURI: string - } - // +usage=LDAP connector - ldap?: { - // +usage=Host and optional port of the LDAP server in the form "host:port". - host: string - // +usage=The DN and password for an application service account. The connector uses these credentials to search for users and groups. Not required if the LDAP server provides access for anonymous auth. - bindDN?: string - // +usage=The password of the DN - bindPW?: string - // +usage=This field is required if the LDAP host is not using TLS (port 389). - insecureNoSSL: *true | bool - // +usage=If a custom certificate isn't provide, this option can be used to turn on - insecureSkipVerify?: bool - // +usage=If unspecified, connections will use the ldaps:// protocol - startTLS?: bool - // +usage=Path to a trusted root certificate file. Default: use the host's root CA. - rootCA?: string - // +usage=The attribute to display in the provided password prompt. If unset, will display "Username" - usernamePrompt?: string - // +usage=User search maps a username and password entered by a user to a LDAP entry. - userSearch: { - // +usage=BaseDN to start the search from. It will translate to the query "(&(objectClass=person)(uid=))". - baseDN: string - // +usage=username attribute used for comparing user entries. This will be translated and combined with the other filter as "(=)". - username: *"uid" | string - // +usage=The following three fields are direct mappings of attributes on the user entry. String representation of the user. - idAttr: *"uid" | string - // +usage=Attribute to map to Email. - emailAttr: *"mail" | string - // +usage=Maps to display name of users. No default value. - nameAttr: *"uid" | string - // +usage=Optional filter to apply when searching the directory. - filter?: string - } - } - // +usage=GitLab connector - gitlab?: { - // +usage=default to https://gitlab.com - baseURL?: string - // +usage=GitLab client ID - clientID: string - // +usage=GitLab client secret - clientSecret: string - // +usage=GitLab redirect URI - redirectURI: string - } - // +usage=OIDC connector - oidc?: { - // +usage=Canonical URL of the provider, also used for configuration discovery. This value MUST match the value returned in the provider config discovery. See: https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig - issuer: string - // +usage=OIDC client ID - clientID: string - // +usage=OIDC client secret - clientSecret: string - // +usage=OIDC redirect URI - redirectURI: string - } - // +usage=Google connector - google?: { - // +usage=Google client ID - clientID: string - // +usage=Google client secret - clientSecret: string - // +usage=Google redirect URI - redirectURI: string - } - // +usage=SAML connector - saml?: { - // +usage=SSO URL used for POST value. - ssoURL: string - // +usage=CA to use when validating the signature of the SAML response. - ca: string - // +usage=SAML redirect URI - redirectURI: string - // +usage=Name of attributes in the returned assertions to map to ID token claims. - usernameAttr: string - // +usage=Email of attributes in the returned assertions to map to ID token claims. - emailAttr: string - } - } - workload: - type: autodetects.core.oam.dev \ No newline at end of file diff --git a/addons/dex/metadata.yaml b/addons/dex/metadata.yaml index 1178ca10..693abba8 100644 --- a/addons/dex/metadata.yaml +++ b/addons/dex/metadata.yaml @@ -1,5 +1,5 @@ name: dex -version: 0.6.5 +version: 0.6.6 description: Enable dex for login icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/dex/horizontal/color/dex-horizontal-color.png @@ -12,4 +12,4 @@ dependencies: - name: fluxcd system: - vela: ">=v1.3.0-beta.1" \ No newline at end of file + vela: ">=v1.6.0-beta.1" \ No newline at end of file diff --git a/addons/dex/readme.md b/addons/dex/readme.md index 7da783ac..2897d186 100644 --- a/addons/dex/readme.md +++ b/addons/dex/readme.md @@ -6,3 +6,9 @@ Dex is an identity service that uses [OpenID Connect](https://openid.net/connect Dex acts as a portal to other identity providers through [“connectors.”](https://dexidp.io/docs/connectors/) This lets Dex defer authentication to LDAP servers, SAML providers, or established identity providers like GitHub, Google, and Active Directory. Clients write their authentication logic once to talk to Dex, then Dex handles the protocols for a given backend. Please refer to [Dex's Website](https://dexidp.io/docs/) for more details. + +## Versions + +* 0.6.6 + +Change the dex-connector component definition to the config template. diff --git a/addons/dex/schemas/component-uischema-config-dex-connector.yaml b/addons/dex/schemas/config-uischema-dex-connector.yaml similarity index 84% rename from addons/dex/schemas/component-uischema-config-dex-connector.yaml rename to addons/dex/schemas/config-uischema-dex-connector.yaml index e0fcf6bd..4c589ea0 100644 --- a/addons/dex/schemas/component-uischema-config-dex-connector.yaml +++ b/addons/dex/schemas/config-uischema-dex-connector.yaml @@ -68,14 +68,22 @@ subParameters: - jsonKey: issuer sort: 1 + style: + colSpan: 12 - jsonKey: clientID uiType: Password sort: 3 + style: + colSpan: 12 - jsonKey: clientSecret uiType: Password sort: 5 + style: + colSpan: 12 - jsonKey: redirectURI sort: 7 + style: + colSpan: 12 - jsonKey: saml sort: 11 uiType: Ignore @@ -85,6 +93,26 @@ - jsonKey: type op: "==" value: "saml" + subParameters: + - jsonKey: usernameAttr + sort: 10 + style: + colSpan: 12 + - jsonKey: emailAttr + sort: 12 + style: + colSpan: 12 + - jsonKey: redirectURI + sort: 14 + style: + colSpan: 12 + - jsonKey: ssoURL + sort: 16 + style: + colSpan: 12 + - jsonKey: ca + sort: 18 + - jsonKey: ldap sort: 13 uiType: Ignore diff --git a/addons/fluxcd/definitions/config-helm-repository.cue b/addons/fluxcd/config-templates/helm-repository.cue similarity index 74% rename from addons/fluxcd/definitions/config-helm-repository.cue rename to addons/fluxcd/config-templates/helm-repository.cue index 2c468a9a..7c256da6 100644 --- a/addons/fluxcd/definitions/config-helm-repository.cue +++ b/addons/fluxcd/config-templates/helm-repository.cue @@ -1,16 +1,9 @@ -"config-helm-repository": { - annotations: { - "alias.config.oam.dev": "Helm Repository" - } - attributes: workload: type: "autodetects.core.oam.dev" +metadata: { + name: "helm-repository" + alias: "Helm Repository" description: "Config information to authenticate helm chart repository" - labels: { - "ui-hidden": "true" - "catalog.config.oam.dev": "velacore-config" - "multi-cluster.config.oam.dev": "true" - "type.config.oam.dev": "helm-repository" - } - type: "component" + sensitive: false + scope: "project" } template: { diff --git a/addons/fluxcd/metadata.yaml b/addons/fluxcd/metadata.yaml index b2e59caa..478ad73a 100644 --- a/addons/fluxcd/metadata.yaml +++ b/addons/fluxcd/metadata.yaml @@ -10,4 +10,4 @@ tags: - Helm system: - vela: ">=1.5.0" + vela: ">=v1.6.0-beta.1" diff --git a/addons/fluxcd/schemas/config-helm-repository.yaml b/addons/fluxcd/schemas/config-helm-repository.yaml index 23bc8f44..fad97646 100644 --- a/addons/fluxcd/schemas/config-helm-repository.yaml +++ b/addons/fluxcd/schemas/config-helm-repository.yaml @@ -1,4 +1,16 @@ - jsonKey: caFile sort: 11 uiType: CertBase64 - description: The ca certificate of helm repository. Please encode this data with base64. \ No newline at end of file + description: The ca certificate of helm repository. Please encode this data with base64. +- jsonKey: url + sort: 5 + label: URL +- jsonKey: username + sort: 8 + style: + colSpan: 12 +- jsonKey: password + sort: 9 + style: + colSpan: 12 + uiType: Password \ No newline at end of file diff --git a/addons/terraform-alibaba/definitions/alibaba-provider.cue b/addons/terraform-alibaba/config-templates/alibaba-provider.cue similarity index 51% rename from addons/terraform-alibaba/definitions/alibaba-provider.cue rename to addons/terraform-alibaba/config-templates/alibaba-provider.cue index c8fbd46a..bd9b7f28 100644 --- a/addons/terraform-alibaba/definitions/alibaba-provider.cue +++ b/addons/terraform-alibaba/config-templates/alibaba-provider.cue @@ -1,54 +1,47 @@ import "strings" -"terraform-alibaba": { - type: "component" - annotations: { - "alias.config.oam.dev": "Terraform Provider for Alibaba Cloud" - } - labels: { - "catalog.config.oam.dev": "velacore-config" - "type.config.oam.dev": "terraform-provider" - "multi-cluster.config.oam.dev": "false" - } +metadata: { + name: "terraform-alibaba" + alias: "Terraform Provider for Alibaba Cloud" + sensitive: true + scope: "system" description: "Terraform Provider for Alibaba Cloud" - attributes: workload: type: "autodetects.core.oam.dev" } template: { - output: { - apiVersion: "terraform.core.oam.dev/v1beta1" - kind: "Provider" - metadata: { - name: parameter.name - namespace: "default" - labels: l - } - spec: { - provider: "alibaba" - region: parameter.ALICLOUD_REGION - credentials: { - source: "Secret" - secretRef: { - namespace: "vela-system" - name: parameter.name + "-account-creds" - key: "credentials" + outputs: { + "provider": { + apiVersion: "terraform.core.oam.dev/v1beta1" + kind: "Provider" + metadata: { + name: parameter.name + namespace: "default" + labels: l + } + spec: { + provider: "alibaba" + region: parameter.ALICLOUD_REGION + credentials: { + source: "Secret" + secretRef: { + namespace: "vela-system" + name: context.name + key: "credentials" + } } } } } - outputs: { - "credential": { - apiVersion: "v1" - kind: "Secret" - metadata: { - name: parameter.name + "-account-creds" - namespace: "vela-system" - labels: l - } - type: "Opaque" - stringData: credentials: strings.Join([creds1, creds2], "\n") + output: { + apiVersion: "v1" + kind: "Secret" + metadata: { + name: context.name + namespace: context.namespace } + type: "Opaque" + stringData: credentials: strings.Join([creds1, creds2], "\n") } creds1: "accessKeyID: " + parameter.ALICLOUD_ACCESS_KEY diff --git a/addons/terraform-alibaba/metadata.yaml b/addons/terraform-alibaba/metadata.yaml index 9fcdf28d..8d4c9bad 100644 --- a/addons/terraform-alibaba/metadata.yaml +++ b/addons/terraform-alibaba/metadata.yaml @@ -1,5 +1,5 @@ name: terraform-alibaba -version: 1.0.3 +version: 1.0.4 description: Kubernetes Terraform Controller for Alibaba Cloud icon: https://avatars3.githubusercontent.com/aliyun url: https://registry.terraform.io/providers/aliyun/alicloud/latest @@ -16,4 +16,4 @@ dependencies: - name: terraform system: - vela: ">=v1.3.0" + vela: ">=v1.6.0-beta.1" diff --git a/addons/terraform-alibaba/schemas/config-terraform-provider-alibaba.yaml b/addons/terraform-alibaba/schemas/config-terraform-provider-alibaba.yaml new file mode 100644 index 00000000..c8cc60ac --- /dev/null +++ b/addons/terraform-alibaba/schemas/config-terraform-provider-alibaba.yaml @@ -0,0 +1,10 @@ +- jsonKey: name + sort: 1 +- jsonKey: ALICLOUD_REGION + sort: 2 +- jsonKey: ALICLOUD_ACCESS_KEY + sort: 3 + uiType: Password +- jsonKey: ALICLOUD_SECRET_KEY + sort: 4 + uiType: Password \ No newline at end of file diff --git a/addons/terraform-aws/definitions/aws-provider.cue b/addons/terraform-aws/config-templates/aws-provider.cue similarity index 57% rename from addons/terraform-aws/definitions/aws-provider.cue rename to addons/terraform-aws/config-templates/aws-provider.cue index af5b77b1..eb587d34 100644 --- a/addons/terraform-aws/definitions/aws-provider.cue +++ b/addons/terraform-aws/config-templates/aws-provider.cue @@ -1,54 +1,47 @@ import "strings" -"terraform-aws": { - type: "component" - annotations: { - "alias.config.oam.dev": "Terraform Provider for AWS" - } - labels: { - "catalog.config.oam.dev": "velacore-config" - "type.config.oam.dev": "terraform-provider" - "multi-cluster.config.oam.dev": "false" - } +metadata: { + name: "terraform-aws" + alias: "Terraform Provider for AWS" description: "Terraform Provider for AWS" - attributes: workload: type: "autodetects.core.oam.dev" + sensitive: false + scope: "system" } template: { - output: { - apiVersion: "terraform.core.oam.dev/v1beta1" - kind: "Provider" - metadata: { - name: parameter.name - namespace: "default" - labels: l - } - spec: { - provider: "aws" - region: parameter.AWS_DEFAULT_REGION - credentials: { - source: "Secret" - secretRef: { - namespace: "vela-system" - name: parameter.name + "-account-creds" - key: "credentials" - } - } - } - } - outputs: { - "credential": { - apiVersion: "v1" - kind: "Secret" + "provider": { + apiVersion: "terraform.core.oam.dev/v1beta1" + kind: "Provider" metadata: { - name: parameter.name + "-account-creds" - namespace: "vela-system" + name: parameter.name + namespace: "default" labels: l } - type: "Opaque" - stringData: credentials: strings.Join([creds1, creds2, creds3], "\n") + spec: { + provider: "aws" + region: parameter.AWS_DEFAULT_REGION + credentials: { + source: "Secret" + secretRef: { + namespace: context.namespace + name: context.name + key: "credentials" + } + } + } + }} + + output: { + apiVersion: "v1" + kind: "Secret" + metadata: { + name: context.name + namespace: context.namespace + labels: l } + type: "Opaque" + stringData: credentials: strings.Join([creds1, creds2, creds3], "\n") } creds1: "awsAccessKeyID: " + parameter.AWS_ACCESS_KEY_ID diff --git a/addons/terraform-aws/metadata.yaml b/addons/terraform-aws/metadata.yaml index ae04c63c..0f388426 100644 --- a/addons/terraform-aws/metadata.yaml +++ b/addons/terraform-aws/metadata.yaml @@ -1,5 +1,5 @@ name: terraform-aws -version: 1.0.1 +version: 1.0.2 description: Kubernetes Terraform Controller for AWS icon: https://static.kubevela.net/images/logos/aws.png url: https://registry.terraform.io/providers/hashicorp/aws/latest @@ -16,4 +16,4 @@ dependencies: - name: terraform system: - vela: ">=v1.3.0" + vela: ">=v1.6.0-beta.1" diff --git a/addons/terraform-azure/definitions/azure-provider.cue b/addons/terraform-azure/config-templates/azure-provider.cue similarity index 56% rename from addons/terraform-azure/definitions/azure-provider.cue rename to addons/terraform-azure/config-templates/azure-provider.cue index 565ec78e..b74ebcc9 100644 --- a/addons/terraform-azure/definitions/azure-provider.cue +++ b/addons/terraform-azure/config-templates/azure-provider.cue @@ -1,21 +1,15 @@ import "strings" -"terraform-azure": { - type: "component" - annotations: { - "alias.config.oam.dev": "Terraform Provider for Azure" - } - labels: { - "catalog.config.oam.dev": "velacore-config" - "type.config.oam.dev": "terraform-provider" - "multi-cluster.config.oam.dev": "false" - } +metadata: { + name: "terraform-azure" + alias: "Terraform Provider for Azure" description: "Terraform Provider for Azure" - attributes: workload: type: "autodetects.core.oam.dev" + sensitive: true + scope: "system" } template: { - output: { + outputs: {"provider": { apiVersion: "terraform.core.oam.dev/v1beta1" kind: "Provider" metadata: { @@ -28,26 +22,24 @@ template: { credentials: { source: "Secret" secretRef: { - namespace: "vela-system" - name: parameter.name + "-account-creds" + namespace: context.namespace + name: context.name key: "credentials" } } } - } + }} - outputs: { - "credential": { - apiVersion: "v1" - kind: "Secret" - metadata: { - name: parameter.name + "-account-creds" - namespace: "vela-system" - labels: l - } - type: "Opaque" - stringData: credentials: strings.Join([creds1, creds2, creds3, creds4], "\n") + output: { + apiVersion: "v1" + kind: "Secret" + metadata: { + name: context.name + namespace: context.namespace + labels: l } + type: "Opaque" + stringData: credentials: strings.Join([creds1, creds2, creds3, creds4], "\n") } creds1: "armClientID: " + parameter.ARM_CLIENT_ID @@ -56,7 +48,7 @@ template: { creds4: "armTenantID: " + parameter.ARM_TENANT_ID l: { - "config.oam.dev/catalog": "velacore-config" + "config.oam.dev/catalog": "velacore-config" "config.oam.dev/type": "terraform-provider" "config.oam.dev/provider": "terraform-azure" } diff --git a/addons/terraform-azure/metadata.yaml b/addons/terraform-azure/metadata.yaml index f99a6e0b..4b990712 100644 --- a/addons/terraform-azure/metadata.yaml +++ b/addons/terraform-azure/metadata.yaml @@ -1,5 +1,5 @@ name: terraform-azure -version: 1.0.1 +version: 1.0.2 description: Kubernetes Terraform Controller for Azure icon: https://avatars3.githubusercontent.com/azure url: https://registry.terraform.io/providers/hashicorp/azurerm/latest @@ -15,5 +15,5 @@ dependencies: - name: terraform system: - vela: ">=v1.3.0" + vela: ">=v1.6.0-beta.1" diff --git a/addons/terraform-baidu/config-templates/baidu-provider.cue b/addons/terraform-baidu/config-templates/baidu-provider.cue new file mode 100644 index 00000000..6afa552b --- /dev/null +++ b/addons/terraform-baidu/config-templates/baidu-provider.cue @@ -0,0 +1,66 @@ +import "strings" + +metadata: { + name: "terraform-baidu" + alias: "Terraform Provider for Baidu Cloud" + description: "Terraform Provider for Baidu Cloud" + sensitive: true + scope: "system" +} + +template: { + outputs: { + "provider": { + apiVersion: "terraform.core.oam.dev/v1beta1" + kind: "Provider" + metadata: { + name: parameter.name + namespace: "default" + labels: l + } + spec: { + provider: "baidu" + region: parameter.BAIDUCLOUD_REGION + credentials: { + source: "Secret" + secretRef: { + name: context.name + namespace: context.namespace + key: "credentials" + } + } + } + }} + + output: { + apiVersion: "v1" + kind: "Secret" + metadata: { + name: context.name + namespace: context.namespace + labels: l + } + type: "Opaque" + stringData: credentials: strings.Join([ + "accessKey: " + parameter.BAIDUCLOUD_ACCESS_KEY, + "secretKey: " + parameter.BAIDUCLOUD_SECRET_KEY, + ], "\n") + } + + l: { + "config.oam.dev/catalog": "velacore-config" + "config.oam.dev/type": "terraform-provider" + "config.oam.dev/provider": "terraform-baidu" + } + + parameter: { + //+usage=The name of Terraform Provider for Baidu Cloud, default is `baidu` + name: *"baidu" | string + //+usage=Get BAIDUCLOUD_ACCESS_KEY per this guide https://cloud.baidu.com/doc/Reference/s/9jwvz2egb + BAIDUCLOUD_ACCESS_KEY: string + //+usage=Get BAIDUCLOUD_SECRET_KEY per this guide https://cloud.baidu.com/doc/Reference/s/9jwvz2egb + BAIDUCLOUD_SECRET_KEY: string + //+usage=Get BAIDUCLOUD_REGION by picking one RegionId from Baidu Cloud region list https://cloud.baidu.com/doc/Reference/s/2jwvz23xx + BAIDUCLOUD_REGION: string + } +} diff --git a/addons/terraform-baidu/definitions/baidu-provider.cue b/addons/terraform-baidu/definitions/baidu-provider.cue deleted file mode 100644 index be17ca1a..00000000 --- a/addons/terraform-baidu/definitions/baidu-provider.cue +++ /dev/null @@ -1,72 +0,0 @@ -import "strings" - -"terraform-baidu": { - type: "component" - annotations: { - "alias.config.oam.dev": "Terraform Provider for Baidu Cloud" - } - labels: { - "catalog.config.oam.dev": "velacore-config" - "type.config.oam.dev": "terraform-provider" - "multi-cluster.config.oam.dev": "false" - } - description: "Terraform Provider for Baidu Cloud" -} - -template: { - output: { - apiVersion: "terraform.core.oam.dev/v1beta1" - kind: "Provider" - metadata: { - name: parameter.name - namespace: "default" - labels: l - } - spec: { - provider: "baidu" - region: parameter.BAIDUCLOUD_REGION - credentials: { - source: "Secret" - secretRef: { - namespace: "vela-system" - name: parameter.name + "-account-creds" - key: "credentials" - } - } - } - } - - outputs: { - "credential": { - apiVersion: "v1" - kind: "Secret" - metadata: { - name: parameter.name + "-account-creds" - namespace: "vela-system" - labels: l - } - type: "Opaque" - stringData: credentials: strings.Join([ - "accessKey: " + parameter.BAIDUCLOUD_ACCESS_KEY, - "secretKey: " + parameter.BAIDUCLOUD_SECRET_KEY, - ], "\n") - } - } - - l: { - "config.oam.dev/catalog": "velacore-config" - "config.oam.dev/type": "terraform-provider" - "config.oam.dev/provider": "terraform-baidu" - } - - parameter: { - //+usage=The name of Terraform Provider for Baidu Cloud, default is `baidu` - name: *"baidu" | string - //+usage=Get BAIDUCLOUD_ACCESS_KEY per this guide https://cloud.baidu.com/doc/Reference/s/9jwvz2egb - BAIDUCLOUD_ACCESS_KEY: string - //+usage=Get BAIDUCLOUD_SECRET_KEY per this guide https://cloud.baidu.com/doc/Reference/s/9jwvz2egb - BAIDUCLOUD_SECRET_KEY: string - //+usage=Get BAIDUCLOUD_REGION by picking one RegionId from Baidu Cloud region list https://cloud.baidu.com/doc/Reference/s/2jwvz23xx - BAIDUCLOUD_REGION: string - } -} diff --git a/addons/terraform-baidu/metadata.yaml b/addons/terraform-baidu/metadata.yaml index 3b8642b4..a6541845 100644 --- a/addons/terraform-baidu/metadata.yaml +++ b/addons/terraform-baidu/metadata.yaml @@ -1,5 +1,5 @@ name: terraform-baidu -version: 1.0.1 +version: 1.0.2 description: Kubernetes Terraform Controller Provider for Baidu Cloud url: https://github.com/oam-dev/terraform-controller @@ -15,4 +15,4 @@ dependencies: - name: terraform system: - vela: ">=v1.3.0-alpha.1" + vela: ">=v1.6.0-beta.1" diff --git a/addons/terraform-ec/config-templates/ec-provider.cue b/addons/terraform-ec/config-templates/ec-provider.cue new file mode 100644 index 00000000..0613d344 --- /dev/null +++ b/addons/terraform-ec/config-templates/ec-provider.cue @@ -0,0 +1,59 @@ +import "strings" + +metadata: { + name: "terraform-ec" + alias: "Terraform Provider for Elastic Cloud" + description: "Terraform Provider for Elastic Cloud" + sensitive: true + scope: "system" +} + +template: { + outputs: { + "provider": { + apiVersion: "terraform.core.oam.dev/v1beta1" + kind: "Provider" + metadata: { + name: parameter.name + namespace: "default" + labels: l + } + spec: { + provider: "ec" + credentials: { + source: "Secret" + secretRef: { + name: context.name + namespace: context.namespace + key: "credentials" + } + } + } + }} + + output: { + apiVersion: "v1" + kind: "Secret" + metadata: { + name: context.name + namespace: context.namespace + } + type: "Opaque" + stringData: credentials: strings.Join([ + "ecApiKey: " + parameter.EC_API_KEY, + ], "\n") + } + + l: { + "config.oam.dev/catalog": "velacore-config" + "config.oam.dev/type": "terraform-provider" + "config.oam.dev/provider": "terraform-ec" + } + + parameter: { + //+usage=The name of Terraform Provider for Elastic Cloud + name: *"ec" | string + //+usage=Get EC_API_KEY per this guide https://registry.terraform.io/providers/elastic/ec/latest/docs + EC_API_KEY: *"" | string + } +} diff --git a/addons/terraform-ec/definitions/ec-provider.cue b/addons/terraform-ec/definitions/ec-provider.cue deleted file mode 100644 index 18b89134..00000000 --- a/addons/terraform-ec/definitions/ec-provider.cue +++ /dev/null @@ -1,67 +0,0 @@ -import "strings" - -"terraform-ec": { - type: "component" - annotations: { - "alias.config.oam.dev": "Terraform Provider for Elastic Cloud" - } - labels: { - "catalog.config.oam.dev": "velacore-config" - "type.config.oam.dev": "terraform-provider" - "multi-cluster.config.oam.dev": "false" - } - description: "Terraform Provider for Elastic Cloud" - attributes: workload: type: "autodetects.core.oam.dev" -} - -template: { - output: { - apiVersion: "terraform.core.oam.dev/v1beta1" - kind: "Provider" - metadata: { - name: parameter.name - namespace: "default" - labels: l - } - spec: { - provider: "ec" - credentials: { - source: "Secret" - secretRef: { - namespace: "vela-system" - name: parameter.name + "-account-creds" - key: "credentials" - } - } - } - } - - outputs: { - "credential": { - apiVersion: "v1" - kind: "Secret" - metadata: { - name: parameter.name + "-account-creds" - namespace: "vela-system" - labels: l - } - type: "Opaque" - stringData: credentials: strings.Join([ - "ecApiKey: " + parameter.EC_API_KEY, - ], "\n") - } - } - - l: { - "config.oam.dev/catalog": "velacore-config" - "config.oam.dev/type": "terraform-provider" - "config.oam.dev/provider": "terraform-ec" - } - - parameter: { - //+usage=The name of Terraform Provider for Elastic Cloud - name: *"ec" | string - //+usage=Get EC_API_KEY per this guide https://registry.terraform.io/providers/elastic/ec/latest/docs - EC_API_KEY: *"" | string - } -} diff --git a/addons/terraform-ec/metadata.yaml b/addons/terraform-ec/metadata.yaml index af72dd65..72441a14 100644 --- a/addons/terraform-ec/metadata.yaml +++ b/addons/terraform-ec/metadata.yaml @@ -1,5 +1,5 @@ name: terraform-ec -version: 1.0.0 +version: 1.0.1 description: Kubernetes Terraform Controller Provider for Elastic Cloud url: https://github.com/oam-dev/terraform-controller @@ -14,6 +14,9 @@ deployTo: dependencies: - name: terraform +system: + vela: ">=v1.6.0-beta.1" + # -------------------------------------Configuration Metadata for a Terraform Addon------------------------------------- # provider short name shortCloudName: ec diff --git a/addons/terraform-gcp/config-templates/gcp-provider.cue b/addons/terraform-gcp/config-templates/gcp-provider.cue new file mode 100644 index 00000000..4d7794e4 --- /dev/null +++ b/addons/terraform-gcp/config-templates/gcp-provider.cue @@ -0,0 +1,67 @@ +import "strings" + +metadata: { + name: "terraform-gcp" + alias: "Terraform Provider for GCP" + description: "Terraform Provider for GCP" + sensitive: true + scope: "system" +} + +template: { + outputs: { + "provider": { + apiVersion: "terraform.core.oam.dev/v1beta1" + kind: "Provider" + metadata: { + name: parameter.name + namespace: "default" + labels: l + } + spec: { + provider: "gcp" + region: parameter.GOOGLE_REGION + credentials: { + source: "Secret" + secretRef: { + name: context.name + namespace: context.namespace + key: "credentials" + } + } + } + }} + + output: { + apiVersion: "v1" + kind: "Secret" + metadata: { + name: context.name + namespace: context.namespace + labels: l + } + type: "Opaque" + stringData: credentials: strings.Join([ + "gcpCredentialsJSON: " + parameter.GOOGLE_CREDENTIALS, + + "gcpProject: " + parameter.GOOGLE_PROJECT, + ], "\n") + } + + l: { + "config.oam.dev/catalog": "velacore-config" + "config.oam.dev/type": "terraform-provider" + "config.oam.dev/provider": "terraform-gcp" + } + + parameter: { + //+usage=The name of Terraform Provider for GCP, default is `default` + name: *"gcp" | string + //+usage=Get gcpCredentialsJSON per this guide https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/getting_started#adding-credentials + GOOGLE_CREDENTIALS: string + //+usage=Get GOOGLE_REGION by picking one RegionId from Google Cloud region list https://cloud.google.com/compute/docs/regions-zones + GOOGLE_REGION: string + //+usage=Set gcpProject per this guide https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/getting_started#configuring-the-provider + GOOGLE_PROJECT: string + } +} diff --git a/addons/terraform-gcp/definitions/gcp-provider.cue b/addons/terraform-gcp/definitions/gcp-provider.cue deleted file mode 100644 index bedf3fd4..00000000 --- a/addons/terraform-gcp/definitions/gcp-provider.cue +++ /dev/null @@ -1,74 +0,0 @@ -import "strings" - -"terraform-gcp": { - type: "component" - annotations: { - "alias.config.oam.dev": "Terraform Provider for GCP" - } - labels: { - "catalog.config.oam.dev": "velacore-config" - "type.config.oam.dev": "terraform-provider" - "multi-cluster.config.oam.dev": "false" - } - description: "Terraform Provider for GCP" - attributes: workload: type: "autodetects.core.oam.dev" -} - -template: { - output: { - apiVersion: "terraform.core.oam.dev/v1beta1" - kind: "Provider" - metadata: { - name: parameter.name - namespace: "default" - labels: l - } - spec: { - provider: "gcp" - region: parameter.GOOGLE_REGION - credentials: { - source: "Secret" - secretRef: { - namespace: "vela-system" - name: parameter.name + "-account-creds" - key: "credentials" - } - } - } - } - - outputs: { - "credential": { - apiVersion: "v1" - kind: "Secret" - metadata: { - name: parameter.name + "-account-creds" - namespace: "vela-system" - labels: l - } - type: "Opaque" - stringData: credentials: strings.Join([ - "gcpCredentialsJSON: " + parameter.GOOGLE_CREDENTIALS, - - "gcpProject: " + parameter.GOOGLE_PROJECT, - ], "\n") - } - } - - l: { - "config.oam.dev/catalog": "velacore-config" - "config.oam.dev/type": "terraform-provider" - "config.oam.dev/provider": "terraform-gcp" - } - - parameter: { - //+usage=The name of Terraform Provider for GCP, default is `default` - name: *"gcp" | string - //+usage=Get gcpCredentialsJSON per this guide https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/getting_started#adding-credentials - GOOGLE_CREDENTIALS: string - //+usage=Get GOOGLE_REGION by picking one RegionId from Google Cloud region list https://cloud.google.com/compute/docs/regions-zones - GOOGLE_REGION: string - //+usage=Set gcpProject per this guide https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/getting_started#configuring-the-provider - GOOGLE_PROJECT: string - } -} diff --git a/addons/terraform-gcp/metadata.yaml b/addons/terraform-gcp/metadata.yaml index d73d3203..cc38e9cb 100644 --- a/addons/terraform-gcp/metadata.yaml +++ b/addons/terraform-gcp/metadata.yaml @@ -1,5 +1,5 @@ name: terraform-gcp -version: 1.0.1 +version: 1.0.2 description: Kubernetes Terraform Controller Provider for Google Cloud Platform url: https://github.com/oam-dev/terraform-controller @@ -15,4 +15,4 @@ dependencies: - name: terraform system: - vela: ">=v1.3.0" + vela: ">=v1.6.0-beta.1" diff --git a/addons/terraform-tencent/definitions/tencent-provider.cue b/addons/terraform-tencent/config-templates/tencent-provider.cue similarity index 53% rename from addons/terraform-tencent/definitions/tencent-provider.cue rename to addons/terraform-tencent/config-templates/tencent-provider.cue index 2fe1eddc..2dcf3821 100644 --- a/addons/terraform-tencent/definitions/tencent-provider.cue +++ b/addons/terraform-tencent/config-templates/tencent-provider.cue @@ -1,54 +1,47 @@ import "strings" -"terraform-tencent": { - type: "component" - annotations: { - "alias.config.oam.dev": "Terraform Provider for Tencent Cloud" - } - labels: { - "catalog.config.oam.dev": "velacore-config" - "type.config.oam.dev": "terraform-provider" - "multi-cluster.config.oam.dev": "false" - } +metadata: { + name: "terraform-tencent" + alias: "Terraform Provider for Tencent Cloud" description: "Terraform Provider for Tencent Cloud" - attributes: workload: type: "autodetects.core.oam.dev" + sensitive: true + scope: "system" } template: { - output: { - apiVersion: "terraform.core.oam.dev/v1beta1" - kind: "Provider" - metadata: { - name: parameter.name - namespace: "default" - labels: l - } - spec: { - provider: "tencent" - region: parameter.TENCENTCLOUD_REGION - credentials: { - source: "Secret" - secretRef: { - namespace: "vela-system" - name: parameter.name + "-account-creds" - key: "credentials" - } - } - } - } - outputs: { - "credential": { - apiVersion: "v1" - kind: "Secret" + "provider": { + apiVersion: "terraform.core.oam.dev/v1beta1" + kind: "Provider" metadata: { - name: parameter.name + "-account-creds" - namespace: "vela-system" + name: parameter.name + namespace: "default" labels: l } - type: "Opaque" - stringData: credentials: strings.Join([creds1, creds2], "\n") + spec: { + provider: "tencent" + region: parameter.TENCENTCLOUD_REGION + credentials: { + source: "Secret" + secretRef: { + name: context.name + namespace: context.namespace + key: "credentials" + } + } + } + } + } + output: { + apiVersion: "v1" + kind: "Secret" + metadata: { + name: context.name + namespace: context.namespace + labels: l } + type: "Opaque" + stringData: credentials: strings.Join([creds1, creds2], "\n") } creds1: "secretID: " + parameter.TENCENTCLOUD_SECRET_ID diff --git a/addons/terraform-tencent/metadata.yaml b/addons/terraform-tencent/metadata.yaml index b80ea42c..5c18d16e 100644 --- a/addons/terraform-tencent/metadata.yaml +++ b/addons/terraform-tencent/metadata.yaml @@ -1,5 +1,5 @@ name: terraform-tencent -version: 1.0.1 +version: 1.0.2 description: Kubernetes Terraform Controller Provider for Tencent Cloud url: https://github.com/oam-dev/terraform-controller @@ -15,4 +15,4 @@ dependencies: - name: terraform system: - vela: ">=v1.3.0" + vela: ">=v1.6.0-beta.1" diff --git a/addons/terraform-ucloud/config-templates/ucloud-provider.cue b/addons/terraform-ucloud/config-templates/ucloud-provider.cue new file mode 100644 index 00000000..f5f8b167 --- /dev/null +++ b/addons/terraform-ucloud/config-templates/ucloud-provider.cue @@ -0,0 +1,69 @@ +import "strings" + +metadata: { + name: "terraform-ucloud" + alias: "Terraform Provider for Ucloud Cloud" + description: "Terraform Provider for Ucloud Cloud" + scope: "system" + sensitive: true +} + +template: { + outputs: { + provider: { + apiVersion: "terraform.core.oam.dev/v1beta1" + kind: "Provider" + metadata: { + name: parameter.name + namespace: "default" + labels: l + } + spec: { + provider: "ucloud" + region: parameter.UCLOUD_REGION + credentials: { + source: "Secret" + secretRef: { + name: context.name + namespace: context.namespace + key: "credentials" + } + } + } + }} + + output: { + apiVersion: "v1" + kind: "Secret" + metadata: { + name: context.name + namespace: context.namespace + labels: l + } + type: "Opaque" + stringData: credentials: strings.Join([ + "privateKey: " + parameter.UCLOUD_PRIVATE_KEY, + "publicKey: " + parameter.UCLOUD_PUBLIC_KEY, + "projectID: " + parameter.UCLOUD_PROJECT_ID, + ], "\n") + } + + l: { + "config.oam.dev/catalog": "velacore-config" + "config.oam.dev/type": "terraform-provider" + "config.oam.dev/provider": "terraform-ucloud" + } + + parameter: { + //+usage=The name of Terraform Provider for Ucloud Cloud, default is `default` + name: *"ucloud" | string + //+usage=Get UCLOUD_PRIVATE_KEY per this guide https://docs.ucloud.cn/terraform/quickstart + UCLOUD_PRIVATE_KEY: string + //+usage=Get UCLOUD_PUBLIC_KEY per this guide https://docs.ucloud.cn/terraform/quickstart + UCLOUD_PUBLIC_KEY: string + //+usage=Get UCLOUD_PROJECT_ID per this guide https://docs.ucloud.cn/terraform/quickstart + UCLOUD_PROJECT_ID: string + //+usage=Get UCLOUD_REGION by picking one RegionId from UCloud region list https://docs.ucloud.cn/api/summary/regionlist + UCLOUD_REGION: string + } +} diff --git a/addons/terraform-ucloud/definitions/ucloud-provider.cue b/addons/terraform-ucloud/definitions/ucloud-provider.cue deleted file mode 100644 index 306f8c53..00000000 --- a/addons/terraform-ucloud/definitions/ucloud-provider.cue +++ /dev/null @@ -1,76 +0,0 @@ -import "strings" - -"terraform-ucloud": { - type: "component" - annotations: { - "alias.config.oam.dev": "Terraform Provider for Ucloud Cloud" - } - labels: { - "catalog.config.oam.dev": "velacore-config" - "type.config.oam.dev": "terraform-provider" - "multi-cluster.config.oam.dev": "false" - } - description: "Terraform Provider for Ucloud Cloud" - attributes: workload: type: "autodetects.core.oam.dev" -} - -template: { - output: { - apiVersion: "terraform.core.oam.dev/v1beta1" - kind: "Provider" - metadata: { - name: parameter.name - namespace: "default" - labels: l - } - spec: { - provider: "ucloud" - region: parameter.UCLOUD_REGION - credentials: { - source: "Secret" - secretRef: { - namespace: "vela-system" - name: parameter.name + "-account-creds" - key: "credentials" - } - } - } - } - - outputs: { - "credential": { - apiVersion: "v1" - kind: "Secret" - metadata: { - name: parameter.name + "-account-creds" - namespace: "vela-system" - labels: l - } - type: "Opaque" - stringData: credentials: strings.Join([ - "privateKey: " + parameter.UCLOUD_PRIVATE_KEY, - "publicKey: " + parameter.UCLOUD_PUBLIC_KEY, - "projectID: " + parameter.UCLOUD_PROJECT_ID, - ], "\n") - } - } - - l: { - "config.oam.dev/catalog": "velacore-config" - "config.oam.dev/type": "terraform-provider" - "config.oam.dev/provider": "terraform-ucloud" - } - - parameter: { - //+usage=The name of Terraform Provider for Ucloud Cloud, default is `default` - name: *"ucloud" | string - //+usage=Get UCLOUD_PRIVATE_KEY per this guide https://docs.ucloud.cn/terraform/quickstart - UCLOUD_PRIVATE_KEY: string - //+usage=Get UCLOUD_PUBLIC_KEY per this guide https://docs.ucloud.cn/terraform/quickstart - UCLOUD_PUBLIC_KEY: string - //+usage=Get UCLOUD_PROJECT_ID per this guide https://docs.ucloud.cn/terraform/quickstart - UCLOUD_PROJECT_ID: string - //+usage=Get UCLOUD_REGION by picking one RegionId from UCloud region list https://docs.ucloud.cn/api/summary/regionlist - UCLOUD_REGION: string - } -} diff --git a/addons/terraform-ucloud/metadata.yaml b/addons/terraform-ucloud/metadata.yaml index e9c1b1c0..182e6233 100644 --- a/addons/terraform-ucloud/metadata.yaml +++ b/addons/terraform-ucloud/metadata.yaml @@ -1,5 +1,5 @@ name: terraform-ucloud -version: 1.0.1 +version: 1.0.2 description: Kubernetes Terraform Controller Provider for UCloud url: https://github.com/oam-dev/terraform-controller @@ -15,7 +15,7 @@ dependencies: - name: terraform system: - vela: ">=v1.3.0" + vela: ">=v1.6.0-beta.1" # -------------------------------------Configuration Metadata for a Terraform Addon------------------------------------- diff --git a/addons/velaux/config-templates/image-registry.cue b/addons/velaux/config-templates/image-registry.cue new file mode 100644 index 00000000..2537721b --- /dev/null +++ b/addons/velaux/config-templates/image-registry.cue @@ -0,0 +1,72 @@ +import ( + "encoding/base64" + "encoding/json" + "strconv" +) + +metadata: { + name: "image-registry" + alias: "Image Registry" + scope: "project" + description: "Config information to authenticate image registry" + sensitive: false +} + +template: { + output: { + apiVersion: "v1" + kind: "Secret" + metadata: { + name: context.name + namespace: context.namespace + labels: { + "config.oam.dev/catalog": "velacore-config" + "config.oam.dev/type": "image-registry" + } + } + if parameter.auth != _|_ { + type: "kubernetes.io/dockerconfigjson" + } + if parameter.auth == _|_ { + type: "Opaque" + } + stringData: { + if parameter.auth != _|_ && parameter.auth.username != _|_ { + ".dockerconfigjson": json.Marshal({ + "auths": (parameter.registry): { + "username": parameter.auth.username + "password": parameter.auth.password + if parameter.auth.email != _|_ { + "email": parameter.auth.email + } + "auth": base64.Encode(null, (parameter.auth.username + ":" + parameter.auth.password)) + } + }) + } + if parameter.insecure != _|_ { + "insecure-skip-verify": strconv.FormatBool(parameter.insecure) + } + if parameter.useHTTP != _|_ { + "protocol-use-http": strconv.FormatBool(parameter.useHTTP) + } + } + } + + parameter: { + // +usage=Image registry FQDN, such as: index.docker.io + registry: *"index.docker.io" | string + // +usage=Authenticate the image registry + auth?: { + // +usage=Private Image registry username + username: string + // +usage=Private Image registry password + password: string + // +usage=Private Image registry email + email?: string + } + // +usage=For the registry server that uses the self-signed certificate + insecure?: bool + // +usage=For the registry server that uses the HTTP protocol + useHTTP?: bool + } +} diff --git a/addons/velaux/config-templates/nacos-config.cue b/addons/velaux/config-templates/nacos-config.cue new file mode 100644 index 00000000..05a25866 --- /dev/null +++ b/addons/velaux/config-templates/nacos-config.cue @@ -0,0 +1,56 @@ +metadata: { + name: "nacos-config" + alias: "Nacos Configuration" + description: "Write the configuration to the nacos" + sensitive: false + scope: "system" +} + +template: { + nacos: { + // The endpoint can not references the parameter. + endpoint: { + name: "nacos" + namespace: "vela-system" + } + format: parameter.contentType + + // could references the parameter + metadata: { + dataId: parameter.dataId + group: parameter.group + if parameter.appName != _|_ { + appName: parameter.appName + } + if parameter.namespaceId != _|_ { + namespaceId: parameter.namespaceId + } + if parameter.tenant != _|_ { + tenant: parameter.tenant + } + if parameter.tag != _|_ { + tenant: parameter.tag + } + } + content: parameter.content + } + parameter: { + // +usage=Configuration ID + dataId: string + // +usage=Configuration group + group: *"DEFAULT_GROUP" | string + // +usage=The configuration content. + content: { + ... + } + contentType: *"json" | "yaml" | "properties" | "toml" + // +usage=The app name of the configuration + appName?: string + // +usage=The namespaceId of the configuration + namespaceId?: string + // +usage=The tenant, corresponding to the namespace ID field of Nacos + tenant?: string + // +usage=The tag of the configuration + tag?: string + } +} diff --git a/addons/velaux/config-templates/nacos-server.cue b/addons/velaux/config-templates/nacos-server.cue new file mode 100644 index 00000000..541f334b --- /dev/null +++ b/addons/velaux/config-templates/nacos-server.cue @@ -0,0 +1,38 @@ +metadata: { + name: "nacos-server" + alias: "Nacos Server" + description: "Config the Nacos server connectors" + sensitive: false + scope: "system" +} + +template: { + parameter: { + // +usage=Directly configure the Nacos server address + servers?: [...{ + // +usage=the nacos server address + ipAddr: string + // +usage=nacos server port + port: *8849 | int + // +usage=nacos server grpc port, default=server port + 1000, this is not required + grpcPort?: int + }] + // +usage=Discover the Nacos servers by the client. + client?: { + // +usage=the endpoint for get Nacos server addresses + endpoint: string + // +usage=the AccessKey for kms + accessKey?: string + // +usage=the SecretKey for kms + secretKey?: string + // +usage=the regionId for kms + regionId?: string + // +usage=the username for nacos auth + username?: string + // +usage=the password for nacos auth + password?: string + // +usage=it's to open kms,default is false. https://help.aliyun.com/product/28933.html + openKMS?: bool + } + } +} diff --git a/addons/velaux/metadata.yaml b/addons/velaux/metadata.yaml index d0645704..130a29b1 100644 --- a/addons/velaux/metadata.yaml +++ b/addons/velaux/metadata.yaml @@ -1,5 +1,5 @@ name: velaux -version: v1.5.8 +version: v1.6.0-beta.1 description: KubeVela User Experience (UX). An extensible, application-oriented delivery and management Dashboard. icon: https://static.kubevela.net/images/logos/KubeVela%20-03.png url: https://kubevela.io @@ -12,4 +12,4 @@ deployTo: runtimeCluster: false system: - vela: ">=v1.5.0" + vela: ">=v1.6.0-beta.1" diff --git a/addons/velaux/schemas/config-image-registry.yaml b/addons/velaux/schemas/config-image-registry.yaml new file mode 100644 index 00000000..f90ee36e --- /dev/null +++ b/addons/velaux/schemas/config-image-registry.yaml @@ -0,0 +1,24 @@ +- jsonKey: registry + sort: 1 +- jsonKey: insecure + sort: 3 + style: + colSpan: 12 +- jsonKey: useHTTP + sort: 5 + style: + colSpan: 12 +- jsonKey: auth + subParameters: + - jsonKey: username + sort: 1 + style: + colSpan: 12 + + - jsonKey: password + sort: 3 + style: + colSpan: 12 + uiType: Password + - jsonKey: email + sort: 8 \ No newline at end of file diff --git a/addons/velaux/schemas/config-nacos-config.yaml b/addons/velaux/schemas/config-nacos-config.yaml new file mode 100644 index 00000000..271e1556 --- /dev/null +++ b/addons/velaux/schemas/config-nacos-config.yaml @@ -0,0 +1,14 @@ +- jsonKey: dataId + sort: 1 + style: + colSpan: 8 +- jsonKey: group + sort: 3 + style: + colSpan: 8 +- jsonKey: contentType + sort: 5 + style: + colSpan: 8 +- jsonKey: content + sort: 7 diff --git a/addons/velaux/schemas/config-nacos-server.yaml b/addons/velaux/schemas/config-nacos-server.yaml new file mode 100644 index 00000000..5a1621c8 --- /dev/null +++ b/addons/velaux/schemas/config-nacos-server.yaml @@ -0,0 +1,43 @@ +- sort: 100 + jsonKey: servers + subParameters: + - sort: 100 + label: IPAddr + jsonKey: ipAddr + - sort: 101 + label: Port + jsonKey: port + - sort: 102 + label: GRPCPort + jsonKey: grpcPort +- sort: 101 + jsonKey: client + subParameters: + - sort: 100 + jsonKey: endpoint + - sort: 101 + jsonKey: accessKey + uiType: Password + - sort: 102 + jsonKey: secretKey + uiType: Password + - sort: 104 + style: + colSpan: 12 + jsonKey: regionId + - sort: 109 + style: + colSpan: 12 + jsonKey: openKMS + uiType: Switch + + - sort: 110 + jsonKey: username + uiType: Input + style: + colSpan: 12 + - sort: 113 + jsonKey: password + uiType: Password + style: + colSpan: 12