governance: fixed governance examples problem. (#3113)

governance: fixed governance examples problem
pull/3121/head
Steve Rao 2 years ago committed by GitHub
parent c1034a020a
commit 1b2cbe44b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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:}
istiod-token: ${ISTIOD_TOKEN:}

@ -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
<dependency>
@ -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

@ -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
<dependency>
@ -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|
**HINTThe 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.**
**HINTThe 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

@ -63,6 +63,8 @@
<module>governance-example/label-routing-example/consumer-example</module>
<module>governance-example/label-routing-example/default-provider-version-example</module>
<module>governance-example/label-routing-example/provider-version-example</module>
<module>governance-example/authentication-example/istio-authentication-provider-mvc-example</module>
<module>governance-example/authentication-example/istio-authentication-provider-webflux-example</module>
</modules>

Loading…
Cancel
Save