diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-v1.5/reference/addons/traefik.md b/i18n/zh/docusaurus-plugin-content-docs/version-v1.5/reference/addons/traefik.md index 811faa49..81f98acf 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-v1.5/reference/addons/traefik.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-v1.5/reference/addons/traefik.md @@ -4,6 +4,130 @@ title: Traefik Traefik 是一个现代化且易用的 HTTP 反向代理和负载均衡服务,用于部署微服务。你可以使用该插件作为你的集群网关活着微服务系统的网关。 + +## 插件安装 + +```bash +vela addon enable traefik +``` + +### 访问 Traefik 的 UI + +默认安装情况下 Traefik 无法直接访问,可通过 port-forward 进行本地代理,这仅适用于调试阶段。 + +```bash +vela port-forward -n vela-system addon-traefik +``` + +expected output: + +```bash +Forwarding from 127.0.0.1:9000 -> 9000 +Forwarding from [::1]:9000 -> 9000 + +Forward successfully! Opening browser ... +Handling connection for 9000 +``` + +你可以通过 `http://127.0.0.1:9000/dashboard/` 地址访问到 Traefik 的 UI 可视化面板。 + +### 设置网关流量接入方式 + +如果你使用云上的集群,使用 LoadBalancer 暴露 Traefik 的访问入口是最佳方案。 + +```bash +vela addon enable traefik serviceType=LoadBalancer +``` + +如果在自建集群,需要根据你是作为集群网关还是应用网关来选择流量接入方式。 + +## 如何使用 + +1. 为组件配置一个 HTTP 域名 + +```bash +apiVersion: core.oam.dev/v1beta1 +kind: Application +metadata: + name: example + namespace: e2e-test +spec: + components: + - name: express-server + type: webservice + properties: + image: oamdev/hello-world + ports: + - port: 8000 + expose: true + traits: + - properties: + domains: + - example.domain.com + rules: + - path: + type: PathPrefix + value: / + port: 8080 + type: http-route +``` + +2. 为组件配置一个 HTTPS 域名 + +首先需要准备一个证书并创建一个 Secret。 + +```yaml + +apiVersion: v1 +type: Opaque +data: + tls.crt: + tls.key: +kind: Secret +metadata: + annotations: + config.oam.dev/alias: "" + config.oam.dev/description: "" + labels: + config.oam.dev/catalog: velacore-config + config.oam.dev/multi-cluster: "true" + config.oam.dev/project: addons + config.oam.dev/type: config-tls-certificate + workload.oam.dev/type: config-tls-certificate + name: example +``` + +应用配置案例如下: + +```yaml +apiVersion: core.oam.dev/v1beta1 +kind: Application +metadata: + name: example-https + namespace: e2e-test +spec: + components: + - name: express-server + type: webservice + properties: + image: oamdev/hello-world + ports: + - port: 8000 + expose: true + traits: + - properties: + domains: + - example.domain.com + rules: + - path: + type: PathPrefix + value: / + port: 8080 + secrets: + - name: example + type: https-route +``` + ## XDefinitions ### http-route(trait) @@ -120,40 +244,3 @@ Traefik 是一个现代化且易用的 HTTP 反向代理和负载均衡服务, ------------ | ------------- | ------------- | ------------- | ------------- cert | the certificate public key encrypted by base64 | string | true | key | the certificate private key encrypted by base64 | string | true | - - -## 插件安装 - -```bash -vela addon enable traefik -``` - -### 访问 Traefik 的 UI - -默认安装情况下 Traefik 无法直接访问,可通过 port-forward 进行本地代理,这仅适用于调试阶段。 - -```bash -vela port-forward -n vela-system addon-traefik -``` - -expected output: - -``` -Forwarding from 127.0.0.1:9000 -> 9000 -Forwarding from [::1]:9000 -> 9000 - -Forward successfully! Opening browser ... -Handling connection for 9000 -``` - -你可以通过 `http://127.0.0.1:9000/dashboard/` 地址访问到 Traefik 的 UI 可视化面板。 - -### 设置网关流量接入方式 - -如果你使用云上的集群,使用 LoadBalancer 暴露 Traefik 的访问入口是最佳方案。 - -```bash -vela addon enable traefik serviceType=LoadBalancer -``` - -如果在自建集群,需要根据你是作为集群网关还是应用网关来选择流量接入方式。 diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-v1.5/resources/addon-mechanism.jpg b/i18n/zh/docusaurus-plugin-content-docs/version-v1.5/resources/addon-mechanism.jpg index 3f65651a..d6bba089 100644 Binary files a/i18n/zh/docusaurus-plugin-content-docs/version-v1.5/resources/addon-mechanism.jpg and b/i18n/zh/docusaurus-plugin-content-docs/version-v1.5/resources/addon-mechanism.jpg differ diff --git a/sidebars.js b/sidebars.js index 68df8309..d753da4a 100644 --- a/sidebars.js +++ b/sidebars.js @@ -170,7 +170,6 @@ module.exports = { 'UX Customization': [ 'platform-engineers/openapi-v3-json-schema', 'reference/ui-schema', - 'reference/topology-rule', ], }, ], @@ -182,24 +181,18 @@ module.exports = { items: [ 'contributor/overview', { - type: 'category', - label: 'Extension', - collapsed: true, - items: [ - { - Addons: [ - 'platform-engineers/addon/intro', - 'platform-engineers/addon/addon-cue', - 'platform-engineers/addon/addon-yaml', - 'platform-engineers/addon/addon-registry', - ], - }, - { - 'Cloud Resources': [ - 'platform-engineers/addon/terraform', - 'platform-engineers/components/component-terraform', - ], - }, + Addons: [ + 'platform-engineers/addon/intro', + 'platform-engineers/addon/addon-cue', + 'platform-engineers/addon/addon-yaml', + 'reference/topology-rule', + 'platform-engineers/addon/addon-registry', + ], + }, + { + 'Cloud Resources': [ + 'platform-engineers/addon/terraform', + 'platform-engineers/components/component-terraform', ], }, { diff --git a/versioned_docs/version-v1.5/case-studies/multi-cluster.md b/versioned_docs/version-v1.5/case-studies/multi-cluster.md index 405e71aa..8984b4ba 100644 --- a/versioned_docs/version-v1.5/case-studies/multi-cluster.md +++ b/versioned_docs/version-v1.5/case-studies/multi-cluster.md @@ -127,7 +127,7 @@ boot docker-entrypoint.sh lib mnt root srv usr dev etc lib64 opt run sys var ``` -- `vela port-forward` can discover and forward ports of pods or services in managed clusters to your local endpoint. +- `vela port-forward` can discover and forward ports of pods or services in managed clusters to your local endpoint. ```bash $ vela port-forward basic-topology -n examples 8080:80 diff --git a/versioned_docs/version-v1.5/cli/vela_def_del.md b/versioned_docs/version-v1.5/cli/vela_def_del.md index 216c452a..7e734200 100644 --- a/versioned_docs/version-v1.5/cli/vela_def_del.md +++ b/versioned_docs/version-v1.5/cli/vela_def_del.md @@ -24,7 +24,7 @@ vela def del DEFINITION_NAME [flags] ``` -h, --help help for del -n, --namespace string Specify which namespace the definition locates. (default "vela-system") - -t, --type string Specify the definition type of target. Valid types: component, trait, policy, workload, scope, workflow-step + -t, --type string Specify the definition type of target. Valid types: scope, workflow-step, component, trait, policy, workload ``` ### Options inherited from parent commands diff --git a/versioned_docs/version-v1.5/cli/vela_def_edit.md b/versioned_docs/version-v1.5/cli/vela_def_edit.md index 49b58b49..4063daeb 100644 --- a/versioned_docs/version-v1.5/cli/vela_def_edit.md +++ b/versioned_docs/version-v1.5/cli/vela_def_edit.md @@ -27,7 +27,7 @@ vela def edit NAME [flags] ``` -h, --help help for edit -n, --namespace string Specify which namespace the definition locates. (default "vela-system") - -t, --type string Specify which definition type to get. If empty, all types will be searched. Valid types: trait, policy, workload, scope, workflow-step, component + -t, --type string Specify which definition type to get. If empty, all types will be searched. Valid types: policy, workload, scope, workflow-step, component, trait ``` ### Options inherited from parent commands diff --git a/versioned_docs/version-v1.5/cli/vela_def_get.md b/versioned_docs/version-v1.5/cli/vela_def_get.md index 2e3d1131..a7ae9b08 100644 --- a/versioned_docs/version-v1.5/cli/vela_def_get.md +++ b/versioned_docs/version-v1.5/cli/vela_def_get.md @@ -28,7 +28,7 @@ vela def get NAME [flags] -n, --namespace string Specify which namespace the definition locates. (default "vela-system") -r, --revision string Get the specified version of a definition. --revisions List revisions of the specified definition. - -t, --type string Specify which definition type to get. If empty, all types will be searched. Valid types: scope, workflow-step, component, trait, policy, workload + -t, --type string Specify which definition type to get. If empty, all types will be searched. Valid types: workflow-step, component, trait, policy, workload, scope ``` ### Options inherited from parent commands diff --git a/versioned_docs/version-v1.5/cli/vela_def_init.md b/versioned_docs/version-v1.5/cli/vela_def_init.md index 2a0a68dd..857e4f57 100644 --- a/versioned_docs/version-v1.5/cli/vela_def_init.md +++ b/versioned_docs/version-v1.5/cli/vela_def_init.md @@ -43,7 +43,7 @@ vela def init DEF_NAME [flags] --path string Specify which path the configuration(HCL) is stored in the Git repository. Valid when --git is set. -p, --provider alibaba Specify which provider the cloud resource definition belongs to. Only alibaba, `aws`, `azure` are supported. -f, --template-yaml string Specify the template yaml file that definition will use to build the schema. If empty, a default template for the given definition type will be used. - -t, --type string Specify the type of the new definition. Valid types: component, trait, policy, workload, scope, workflow-step + -t, --type string Specify the type of the new definition. Valid types: trait, policy, workload, scope, workflow-step, component ``` ### Options inherited from parent commands diff --git a/versioned_docs/version-v1.5/cli/vela_def_list.md b/versioned_docs/version-v1.5/cli/vela_def_list.md index 08369df6..e07ab3ac 100644 --- a/versioned_docs/version-v1.5/cli/vela_def_list.md +++ b/versioned_docs/version-v1.5/cli/vela_def_list.md @@ -27,7 +27,7 @@ vela def list [flags] --from string Filter definitions by which addon installed them. -h, --help help for list -n, --namespace string Specify which namespace the definition locates. (default "vela-system") - -t, --type string Specify which definition type to list. If empty, all types will be searched. Valid types: trait, policy, workload, scope, workflow-step, component + -t, --type string Specify which definition type to list. If empty, all types will be searched. Valid types: scope, workflow-step, component, trait, policy, workload ``` ### Options inherited from parent commands diff --git a/versioned_docs/version-v1.5/how-to/dashboard/config/helm-repo.md b/versioned_docs/version-v1.5/how-to/dashboard/config/helm-repo.md index 54de002f..54ad9530 100644 --- a/versioned_docs/version-v1.5/how-to/dashboard/config/helm-repo.md +++ b/versioned_docs/version-v1.5/how-to/dashboard/config/helm-repo.md @@ -1,5 +1,5 @@ --- -title: Helm repository +title: Connect Helm Repository description: Configure a helm repository --- diff --git a/versioned_docs/version-v1.5/how-to/dashboard/config/image-registry.md b/versioned_docs/version-v1.5/how-to/dashboard/config/image-registry.md index eab38bb5..bf526745 100644 --- a/versioned_docs/version-v1.5/how-to/dashboard/config/image-registry.md +++ b/versioned_docs/version-v1.5/how-to/dashboard/config/image-registry.md @@ -1,5 +1,5 @@ --- -title: Image Registry +title: Connect Image Registry description: Configure an image registry --- diff --git a/versioned_docs/version-v1.5/platform-engineers/policy/custom-policy.md b/versioned_docs/version-v1.5/platform-engineers/policy/custom-policy.md index 85935e4d..14d31d33 100644 --- a/versioned_docs/version-v1.5/platform-engineers/policy/custom-policy.md +++ b/versioned_docs/version-v1.5/platform-engineers/policy/custom-policy.md @@ -30,7 +30,7 @@ template: { } ``` -The rule is align with component definition, you must specify `output`, while you can use `outputs` for more objects, the format as below: +The rule is aligned with component definition, you must specify `output`, while you can use `outputs` for more objects, the format as below: ```cue output: { diff --git a/versioned_docs/version-v1.5/platform-engineers/x-def-version.md b/versioned_docs/version-v1.5/platform-engineers/x-def-version.md index d73a1d77..9cbde9d6 100644 --- a/versioned_docs/version-v1.5/platform-engineers/x-def-version.md +++ b/versioned_docs/version-v1.5/platform-engineers/x-def-version.md @@ -61,6 +61,6 @@ spec: image: stefanprodan/podinfo:4.0.3 ``` -In this way, if system admin changes the ComponentDefinition, it won't affect your application. +In this way, if system admin changes the ComponentDefinition, it won't affect your application. If no revision specified, KubeVela will always use the latest revision when you upgrade your application. diff --git a/versioned_docs/version-v1.5/reference/addons/traefik.md b/versioned_docs/version-v1.5/reference/addons/traefik.md index 58f32c05..45d5f353 100644 --- a/versioned_docs/version-v1.5/reference/addons/traefik.md +++ b/versioned_docs/version-v1.5/reference/addons/traefik.md @@ -4,6 +4,127 @@ title: Traefik Traefik is a modern HTTP reverse proxy and load balancer made to deploy microservices with ease. you can use this addon as a cluster gateway or a microservices gateway. +## Install + +```bash +vela addon enable traefik +``` + +### Visit Traefik dashboard by port-forward + +Port forward will work as a proxy to allow visiting Traefik dashboard by local port. + +```bash +vela port-forward -n vela-system addon-traefik +``` + +expected output: + +```bash +Forwarding from 127.0.0.1:9000 -> 9000 +Forwarding from [::1]:9000 -> 9000 + +Forward successfully! Opening browser ... +Handling connection for 9000 +``` + +You can visiting Traefik dashboard with address `http://127.0.0.1:9000/dashboard/`. + +### Setup with Specified Service Type + +If your cluster has cloud LoadBalancer available: + +```bash +vela addon enable traefik serviceType=LoadBalancer +``` + +## How to use + +1. Configure a HTTP domain for a component. + +```bash +apiVersion: core.oam.dev/v1beta1 +kind: Application +metadata: + name: example + namespace: e2e-test +spec: + components: + - name: express-server + type: webservice + properties: + image: oamdev/hello-world + ports: + - port: 8000 + expose: true + traits: + - properties: + domains: + - example.domain.com + rules: + - path: + type: PathPrefix + value: / + port: 8080 + type: http-route +``` + +2. Configure a HTTPS domain for a component. + +You should create a secret that includes the certificate first. + +```yaml + +apiVersion: v1 +type: Opaque +data: + tls.crt: + tls.key: +kind: Secret +metadata: + annotations: + config.oam.dev/alias: "" + config.oam.dev/description: "" + labels: + config.oam.dev/catalog: velacore-config + config.oam.dev/multi-cluster: "true" + config.oam.dev/project: addons + config.oam.dev/type: config-tls-certificate + workload.oam.dev/type: config-tls-certificate + name: example +``` + +The example application configuration: + +```yaml +apiVersion: core.oam.dev/v1beta1 +kind: Application +metadata: + name: example-https + namespace: e2e-test +spec: + components: + - name: express-server + type: webservice + properties: + image: oamdev/hello-world + ports: + - port: 8000 + expose: true + traits: + - properties: + domains: + - example.domain.com + rules: + - path: + type: PathPrefix + value: / + port: 8080 + secrets: + - name: example + type: https-route +``` + ## Definitions ### http-route(trait) @@ -120,39 +241,4 @@ This component definition is designed to manage the TLS certificate Name | Description | Type | Required | Default ------------ | ------------- | ------------- | ------------- | ------------- cert | the certificate public key encrypted by base64 | string | true | - key | the certificate private key encrypted by base64 | string | true | - - -## Install - -```bash -vela addon enable traefik -``` - -### Visit Traefik dashboard by port-forward - -Port forward will work as a proxy to allow visiting Traefik dashboard by local port. - -```bash -vela port-forward -n vela-system addon-traefik -``` - -expected output: - -``` -Forwarding from 127.0.0.1:9000 -> 9000 -Forwarding from [::1]:9000 -> 9000 - -Forward successfully! Opening browser ... -Handling connection for 9000 -``` - -You can visiting Traefik dashboard with address `http://127.0.0.1:9000/dashboard/`. - -### Setup with Specified Service Type - -If your cluster has cloud LoadBalancer available: - -```bash -vela addon enable traefik serviceType=LoadBalancer -``` + key | the certificate private key encrypted by base64 | string | true | \ No newline at end of file diff --git a/versioned_docs/version-v1.5/tutorials/access-application.md b/versioned_docs/version-v1.5/tutorials/access-application.md index c81b5851..daa00555 100644 --- a/versioned_docs/version-v1.5/tutorials/access-application.md +++ b/versioned_docs/version-v1.5/tutorials/access-application.md @@ -1,5 +1,5 @@ --- -title: Access the application +title: Access Application --- After deploying the application, the next station is publishing your service. diff --git a/versioned_sidebars/version-v1.5-sidebars.json b/versioned_sidebars/version-v1.5-sidebars.json index 4f888713..a912415a 100644 --- a/versioned_sidebars/version-v1.5-sidebars.json +++ b/versioned_sidebars/version-v1.5-sidebars.json @@ -180,8 +180,7 @@ { "UX Customization": [ "platform-engineers/openapi-v3-json-schema", - "reference/ui-schema", - "reference/topology-rule" + "reference/ui-schema" ] } ] @@ -193,24 +192,18 @@ "items": [ "contributor/overview", { - "type": "category", - "label": "Extension", - "collapsed": true, - "items": [ - { - "Addons": [ - "platform-engineers/addon/intro", - "platform-engineers/addon/addon-cue", - "platform-engineers/addon/addon-yaml", - "platform-engineers/addon/addon-registry" - ] - }, - { - "Cloud Resources": [ - "platform-engineers/addon/terraform", - "platform-engineers/components/component-terraform" - ] - } + "Addons": [ + "platform-engineers/addon/intro", + "platform-engineers/addon/addon-cue", + "platform-engineers/addon/addon-yaml", + "reference/topology-rule", + "platform-engineers/addon/addon-registry" + ] + }, + { + "Cloud Resources": [ + "platform-engineers/addon/terraform", + "platform-engineers/components/component-terraform" ] }, {