Skip to content

Commit

Permalink
add node selector for lb svc gateway (#232)
Browse files Browse the repository at this point in the history
Signed-off-by: clyi <[email protected]>
  • Loading branch information
changluyi authored Dec 30, 2024
1 parent 17c929d commit e30f714
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
16 changes: 16 additions & 0 deletions docs/guide/loadbalancer-service.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,3 +330,19 @@ Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 MASQUERADE all -- * * 0.0.0.0/0 10.109.201.193
```

### Configure the `nodeSelector` for the LB Service Pod

You can specify the node where the LoadBalancer service gateway Pod is deployed by adjusting the `nodeSelector` in the `ovn-vpc-nat-config` ConfigMap.

```yaml
apiVersion: v1
data:
image: docker.io/kubeovn/vpc-nat-gateway:v1.14.0
nodeSelector: |
kubernetes.io/hostname: kube-ovn-control-plane
kubernetes.io/os: linux
kind: ConfigMap
metadata:
name: ovn-vpc-nat-config
namespace: kube-system
17 changes: 17 additions & 0 deletions docs/guide/loadbalancer-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,3 +330,20 @@ Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 MASQUERADE all -- * * 0.0.0.0/0 10.109.201.193
```

### 配置 lb service Pod 的 nodeSelector

可以通过调整 `ovn-vpc-nat-config` ConfigMap 中的 `nodeSelector` 来指定 LoadBalancer service 网关 Pod 部署的节点。

```yaml
apiVersion: v1
data:
image: docker.io/kubeovn/vpc-nat-gateway:v1.14.0
nodeSelector: |
kubernetes.io/hostname: kube-ovn-control-plane
kubernetes.io/os: linux
kind: ConfigMap
metadata:
name: ovn-vpc-nat-config
namespace: kube-system
```
4 changes: 3 additions & 1 deletion docs/guide/vpc.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Vlan and security policy in the underlying network device in advance.

### Enabling the VPC Gateway

VPC gateway functionality needs to be enabled via `ovn-vpc-nat-gw-config` under `kube-system`:
The VPC gateway functionality can be enabled by configuring the `ovn-vpc-nat-gw-config` in the `kube-system` namespace. The `nodeSelector` can be used to specify the node where the gateway is deployed:

```yaml
---
Expand All @@ -183,6 +183,8 @@ metadata:
namespace: kube-system
data:
image: docker.io/kubeovn/vpc-nat-gateway:{{ variables.version }}
nodeSelector: |
kubernetes.io/hostname: kube-ovn-control-plane
---
kind: ConfigMap
apiVersion: v1
Expand Down
4 changes: 3 additions & 1 deletion docs/guide/vpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ spec:

### 开启 VPC 网关功能

VPC 网关功能需要通过 `kube-system` 下的 `ovn-vpc-nat-gw-config` 开启
VPC 网关功能需要通过 `kube-system` 命名空间下的 `ovn-vpc-nat-gw-config` 配置开启,其中 `nodeSelector` 可以指定网关部署所在的节点

```yaml
---
Expand All @@ -179,6 +179,8 @@ metadata:
namespace: kube-system
data:
image: 'docker.io/kubeovn/vpc-nat-gateway:{{ variables.version }}'
nodeSelector: |
kubernetes.io/hostname: kube-ovn-control-plane
---
kind: ConfigMap
apiVersion: v1
Expand Down

0 comments on commit e30f714

Please sign in to comment.