Skip to content

Commit d2f25eb

Browse files
committed
Merge branch 'master' of https://github.com/dotnetcore/CAP
2 parents 0e5fa19 + 899e4a2 commit d2f25eb

36 files changed

+978
-604
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,7 @@ public void ShowTime2(DateTime datetime)
247247
}
248248

249249
```
250-
`ShowTime1` and `ShowTime2` will be called one after another because all received messages are processed linear.
251-
You can change that behaviour to set `UseDispatchingPerGroup` true.
250+
`ShowTime1` and `ShowTime2` will be called at the same time.
252251

253252
BTW, You can specify the default group name in the configuration:
254253

README.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ public void ShowTime2(DateTime datetime)
248248

249249
```
250250

251-
`ShowTime1``ShowTime2` 处于不同的组,他们在默认情况下被线性的接连调用,你可以通过设置`UseDispatchingPerGroup`为true来使两者互不影响的同时调用
251+
`ShowTime1``ShowTime2` 将被同时调用
252252

253253
PS,你可以通过下面的方式来指定默认的消费者组名称:
254254

build/version.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
33
<VersionMajor>8</VersionMajor>
4-
<VersionMinor>2</VersionMinor>
4+
<VersionMinor>3</VersionMinor>
55
<VersionPatch>0</VersionPatch>
66
<VersionQuality></VersionQuality>
77
<VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix>

docs/content/user-guide/en/monitoring/kubernetes.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,25 @@ services.AddCap(x =>
1818

1919
```
2020

21+
## UseK8sDiscovery Configuration
22+
23+
This configuration option is used to configure the Dashboard/Nodes to list every K8s `service` by default. If this is set to `True` then only services with the `dotnetcore.cap.visibility: show` label will be listed. More information on labels will be found on the **Kubernetes Labels Configuration** section.
24+
25+
* ShowOnlyExplicitVisibleNodes
26+
27+
> Default :false
28+
29+
30+
```cs
31+
services.AddCap(x =>
32+
{
33+
// ...
34+
x.UseK8sDiscovery(opt=>{
35+
opt.ShowOnlyExplicitVisibleNodes = true;
36+
});
37+
});
38+
```
39+
2140
The component will automatically detect whether it is inside the cluster. If it is inside the cluster, the Pod must be granted Kubernetes Api permissions. Refer to the next section.
2241

2342
## Assign Pod Access to Kubernetes Api
@@ -90,6 +109,67 @@ spec:
90109
targetPort: 80
91110
```
92111

112+
From version `8.3.0` and onwards you can use a `Role` instead of `ClusterRole` to allow discovery of services only inside the namespace that the dashboard is running. Kubernetes Roles has limited jurisdiction inside the namespace. In the above example just remove ClusterRole and ClusterRoleBinding and instead use the following:
113+
114+
```
115+
apiVersion: rbac.authorization.k8s.io/v1
116+
kind: Role
117+
metadata:
118+
name: ns-svc-reader
119+
rules:
120+
- apiGroups: [""]
121+
resources: ["services"]
122+
verbs: ["get", "watch", "list"]
123+
124+
---
125+
apiVersion: rbac.authorization.k8s.io/v1
126+
kind: ClusterRoleBinding
127+
metadata:
128+
name: read-pods
129+
subjects:
130+
- kind: ServiceAccount
131+
name: api-access
132+
namespace: default
133+
roleRef:
134+
kind: ClusterRole
135+
name: ns-svc-reader
136+
apiGroup: rbac.authorization.k8s.io
137+
138+
```
139+
140+
## Kubernetes Labels Configuration
141+
142+
The list of Nodes showed in the dashboard can be controlled by adding labels to the to your kubernetes services.
143+
144+
145+
- `dotnetcore.cap.visibility` label is used to show or hide a service from the list.
146+
147+
> Allowed Values: show | hide
148+
149+
> Examples: `dotnetcore.cap.visibility: show` or `dotnetcore.cap.visibility: hide`
150+
151+
By default every k8s service is listed with the first port found in the service. However if more ports are present on the service you can select the wanted by using the following labels:
152+
153+
- `dotnetcore.cap.portName` label is used to filter the wanted port of the service.
154+
155+
> Allowed Values: string
156+
157+
> Examples: `dotnetcore.cap.portName: grpc` or `dotnetcore.cap.portName: http`
158+
159+
If not found any port with the given name, it will try to match the next label portIndex
160+
161+
- `dotnetcore.cap.portIndex` label is used to filter the wanted port of the service. This filter is taken into consideration only if no label portName is set or a non matching portName is set.
162+
163+
> Allowed Values: number represented as string ex: '2' or '14'
164+
165+
> Examples: `dotnetcore.cap.portIndex: '1'` or `dotnetcore.cap.portIndex: '3'`
166+
167+
If the provided index is outside of bounds then it will fallback to the first port (index:0)
168+
169+
170+
171+
172+
93173
## Using Dashboard Standalone
94174

95175
You can use the Dashboard standalone without configuring CAP, in this case, the Dashboard can be deployed as a separate Pod in the Kubernetes cluster just for data viewing. The service to be viewed no longer needs to configure the `cap.UseK8sDiscovery()` option.

docs/content/user-guide/en/transport/rabbitmq.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ VirtualHost | Broker virtual host | string | /
5050
Port | Port | int | -1
5151
ExchangeName | Default exchange name | string | cap.default.topic
5252
QueueArguments | Extra queue `x-arguments` | QueueArgumentsOptions | N/A
53+
QueueOptions | Change Options for created queue | QueueRabbitOptions | { Durable=true, Exclusive=false, AutoDelete=false }
5354
ConnectionFactoryOptions | RabbitMQClient native connection options | ConnectionFactory | N/A
5455
CustomHeadersBuilder | Custom subscribe headers | See the blow | N/A
5556
PublishConfirms | Enable [publish confirms](https://www.rabbitmq.com/confirms.html#publisher-confirms) | bool | false

docs/content/user-guide/zh/monitoring/kubernetes.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,25 @@ services.AddCap(x =>
1818

1919
```
2020

21+
## 使用K8sDiscovery配置
22+
23+
此配置选项用于配置仪表板/节点以默认列出每个 K8s `service` 。如果将此设置为 `true`,则只会列出带有`dotnetcore.cap.visibility: show` 标签的服务。有关标签的更多信息可以在 **Kubernetes 标签配置** 部分找到。
24+
25+
* ShowOnlyExplicitVisibleNodes
26+
27+
> 默认值:false
28+
29+
30+
```cs
31+
services.AddCap(x =>
32+
{
33+
// ...
34+
x.UseK8sDiscovery(opt=>{
35+
opt.ShowOnlyExplicitVisibleNodes = true;
36+
});
37+
});
38+
```
39+
2140
组件将会自动检测是否处于集群内部,如果处于集群内部在需要赋予Pod Kubernetes Api 的权限。参考下一章节。
2241

2342
## 分配 Pod 访问 Kubernetes Api
@@ -90,6 +109,65 @@ spec:
90109
targetPort: 80
91110
```
92111

112+
从版本 `8.3.0` 及更高版本,您可以使用 `Role` 而不是 `ClusterRole`,以允许仅在仪表板运行的命名空间内发现服务。 Kubernetes 角色在命名空间内拥有有限的管辖权。在上面的示例中,只需删除 ClusterRole 和 ClusterRoleBinding 并改为使用以下内容
113+
114+
```
115+
apiVersion: rbac.authorization.k8s.io/v1
116+
kind: Role
117+
metadata:
118+
name: ns-svc-reader
119+
rules:
120+
- apiGroups: [""]
121+
resources: ["services"]
122+
verbs: ["get", "watch", "list"]
123+
124+
---
125+
apiVersion: rbac.authorization.k8s.io/v1
126+
kind: ClusterRoleBinding
127+
metadata:
128+
name: read-pods
129+
subjects:
130+
- kind: ServiceAccount
131+
name: api-access
132+
namespace: default
133+
roleRef:
134+
kind: ClusterRole
135+
name: ns-svc-reader
136+
apiGroup: rbac.authorization.k8s.io
137+
138+
```
139+
140+
## Kubernetes 标签配置
141+
142+
可以通过向 kubernetes 服务添加标签来控制仪表板中显示的节点列表。
143+
144+
145+
- `dotnetcore.cap.visibility` 标签用于显示或隐藏列表中的服务。
146+
147+
> 可能的值: show | hide
148+
149+
> 示例: `dotnetcore.cap.visibility: show` or `dotnetcore.cap.visibility: hide`
150+
151+
默认情况下,每个 k8s 服务都会列出该服务中找到的第一个端口。但是,如果服务上存在更多端口,您可以使用以下标签选择所需的端口:
152+
153+
- `dotnetcore.cap.portName` 标签用于过滤需要的服务端口。
154+
155+
> 可能的值: string
156+
157+
> 示例: `dotnetcore.cap.portName: grpc` or `dotnetcore.cap.portName: http`
158+
159+
If not found any port with the given name, it will try to match the next label portIndex
160+
161+
- `dotnetcore.cap.portIndex` 标签用于过滤需要的服务端口。 仅当未设置标签 portName 或设置不匹配的 portName 时,才会考虑此过滤器。
162+
163+
> 可能的值: 数字表示为字符串 ex: '2' or '14'
164+
165+
> 示例: `dotnetcore.cap.portIndex: '1'` or `dotnetcore.cap.portIndex: '3'`
166+
167+
如果提供的索引超出范围,那么它将回退到第一个端口(索引:0)
168+
169+
170+
93171
## 独立使用 Dashboard
94172

95173
你可以独立使用 Dashboard 而不需要配置CAP,此时相当于 Dashboard 可作为单独的 Pod 部署到 Kubernetes 集群中仅用作查看数据,待查看的服务不再需要配置 `cap.UseK8sDiscovery()` 配置项。

docs/content/user-guide/zh/transport/rabbitmq.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ VirtualHost | 虚拟主机 | string | /
5151
Port | 端口号 | int | -1
5252
ExchangeName | CAP默认Exchange名称 | string | cap.default.topic
5353
QueueArguments | 队列额外参数 x-arguments | QueueArgumentsOptions | N/A
54+
QueueOptions | 更改已创建队列的选项 | QueueRabbitOptions | { Durable=true, Exclusive=false, AutoDelete=false }
5455
ConnectionFactoryOptions | RabbitMQClient原生参数 | ConnectionFactory | N/A
5556
CustomHeadersBuilder | 订阅者自定义头信息 | 见下文 | N/A
5657
PublishConfirms | 是否启用[发布确认](https://www.rabbitmq.com/confirms.html#publisher-confirms) | bool | false

src/DotNetCore.CAP.AmazonSQS/DotNetCore.CAP.AmazonSQS.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="AWSSDK.SimpleNotificationService" Version="3.7.300.24" />
16-
<PackageReference Include="AWSSDK.SQS" Version="3.7.300.24" />
15+
<PackageReference Include="AWSSDK.SimpleNotificationService" Version="3.7.400.25" />
16+
<PackageReference Include="AWSSDK.SQS" Version="3.7.400.25" />
1717
</ItemGroup>
1818

1919
<ItemGroup>

src/DotNetCore.CAP.AzureServiceBus/DotNetCore.CAP.AzureServiceBus.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<None Remove="System.Linq.Async" />
1818
</ItemGroup>
1919
<ItemGroup>
20-
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.17.0" />
20+
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.18.1" />
2121
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
2222
</ItemGroup>
2323
<ItemGroup>

src/DotNetCore.CAP.Dashboard.K8s/DotNetCore.CAP.Dashboard.K8s.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Nullable>enable</Nullable>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageReference Include="KubernetesClient" Version="12.1.1" />
8+
<PackageReference Include="KubernetesClient" Version="15.0.1" />
99
</ItemGroup>
1010
<ItemGroup>
1111
<ProjectReference Include="..\DotNetCore.CAP.Dashboard\DotNetCore.CAP.Dashboard.csproj" />

0 commit comments

Comments
 (0)