安装 K8S, Bigip, Gateway API 测试环境 (2)

网络拓扑

在这里插入图片描述

BigIP 配置 vxlan tunnel

1. 将 data interface 配置上 vlan 和 self IP 地址,确保数据口 self IP 可以正常联通:

在这里插入图片描述
在这里插入图片描述

2. 创建 vxlan profile:
在这里插入图片描述

3. 创建 tunnel 将 vxlan profile 绑定到 data selfip(local Address) 上,用来做 overlay。tunnel 的 key 即是 vxlan 的 id,这里得对映之前 k8s 中 flannel 的 vxlan ID。

在这里插入图片描述

4. 创建 bigip underlay 网络接口:
BigIP 上添加一个 self IP 作为 vxlan 的 underlay 网络流量的出入口。

selfip 作为一个流量出入口,它的 netmask 必须保证 k8s 中其他 node 的 underlay 网络访流量都可以问到,所以和 flannel 部署时指定的管理网段一样为 /16

selfip 的 IP Address 最好选择和其他 node 不会冲突的任意 IP (IP 地址需要在 Flannel 管理范围内)。

比如这里配置的 IP Address: 10.200.3.1, Netmask:255.255.0.0

注意:k8s 集群中,flannel interface (每台 node 上 flannel.1 名称的 interface) 使用的是 32 位 netmask,但是配置 self IP 不支持,所以不能模仿 k8s flannel 方式配置成 32 位。

Specifies the full netmask. Network prefix lengths (CIDR) are not supported

配置完 IP 和 NETMASK 后,需要绑定上一步创建的 vxlan tunnel profile。
在这里插入图片描述

配置完成后 bigip 机器上会有两个 selfip IP,一个是 overlay,一个是 underlay:
在这里插入图片描述

k8s 集群上添加 BigIP 设备 (k8s master node)

完成 BigIP 设备配置后,需要将 BigIP 设备作为一个 node 加入 k8s 集群。Node resource 的 yaml 文件如下:

# [root@vxlan-k8s ~]# cat flannel-node.yaml
apiVersion: v1
kind: Node
metadata:
  name: bigip1
  annotations:
    # Replace IP with Self-IP for your deployment
    flannel.alpha.coreos.com/public-ip: "10.110.10.10"
    # uncomment the following line if using v6 tunnel and modify bigip v6 address
    # flannel.alpha.coreos.com/public-ipv6: "2021:15::125"
    # Replace MAC with your BIGIP Flannel VXLAN Tunnel MAC
    flannel.alpha.coreos.com/backend-data: '{"VtepMAC":"fa:16:3e:0f:6d:4f"}'
    # uncomment the following line if using v6 tunnel and modify mac accordingly
    # flannel.alpha.coreos.com/backend-v6-data: '{"VtepMAC":"fa:16:3e:d5:28:07"}'
    flannel.alpha.coreos.com/backend-type: "vxlan"
    flannel.alpha.coreos.com/kube-subnet-manager: "true"
spec:
  # Replace Subnet with your BIGIP Flannel Subnet
  podCIDR: "10.200.3.0/24"
  # uncomment the following 3 lines if using v6 tunnel and modify CIDRs using real data
  #podCIDRs:
  #- "10.42.20.0/24"
  #- "2021:118:2:2::/64"
  • flannel.alpha.coreos.com/public-ip: 数据口的 overlay selfip

  • flannel.alpha.coreos.com/backend-data: 创建完 vxlan tunnel,绑定 underlay IP 后,BigIP 会虚拟出来一个和 vxlan tunnel 同名的 interface,将那个 interface 的 MAC 地址配置在此处。
    在这里插入图片描述

  • podCIDR: BigIP underlay 的 selfip 地址。注意这里是遵循 flannel 的管理,netmask 需要配置成 /24。但是在 BigIP 上位了所有流量出入 selfip 的 netmask 配置成/16

定义完 node yaml 后,在 master 节点运行 kubectl apply -f flannel-node.yaml。最终可以看到 bigip node 虽然是 NotReady 状态,但是已经加入 k8s 集群。

[root@vxlan-k8s ~]# kubectl get nodes
NAME                           STATUS     ROLES           AGE   VERSION
bigip1                         NotReady   <none>          21d
vxlan-k8s.pdsea.f5net.com      Ready      control-plane   21d   v1.26.1
vxlan-test-1.pdsea.f5net.com   Ready      <none>          21d   v1.26.1
vxlan-test-2.pdsea.f5net.com   Ready      <none>          21d   v1.26.1

测试使用

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值