From 1b2cbe44b76d71368c42cfa6c1cb173f0e1f2954 Mon Sep 17 00:00:00 2001 From: Steve Rao Date: Sun, 29 Jan 2023 10:07:47 +0800 Subject: [PATCH] governance: fixed governance examples problem. (#3113) governance: fixed governance examples problem --- .../src/main/resources/application.yml | 2 +- .../authentication-example/readme-zh.md | 8 ++++---- .../governance-example/authentication-example/readme.md | 6 +++--- spring-cloud-alibaba-examples/pom.xml | 2 ++ 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/spring-cloud-alibaba-examples/governance-example/authentication-example/istio-authentication-provider-mvc-example/src/main/resources/application.yml b/spring-cloud-alibaba-examples/governance-example/authentication-example/istio-authentication-provider-mvc-example/src/main/resources/application.yml index 1a509245b..d2ae0cbd9 100644 --- a/spring-cloud-alibaba-examples/governance-example/authentication-example/istio-authentication-provider-mvc-example/src/main/resources/application.yml +++ b/spring-cloud-alibaba-examples/governance-example/authentication-example/istio-authentication-provider-mvc-example/src/main/resources/application.yml @@ -12,4 +12,4 @@ spring: port: ${ISTIOD_PORT:15010} polling-pool-size: ${POLLING_POOL_SIZE:10} polling-time: ${POLLING_TIME:10} - istiod-token: ${ISTIOD_TOKEN:} \ No newline at end of file + istiod-token: ${ISTIOD_TOKEN:} diff --git a/spring-cloud-alibaba-examples/governance-example/authentication-example/readme-zh.md b/spring-cloud-alibaba-examples/governance-example/authentication-example/readme-zh.md index 294547c30..6ff92c603 100644 --- a/spring-cloud-alibaba-examples/governance-example/authentication-example/readme-zh.md +++ b/spring-cloud-alibaba-examples/governance-example/authentication-example/readme-zh.md @@ -2,7 +2,7 @@ ## 项目说明 -本项目演示如何使用 Istio 下发鉴权配置到Spring Cloud Alibaba并对应用做鉴权。Spring Cloud Alibaba鉴权模块同时支持对Spring MVC以及Spring WebFlux应用做鉴权。 +本项目演示如何使用 Istio 下发鉴权配置到Spring Cloud Alibaba(下文简称:SCA)并对应用做鉴权。SCA鉴权模块同时支持对Spring MVC以及Spring WebFlux应用做鉴权。 ## 准备 ### 安装K8s环境 @@ -17,7 +17,7 @@ ## 示例 ### 如何接入 在启动示例进行演示之前,先了解一下应用如何接入Istio并提供鉴权功能。 注意 本章节只是为了便于理解接入方式,本示例代码中已经完成接入工作,您无需再进行修改。 -1. 修改`pom.xml`文件,引入Istio规则Adapter以及Spring Cloud Alibaba鉴权模块: +1. 修改`pom.xml`文件,引入Istio规则Adapter以及SCA鉴权模块: ```xml @@ -67,11 +67,11 @@ spring: |POD_NAME|metadata.name| |NAMESPACE_NAME|metadata.namespace| -**注:您部署的应用所在的pod不需要被Istio执行自动注入,因为Spring Cloud Alibaba的各个治理模块将会被用来替代Envoy Proxy的各种功能。** +**注:您部署的应用所在的pod不需要被Istio执行自动注入,因为SCA的各个治理模块将会被用来替代Envoy Proxy的各种功能。** ### 效果演示 下面给出几个简单的鉴权规则配置的示例: #### IP黑白名单 -使用如下命令通过Istio下发一条鉴权规则至demo应用,这条规则的限制了访问该应用的来源IP: +使用如下命令通过Istio下发一条鉴权规则至demo应用,这条规则限制了访问该应用的来源IP: ```YAML kubectl apply -f - << EOF apiVersion: security.istio.io/v1beta1 diff --git a/spring-cloud-alibaba-examples/governance-example/authentication-example/readme.md b/spring-cloud-alibaba-examples/governance-example/authentication-example/readme.md index ea21114d9..8c43bde50 100644 --- a/spring-cloud-alibaba-examples/governance-example/authentication-example/readme.md +++ b/spring-cloud-alibaba-examples/governance-example/authentication-example/readme.md @@ -2,7 +2,7 @@ ## Project Instruction -This project demonstrates how to use Istio to publish authentication config to Spring Cloud Alibaba application and use the config to do authentication. The Spring Cloud Alibaba authentication module supports authentication of Spring MVC and Spring WebFlux applications. +This project demonstrates how to use Istio to publish authentication config to Spring Cloud Alibaba (SCA) application and use the config to do authentication. The SCA authentication module supports authentication of Spring MVC and Spring WebFlux applications. ## Preparation ### Install K8s @@ -17,7 +17,7 @@ Please refer to [install](https://istio.io/latest/zh/docs/setup/install/) chapte ## Demo ### Connect to Istio Before launching the example for demonstration, let's look at how a Spring Cloud application accesses Istio and provides authentication. This section is only for you to understand how to use it. The config has been filled in this example and you may not need to modify it. -1. Modify `pom.xml` to introduce Istio resource transform and Spring Cloud Alibaba authentication module: +1. Modify `pom.xml` to introduce Istio resource transform and SCA authentication module: ```xml @@ -68,7 +68,7 @@ Note that the application runs in the K8s environment, and the application in th |POD_NAME|metadata.name| |NAMESPACE_NAME|metadata.namespace| -**HINT:The POD in which your deployed application does not need to be automatically injected by Istio because the various governance modules of Spring Cloud Alibaba will be used to replace the functions of the Envoy Proxy.** +**HINT:The POD in which your deployed application does not need to be automatically injected by Istio because the various governance modules of SCA will be used to replace the functions of the Envoy Proxy.** ### Demostration The following are some simple examples of authentication rule configurations: #### IP Blocks diff --git a/spring-cloud-alibaba-examples/pom.xml b/spring-cloud-alibaba-examples/pom.xml index b1d0b679e..ca6b3a007 100644 --- a/spring-cloud-alibaba-examples/pom.xml +++ b/spring-cloud-alibaba-examples/pom.xml @@ -63,6 +63,8 @@ governance-example/label-routing-example/consumer-example governance-example/label-routing-example/default-provider-version-example governance-example/label-routing-example/provider-version-example + governance-example/authentication-example/istio-authentication-provider-mvc-example + governance-example/authentication-example/istio-authentication-provider-webflux-example