From f4b50ca91315bcf2f2941e51779b95fbcacf8854 Mon Sep 17 00:00:00 2001 From: AlphaBaby Date: Mon, 21 Oct 2024 12:18:17 +0800 Subject: [PATCH] opt quick start doc (#776) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * opt quick start doc * fix lint * Update site/content/en/docs/getting-started/quick_start.md Co-authored-by: 罗泽轩 * Update site/content/en/docs/getting-started/quick_start.md Co-authored-by: 罗泽轩 --------- Co-authored-by: 罗泽轩 --- controller/go.sum | 8 +- e2e/go.mod | 2 +- e2e/go.sum | 12 +-- plugins/go.sum | 8 +- .../en/docs/getting-started/quick_start.md | 77 +++++++++++++++++++ .../docs/getting-started/quick_start.md | 77 +++++++++++++++++++ types/go.sum | 4 +- 7 files changed, 171 insertions(+), 17 deletions(-) diff --git a/controller/go.sum b/controller/go.sum index d9b2b9e4..826d29f5 100644 --- a/controller/go.sum +++ b/controller/go.sum @@ -587,10 +587,10 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -mosn.io/htnn/api v0.4.0 h1:LAvDpTQlBQWX+O/hpYex5wcZeem5AZVD8ceAywUPG/Y= -mosn.io/htnn/api v0.4.0/go.mod h1:LuQVGTOQos5tOLl7c+z4ukFO1eOfm/Q3GNQ+8OnlIhE= -mosn.io/htnn/types v0.4.0 h1:HM/Oc0UTr18X9nbu2bY3+KJ7otY4OYMo6uMnTZOqo/0= -mosn.io/htnn/types v0.4.0/go.mod h1:YOL3isYyKslxC4h5JDwaWt6E504Q9gKITfJP3NMm7ls= +mosn.io/htnn/api v0.4.1 h1:8WJWk4u384wwDN8C49AKyqAZmp4isxhnnbiF9y9SJgs= +mosn.io/htnn/api v0.4.1/go.mod h1:LuQVGTOQos5tOLl7c+z4ukFO1eOfm/Q3GNQ+8OnlIhE= +mosn.io/htnn/types v0.4.1 h1:16UWyECDM7cIi4rBlBSYAtud/HSN4WYVPmL3fNYqmFc= +mosn.io/htnn/types v0.4.1/go.mod h1:MOXUQ/TfUrrgrPsfrXapyxwJ3nonhVeXRiXKgqU7a6s= sigs.k8s.io/controller-runtime v0.17.3 h1:65QmN7r3FWgTxDMz9fvGnO1kbf2nu+acg9p2R9oYYYk= sigs.k8s.io/controller-runtime v0.17.3/go.mod h1:N0jpP5Lo7lMTF9aL56Z/B2oWBJjey6StQM0jRbKQXtY= sigs.k8s.io/gateway-api v1.0.0 h1:iPTStSv41+d9p0xFydll6d7f7MOBGuqXM6p2/zVYMAs= diff --git a/e2e/go.mod b/e2e/go.mod index a6a49af8..611e02d9 100644 --- a/e2e/go.mod +++ b/e2e/go.mod @@ -75,7 +75,7 @@ require ( k8s.io/klog/v2 v2.110.1 // indirect k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect - mosn.io/htnn/api v0.4.0 // indirect + mosn.io/htnn/api v0.4.1 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/yaml v1.4.0 // indirect diff --git a/e2e/go.sum b/e2e/go.sum index 2a9c7759..de774e2e 100644 --- a/e2e/go.sum +++ b/e2e/go.sum @@ -243,12 +243,12 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -mosn.io/htnn/api v0.4.0 h1:LAvDpTQlBQWX+O/hpYex5wcZeem5AZVD8ceAywUPG/Y= -mosn.io/htnn/api v0.4.0/go.mod h1:LuQVGTOQos5tOLl7c+z4ukFO1eOfm/Q3GNQ+8OnlIhE= -mosn.io/htnn/controller v0.4.0 h1:XlVAgrhiIciWD+E4gTxexE6tMBrJp5y5Bd5oTbq4ThI= -mosn.io/htnn/controller v0.4.0/go.mod h1:U5LwSarrwoYl6gN8LmXs3ogUpGFfdO32dcfV+Quoy9A= -mosn.io/htnn/types v0.4.0 h1:HM/Oc0UTr18X9nbu2bY3+KJ7otY4OYMo6uMnTZOqo/0= -mosn.io/htnn/types v0.4.0/go.mod h1:YOL3isYyKslxC4h5JDwaWt6E504Q9gKITfJP3NMm7ls= +mosn.io/htnn/api v0.4.1 h1:8WJWk4u384wwDN8C49AKyqAZmp4isxhnnbiF9y9SJgs= +mosn.io/htnn/api v0.4.1/go.mod h1:LuQVGTOQos5tOLl7c+z4ukFO1eOfm/Q3GNQ+8OnlIhE= +mosn.io/htnn/controller v0.4.1 h1:WN5j4VVxOUG9PBUhCpIX3SJuRLSKnEKpDvt/WF29YjQ= +mosn.io/htnn/controller v0.4.1/go.mod h1:4za5ACW1PZJw+Ovhkzx2tBQbTqxUKi7HVgnz4imIyhk= +mosn.io/htnn/types v0.4.1 h1:16UWyECDM7cIi4rBlBSYAtud/HSN4WYVPmL3fNYqmFc= +mosn.io/htnn/types v0.4.1/go.mod h1:MOXUQ/TfUrrgrPsfrXapyxwJ3nonhVeXRiXKgqU7a6s= sigs.k8s.io/controller-runtime v0.17.3 h1:65QmN7r3FWgTxDMz9fvGnO1kbf2nu+acg9p2R9oYYYk= sigs.k8s.io/controller-runtime v0.17.3/go.mod h1:N0jpP5Lo7lMTF9aL56Z/B2oWBJjey6StQM0jRbKQXtY= sigs.k8s.io/gateway-api v1.0.0 h1:iPTStSv41+d9p0xFydll6d7f7MOBGuqXM6p2/zVYMAs= diff --git a/plugins/go.sum b/plugins/go.sum index 20302d76..449fb955 100644 --- a/plugins/go.sum +++ b/plugins/go.sum @@ -251,9 +251,9 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -mosn.io/htnn/api v0.4.0 h1:LAvDpTQlBQWX+O/hpYex5wcZeem5AZVD8ceAywUPG/Y= -mosn.io/htnn/api v0.4.0/go.mod h1:LuQVGTOQos5tOLl7c+z4ukFO1eOfm/Q3GNQ+8OnlIhE= -mosn.io/htnn/types v0.4.0 h1:HM/Oc0UTr18X9nbu2bY3+KJ7otY4OYMo6uMnTZOqo/0= -mosn.io/htnn/types v0.4.0/go.mod h1:YOL3isYyKslxC4h5JDwaWt6E504Q9gKITfJP3NMm7ls= +mosn.io/htnn/api v0.4.1 h1:8WJWk4u384wwDN8C49AKyqAZmp4isxhnnbiF9y9SJgs= +mosn.io/htnn/api v0.4.1/go.mod h1:LuQVGTOQos5tOLl7c+z4ukFO1eOfm/Q3GNQ+8OnlIhE= +mosn.io/htnn/types v0.4.1 h1:16UWyECDM7cIi4rBlBSYAtud/HSN4WYVPmL3fNYqmFc= +mosn.io/htnn/types v0.4.1/go.mod h1:MOXUQ/TfUrrgrPsfrXapyxwJ3nonhVeXRiXKgqU7a6s= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/site/content/en/docs/getting-started/quick_start.md b/site/content/en/docs/getting-started/quick_start.md index 0444f7ad..88cc723a 100644 --- a/site/content/en/docs/getting-started/quick_start.md +++ b/site/content/en/docs/getting-started/quick_start.md @@ -33,6 +33,44 @@ REVISION: 1 TEST SUITE: None ``` +Check the installed components: + +```shell +$ helm status htnn-controller -n istio-system ─╯ +NAME: htnn-controller +LAST DEPLOYED: Tue Oct 8 20:13:59 2024 +NAMESPACE: istio-system +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +To learn more about the release, try: + $ helm status htnn-controller -n istio-system + $ helm get all htnn-controller -n istio-system +``` + +Check the installed components by this command `helm get all htnn-controller -n istio-system` + +**Note**: we will install many resources in this step, please make sure you are in a clean k8s cluster or there will be no resource conflict. Here we will pull the `ghcr.io/mosn/htnn-controller` image, if there is a network problem, you need to configure the network proxy or manually download this image. + +```shell +$ kubectl get all -n istio-system ─╯ +NAME READY STATUS RESTARTS AGE +pod/istiod-586df46dcb-t25s2 1/1 Running 0 14h + +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +service/istiod ClusterIP 10.96.76.196 15010/TCP,15012/TCP,443/TCP,15014/TCP 14h + +NAME READY UP-TO-DATE AVAILABLE AGE +deployment.apps/istiod 1/1 1 1 14h + +NAME DESIRED CURRENT READY AGE +replicaset.apps/istiod-586df46dcb 1 1 1 14h + +NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE +horizontalpodautoscaler.autoscaling/istiod Deployment/istiod /80% 1 5 1 14h +``` + 3. Install the data plane component: ```shell @@ -49,6 +87,45 @@ TEST SUITE: None Here we have not used the `--wait` parameter, instead, we used the `kubectl wait` command to wait for the `istio-ingressgateway` deployment to complete. Because `kind` does not support LoadBalancer type of Service by default, the ExternalIP for Service `istio-ingressgateway` will remain in `Pending` status. This does not affect our hands-on experience. If you're interested in this, refer to the [kind official documentation](https://kind.sigs.k8s.io/docs/user/loadbalancer/) and consider installing metallb. +Check the installed components: + +```shell +$ helm status htnn-gateway -n istio-system ─╯ +NAME: htnn-gateway +LAST DEPLOYED: Tue Oct 8 17:02:12 2024 +NAMESPACE: istio-system +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +To learn more about the release, try: + $ helm status htnn-gateway -n istio-system + $ helm get all htnn-gateway -n istio-system +``` + +```shell +$ kubectl get all -n istio-system ─╯ +NAME READY STATUS RESTARTS AGE +pod/istio-ingressgateway-67d7cd6587-qv9vv 1/1 Running 0 14m +pod/istiod-586df46dcb-t25s2 1/1 Running 0 16h + +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +service/istio-ingressgateway LoadBalancer 10.96.96.229 15021:30251/TCP,80:31122/TCP,443:30790/TCP 21m +service/istiod ClusterIP 10.96.76.196 15010/TCP,15012/TCP,443/TCP,15014/TCP 16h + +NAME READY UP-TO-DATE AVAILABLE AGE +deployment.apps/istio-ingressgateway 1/1 1 1 21m +deployment.apps/istiod 1/1 1 1 16h + +NAME DESIRED CURRENT READY AGE +replicaset.apps/istio-ingressgateway-67d7cd6587 1 1 1 21m +replicaset.apps/istiod-586df46dcb 1 1 1 16h + +NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE +horizontalpodautoscaler.autoscaling/istio-ingressgateway Deployment/istio-ingressgateway /80% 1 5 1 21m +horizontalpodautoscaler.autoscaling/istiod Deployment/istiod /80% 1 5 1 16h +``` + ## Configuring Routes After installing HTNN, let's experience its features. diff --git a/site/content/zh-hans/docs/getting-started/quick_start.md b/site/content/zh-hans/docs/getting-started/quick_start.md index cb05769d..16a7067a 100644 --- a/site/content/zh-hans/docs/getting-started/quick_start.md +++ b/site/content/zh-hans/docs/getting-started/quick_start.md @@ -37,6 +37,44 @@ REVISION: 1 TEST SUITE: None ``` +查看安装的组件: + +```shell +$ helm status htnn-controller -n istio-system ─╯ +NAME: htnn-controller +LAST DEPLOYED: Tue Oct 8 20:13:59 2024 +NAMESPACE: istio-system +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +To learn more about the release, try: + $ helm status htnn-controller -n istio-system + $ helm get all htnn-controller -n istio-system +``` + +还可以通过该命令查看安装了哪些 k8s 资源 `helm get all htnn-controller -n istio-system` + +**注意**: 这里会部署很多资源,请确保你是一个干净 k8s 集群或者不会产生资源冲突。这里会拉取 `m.daocloud.io/ghcr.io/mosn/htnn-controller` 镜像,有可能会存在网络问题导致拉取失败,有必要请自行配置网络代理或者手动下载该镜像。 + +```shell +$ kubectl get all -n istio-system ─╯ +NAME READY STATUS RESTARTS AGE +pod/istiod-586df46dcb-t25s2 1/1 Running 0 14h + +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +service/istiod ClusterIP 10.96.76.196 15010/TCP,15012/TCP,443/TCP,15014/TCP 14h + +NAME READY UP-TO-DATE AVAILABLE AGE +deployment.apps/istiod 1/1 1 1 14h + +NAME DESIRED CURRENT READY AGE +replicaset.apps/istiod-586df46dcb 1 1 1 14h + +NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE +horizontalpodautoscaler.autoscaling/istiod Deployment/istiod /80% 1 5 1 14h +``` + 3. 安装数据面组件: ```shell @@ -53,6 +91,45 @@ TEST SUITE: None 这里我们没有使用 `--wait` 参数,而是使用 `kubectl wait` 命令等待 `istio-ingressgateway` 部署完成。因为 `kind` 默认不支持 LoadBalancer 类型的 Service,所以 Service `istio-ingressgateway` 的 ExternalIP 会一直处于 `Pending` 状态。这不影响我们的上手体验。如果你对此感兴趣,可以参考 [kind 官方文档](https://kind.sigs.k8s.io/docs/user/loadbalancer/) 以及安装 metallb。 +查看安装的组件: + +```shell +$ helm status htnn-gateway -n istio-system ─╯ +NAME: htnn-gateway +LAST DEPLOYED: Tue Oct 8 17:02:12 2024 +NAMESPACE: istio-system +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +To learn more about the release, try: + $ helm status htnn-gateway -n istio-system + $ helm get all htnn-gateway -n istio-system +``` + +```shell +$ kubectl get all -n istio-system ─╯ +NAME READY STATUS RESTARTS AGE +pod/istio-ingressgateway-67d7cd6587-qv9vv 1/1 Running 0 14m +pod/istiod-586df46dcb-t25s2 1/1 Running 0 16h + +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +service/istio-ingressgateway LoadBalancer 10.96.96.229 15021:30251/TCP,80:31122/TCP,443:30790/TCP 21m +service/istiod ClusterIP 10.96.76.196 15010/TCP,15012/TCP,443/TCP,15014/TCP 16h + +NAME READY UP-TO-DATE AVAILABLE AGE +deployment.apps/istio-ingressgateway 1/1 1 1 21m +deployment.apps/istiod 1/1 1 1 16h + +NAME DESIRED CURRENT READY AGE +replicaset.apps/istio-ingressgateway-67d7cd6587 1 1 1 21m +replicaset.apps/istiod-586df46dcb 1 1 1 16h + +NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE +horizontalpodautoscaler.autoscaling/istio-ingressgateway Deployment/istio-ingressgateway /80% 1 5 1 21m +horizontalpodautoscaler.autoscaling/istiod Deployment/istiod /80% 1 5 1 16h +``` + ## 配置路由 安装完 HTNN 后,让我们体验下它的功能。 diff --git a/types/go.sum b/types/go.sum index b71b03eb..cfd9b545 100644 --- a/types/go.sum +++ b/types/go.sum @@ -293,8 +293,8 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -mosn.io/htnn/api v0.4.0 h1:LAvDpTQlBQWX+O/hpYex5wcZeem5AZVD8ceAywUPG/Y= -mosn.io/htnn/api v0.4.0/go.mod h1:LuQVGTOQos5tOLl7c+z4ukFO1eOfm/Q3GNQ+8OnlIhE= +mosn.io/htnn/api v0.4.1 h1:8WJWk4u384wwDN8C49AKyqAZmp4isxhnnbiF9y9SJgs= +mosn.io/htnn/api v0.4.1/go.mod h1:LuQVGTOQos5tOLl7c+z4ukFO1eOfm/Q3GNQ+8OnlIhE= sigs.k8s.io/controller-runtime v0.17.3 h1:65QmN7r3FWgTxDMz9fvGnO1kbf2nu+acg9p2R9oYYYk= sigs.k8s.io/controller-runtime v0.17.3/go.mod h1:N0jpP5Lo7lMTF9aL56Z/B2oWBJjey6StQM0jRbKQXtY= sigs.k8s.io/gateway-api v1.0.0 h1:iPTStSv41+d9p0xFydll6d7f7MOBGuqXM6p2/zVYMAs=