※OpenShift v4.18 時点です
OCP作成後に追加Networkを作ってみる
OpenShiftのデフォルト以外のネットワークコンポーネントを一通り作って確認してみます。
5台の一般的な構成で、上位にvLB,そこからL3スイッチを挟んで別NWのサーバと通信できるか確認
構成
$ oc get node -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
worker01.internal Ready worker 173d v1.31.8 10.10.10.70 <none> Red Hat Enterprise Linux CoreOS 418.94.202505191717-0 5.14.0-427.68.2.el9_4.x86_64 cri-o://1.31.8-4.rhaos4.18.git2d48ec9.el9
worker02.internal Ready worker 173d v1.31.8 10.10.10.71 <none> Red Hat Enterprise Linux CoreOS 418.94.202505191717-0 5.14.0-427.68.2.el9_4.x86_64 cri-o://1.31.8-4.rhaos4.18.git2d48ec9.el9
master01.internal Ready control-plane,master 68d v1.31.8 10.10.10.67 <none> Red Hat Enterprise Linux CoreOS 418.94.202505191717-0 5.14.0-427.68.2.el9_4.x86_64 cri-o://1.31.8-4.rhaos4.18.git2d48ec9.el9
master02.internal Ready control-plane,master 173d v1.31.8 10.10.10.68 <none> Red Hat Enterprise Linux CoreOS 418.94.202505191717-0 5.14.0-427.68.2.el9_4.x86_64 cri-o://1.31.8-4.rhaos4.18.git2d48ec9.el9
master03.internal Ready control-plane,master 173d v1.31.8 10.10.10.69 <none> Red Hat Enterprise Linux CoreOS 418.94.202505191717-0 5.14.0-427.68.2.el9_4.x86_64 cri-o://1.31.8-4.rhaos4.18.git2d48ec9.el9
通信線は書いてませんが、
・server01 → vLB(Ingress用VS) → router Pod(HAProxy) → service-a(ClusterIP) → pod1 #L7通信
・server01 → vLB(Metallb用VS) → service-a(ExternalIP) → pod1
・pod2からデフォルトCNI → vLB → server01
・pod2からmultus → server01
を確認します。
手順
NMSTATE operator導入
multusを使用してpodに別IFで足出しさせるため、
まずはnmstate operatorを導入する。
以下のマニフェストを適用
apiVersion: v1
kind: Namespace
metadata:
labels:
kubernetes.io/metadata.name: openshift-nmstate
name: openshift-nmstate
name: openshift-nmstate
spec:
finalizers:
- kubernetes
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
annotations:
olm.providedAPIs: NMState.v1.nmstate.io
name: openshift-nmstate
namespace: openshift-nmstate
spec:
targetNamespaces:
- openshift-nmstate
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
labels:
operators.coreos.com/kubernetes-nmstate-operator.openshift-nmstate: ""
name: kubernetes-nmstate-operator
namespace: openshift-nmstate
spec:
channel: stable
installPlanApproval: Automatic
name: kubernetes-nmstate-operator
source: redhat-operators
sourceNamespace: openshift-marketplace
各リソースが正常に作成されたことを確認し、nmstateのCRを作成する。
apiVersion: nmstate.io/v1
kind: NMState
metadata:
name: nmstate01
spec: {}
ノードのNW設定
NodeNetworkConfigPolicyというCRを使い、CoreOSノード自体のNW周りの設定を行う。※直接ノードにログインして設定はNG
物理NICでbondingを組み、VLANIFを作成する。
※注意:MachineNetworkのアドレスが設定されているNICに対する設定は非推奨のため、OCPインストール時に設定すること。(NMStateConfigというCRで設定することになる。)
ここではインストール時にbond0およびbond0.100を設定済とする
apiVersion: nmstate.io/v1
kind: NodeNetworkConfigurationPolicy
metadata:
name: nncp-worker01.internal
spec:
nodeSelector:
kubernetes.io/hostname: worker01.internal
desiredState:
interfaces:
- name: bond1
description: Bonding ens1f1 and ens3f1
type: bond
state: up
link-aggregation:
mode: 802.3ad
port:
- ens1f1
- ens3f1
- name: bond1.1000
description: vlan using bond1
type: vlan
state: up
vlan:
base-iface: bond1
id: 1000
# ipv4:
# enabled: true
# address:
# - ip: xxx.xxx.xxx.xxx
# prefix-length: 26
# dhcp: false
# ipv6:
# enabled: false
# routes:
# config:
# - destination: 172.21.0.0/24
# next-hop-address: xxx.xxx.xxx.xxx
# next-hop-interface: bond1.1000
# table-id: 254
dns-resolver:
config:
server:
- xxx.xxx.xxx.xxx
- xxx.xxx.xxx.xxx
search:
- .internal
※アドレス付与やrouting、DNS参照先の設定も入れ込める。
node分作成する。少なくとも、Master/Workerそれぞれで同じ構成にする
以下コマンドでSuccessになっていればOK.
$ oc get nncp
NAME STATUS REASON
nncp-master01.internal Available SuccessfullyConfigured
nncp-master02.internal Available SuccessfullyConfigured
nncp-master03.internal Available SuccessfullyConfigured
nncp-worker01.internal Available SuccessfullyConfigured
nncp-worker02.internal Available SuccessfullyConfigured
実際のNodeごとのNetwork周りのステータスも確認できる
$ oc get nns
NAME AGE
master01.internal 9d
master02.internal 9d
master03.internal 9d
worker01.internal 9d
worker02 9d
NAD作成
podアタッチ用のネットワークを作成する。
NetworkAttachmentDefinitionリソースを作成する
apiVersion: operator.openshift.io/v1
kind: Network
metadata:
name: cluster
spec:
additionalNetworks:
- name: macvlan-net
namespace: default
type: Raw
rawCNIConfig:
'{
"cniVersion": "0.3.1",
"type": "macvlan",
"mode": "bridge",
"master": "bond1.1000",
"ipam": {
"type": "whereabouts",
"range": "172.21.0.160/27",
"range_start": "172.21.0.182",
"range_end": "172.21.0.185"
}
}'
以下コマンドで確認
$ oc get net-attach-def
multusで足出しするpodを作成する
apiVersion: apps/v1
kind: Deployment
metadata:
name: deploy2
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: deploy2
template:
metadata:
annotations:
k8s.v1.cni.cncf.io/networks: '[{"name":"macvlan-net","namespace":"default","interface":"eth1"}]' #作成したNADを指定する。interfaceはpod内でのIF名になる
labels:
app: deploy2
spec:
serviceAccountName: test-sa
containers:
- name: deploy2-pod
image: docker.io/centos/tools:latest
securityContext:
privileged: true
これで、作成されたpod内に入るとeth1に172.21.0.182が付与されており、直接外部と通信ができるようになります。
また、eth0にはデフォルトCNIのCluster-networkのアドレスも付いているため、そちらから外と通信することもできます。その場合、ノードのアドレスにNATされます。
MetalLB作成
Serviceを外部公開するため、MetalLBをデプロイします。
speakerpodはhostnetwork:trueの daemonsetsでデプロイされ、ノードのアドレスで待ち受けます。
そのうち1台が代表でARP応答することになります。
operatorを導入
apiVersion: v1
kind: Namespace
metadata:
name: metallb-system
labels:
openshift.io/cluster-monitoring: "true"
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: metallb-operatorgroup
namespace: metallb-system
spec:
targetNamespaces:
- metallb-system
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: metallb-operator
namespace: metallb-system
spec:
channel: stable
installPlanApproval: Automatic
name: metallb-operator
source: redhat-operators
sourceNamespace: openshift-marketplace
metallb CRを作成する
apiVersion: metallb.io/v1beta1
kind: MetalLB
metadata:
name: metallb
namespace: metallb-system
spec: {}
$ oc get metallb -n metallb-system
広報するaddresspoolを定義する
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: machinenetwork
namespace: metallb-system
spec:
addresses:
- 10.10.10.110 - 10.10.10.115
autoAssign: true
avoidBuggyIPs: false
$ oc get ipaddresspool -n metallb-system
L2広報するためのCRを作成する
poolで定義されたアドレスのARP要求が来たら、MetalLB speaker が選ばれたノード上で指定 interface(br-ex)から ARP/NDP 応答を返します(=そのIFのMACで応答)
そのため、ノード上にはpoolで定義されたアドレスとL2NWが同じアドレスが付与されている
=VIPはARP/NDPで広告可能なL2セグメントである必要があります。
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: machinenetwork
namespace: metallb-system
spec:
ipAddressPools:
- machinenetwork
interfaces:
- br-ex
loadbalancerタイプのserviceリソースを作成する
VIP 宛パケットがノードに届いた後は、
Linux カーネル → OVN → Service → Pod
という順で通信
apiVersion: v1
kind: Service
metadata:
name: service-a
namespace: default
spec:
type: LoadBalancer
selector:
app: test-nginx # ← Pod の label と一致
ports:
- port: 80
targetPort: 80
protocol: TCP
nginxのdeployment(Pod1)を作成する
apiVersion: apps/v1
kind: Deployment
metadata:
name: deploy1
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: test-nginx # ← (A)
template:
metadata:
labels:
app: test-nginx # ← (A) と一致させる
spec:
containers:
- name: nginx
image: docker.io/library/nginx:stable
ports:
- containerPort: 80
確認
EXTERNAL-IPに定義したpoolのアドレスレンジからアサインされている
$ oc get svc -n default -o wide
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
service-a LoadBalancer 192.168.217.185 10.10.10.110 80:31468/TCP 6d7h app=test-nginx
BGPモード
L2モードではなくBGPモードの場合、ipaddresspoolの定義までは同じ.
BGPピア設定
apiVersion: metallb.io/v1beta2
kind: BGPPeer
metadata:
name: router01
namespace: metallb-system
spec:
myASN: 64512
peerASN: 64513
peerAddress: 10.10.10.65
ピアを張る対向のNW機器には、以下のような設定が必要になる。
router bgp 64513
neighbor 10.10.10.70 remote-as 64512
広報設定用のリソースも少し異なる
apiVersion: metallb.io/v1beta1
kind: BGPAdvertisement
metadata:
name: external-bgp
namespace: metallb-system
spec:
ipAddressPools:
- machinenetwork
nodeSelectors:
- matchLabels:
node-role.kubernetes.io/worker: ""
NADのアドレスでMetallbを構成する場合
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: network-1000
namespace: metallb-system
spec:
addresses:
- 172.21.0.186 - 172.21.0.188
autoAssign: true
avoidBuggyIPs: false
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: network-1000
namespace: metallb-system
spec:
ipAddressPools:
- network-1000
interfaces:
- bond1.1000
たとえば、NAD側を参照するように、interfaces:bond1.1000を指定したmetallbを作成し、同様にloadbalancerタイプのservice-bを作成すると入口のIFを変えることが可能ですが、注意点があります。
当然、ノードのbond1.1000のIFにアドレスが付与されていることと、この場合、
loadbalancerService 作成
↓
MetalLB が bond1.1000のNW内で指定したipaddresspoolからVIP を割り当てる
↓
speaker が bond1.1000 で ARP 広報する
ここまでは成立し得ますが、外部から VIP に着弾した後に、
bond1.1000 で受信
↓
ノード内で Service / OVN 側へ転送
↓
endpointのPod eth0 へ配送
するには、OVN-Kubernetes 側でノードの IP forwarding が必要になります。
$ oc patch network.operator cluster -p '{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"gatewayConfig":{"ipForwarding": "Global"}}}}}' --type=merge
この設定により、Service 以降(kube-proxy → Pod)」の動きは同じです。
※multusではなくpod-networkが使われます。
なお、複数のmetallbがある場合、作成したserviceのEXTERNAL-IPがどれを使うのかは、リソース内のアノテーションで定義できます。
metadata:
annotations:
metallb.universe.tf/loadBalancerIPs: "10.10.10.110" #直接アドレスで指定できる他、pool指定も可
(補足)OVNの処理
Nodeがルータとして転送を許可するか
Linuxでいうところのsysctl net.ipv4.ip_forward=1 がノードに設定され、
IF間でトラフィックを転送するルーターとして機能するようになる
oc patch network.operator/cluster \
-p '{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"gatewayConfig":{"ipForwarding":"Global"}}}}}' \
--type merge
eth0 → Node →eth1 という転送を禁止するか許可するか。
Podから外へ出る通信を OVN が処理するか、Node(Linux Kernel) が処理するか
oc patch network.operator/cluster \
-p '{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"gatewayConfig":{"routingViaHost":true}}}}}' \
--type merge
・routingViaHost=false(デフォルト)
OVN がルーティングを担当するため、Node の ip routeは関与しません。
Egress トラフィックが専用ノードを経由してルーティングされるが、ノードのグループが同じゲートウェイを共有することを意味します。ホストを経由してルーティングされず、OVSはトラフィックをノード IP IFに直接出力します。
Pod
↓
OVN Gateway Router
↓
SNAT
↓
Node NIC
↓
外部
・routingViaHost=true
各Node の Linux routing が使われる動きです。
Egress トラフィックが Pod をホストするノード上の特定のローカルゲートウェイを経由してルーティングされることを意味します。Egress トラフィックはホストを経由してルーティングされ、このトラフィックはホストのルーティングテーブルに適用されます。
Pod
↓
OVN
↓
Host Network Stack
↓
ip route
↓
外部
Route(Ingress)
OpenShift の標準は Ingress Controller(openshift-ingress-operator が管理)で、外部公開は通常 Routeリソースを使います。
routeとIngressの違い
routeは、外部クライアントが名前でサービスにアクセスできるように、ホスト名でサービスを公開するOpenShift固有のもの。
ホスト名をサービスにマッピングすることで、外部クライアントはホスト名を使用してサービスにアクセスできます。routeで使用されるホスト名は、ルーターの IP アドレスに解決されます。
Ingressに比べて柔軟性が高い
Webアプリを公開するためのrouteの設定例
1. 新しいプロジェクトを作成する
$ oc new-project webapp-project
2. Web アプリケーションをデプロイ
$ oc new-app nodejs:12~https://github.com/sclorg/nodejs-ex.git --name=webapp
3. ルートを使用してサービスを公開
$ oc expose svc/webapp --hostname=webapp.example.com
4. TLS を使用してルートを保護
a. 証明書と鍵を使用して TLS シークレットを作成
$ oc create secret tls webapp-tls --cert=path/to/tls.crt --key=path/to/tls.key
b. TLS シークレットを使用するようにルートを更新
$ oc patch route/webapp -p '{"spec":{"tls":{"termination":"edge","certificate":"path/to/tls.crt","key":"path/to/tls.key"}}}'
Webアプリを公開するためのIngressの設定例
1. Ingress リソースを作成
Ingress Controller がクラスターにインストールされ、実行されていることを確認
2. Web アプリケーション用のサービスを作成します。まだ作成されていない場合は、アプリケーションをサービスとして公開
apiVersion: v1
kind: Service
metadata:
name: webapp-service
namespace: webapp-project
spec:
selector:
app: webapp
ports:
- protocol: TCP
port: 80
targetPort: 8080
3. Ingress リソースを作成
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: webapp-ingress
namespace: webapp-project
annotations:
kubernetes.io/ingress.class: "nginx"
spec:
rules:
- host: webapp.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: webapp-service
port:
number: 80
4. TLS を使用して Ingress を保護
a. 証明書と鍵を使用して TLS シークレットを作成
$ oc create secret tls webapp-tls --cert=path/to/tls.crt --key=path/to/tls.key -n webappproject
b. TLS シークレットを使用するように Ingress リソースを更新
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: webapp-ingress
namespace: webapp-project
spec:
tls: #1
- hosts:
- webapp.example.com
secretName: webapp-tls #2
rules:
- host: webapp.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: webapp-service
port:
number: 80
#1:TLSセクションでTLS設定を指定
#2:secretNameフィールドは、TLS証明書と鍵が含まれるKubernetesシークレットの名前
routeリソースを適用例
routerpodとは、IngressController が管理しているhaproxyのリソースであり、作成されたrouteリソースの記述に従ってL7のトラフィックを指定したserviceへ転送します
router Pod は hostNetwork で動く構成が一般的で、その場合 Pod IP 表示が node IP と同じになります。
ここが、k8sだとIngressControllerとして個別でデプロイする必要がある部分です。(OpenShiftはデフォルトで用意されています)
$ oc get all -n openshift-ingress -o wide
Warning: apps.openshift.io/v1 DeploymentConfig is deprecated in v4.14+, unavailable in v4.10000+
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
pod/router-default-5dbccb67f8-mqkxg 1/1 Running 0 48d 10.10.10.70 tl-ssc-svbh1011.telcocloud.internal <none> <none>
pod/router-default-5dbccb67f8-rmdd8 1/1 Running 0 48d 10.10.10.71 tl-ssc-svbh1012.telcocloud.internal <none> <none>
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
service/router-internal-default ClusterIP 192.168.219.211 <none> 80/TCP,443/TCP,1936/TCP 173d ingresscontroller.operator.openshift.io/deployment-ingresscontroller=default
NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR
deployment.apps/router-default 2/2 2 2 173d router quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:96b58aba2955036b3123fc3db4ad68c59fb8c2a1e01a5ea397c98fc6626ed2c7 ingresscontroller.operator.openshift.io/deployment-ingresscontroller=default
NAME DESIRED CURRENT READY AGE CONTAINERS IMAGES SELECTOR
replicaset.apps/router-default-5dbccb67f8 2 2 2 105d router quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:96b58aba2955036b3123fc3db4ad68c59fb8c2a1e01a5ea397c98fc6626ed2c7 ingresscontroller.operator.openshift.io/deployment-ingresscontroller=default,pod-template-hash=5dbccb67f8
replicaset.apps/router-default-ff794ff66 0 0 0 173d router quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:96b58aba2955036b3123fc3db4ad68c59fb8c2a1e01a5ea397c98fc6626ed2c7 ingresscontroller.operator.openshift.io/deployment-ingresscontroller=default,pod-template-hash=ff794ff66
Routeリソースの適用。ここはk8sでいうところのIngressリソースにあたる外部公開ルールです。
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: ingress-a
namespace: default
spec:
to:
kind: Service
name: service-a
port:
targetPort: 80
確認
$ oc get route -n default -o wide
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
ingress-a ingress-a-default.apps.ocp-cluster01.internal / service-a 80 None
Client
↓
外部LB / NodePort / hostNetwork(環境依存)
↓
router Pod (HAProxy)
↓
service-a (ClusterIP) #EXTERNAL-IPでは受けず通常のINTERNAL処理
↓
Pod (nginx-test)
という経路になる。
server01から以下コマンドで確認
$ curl -m1 http://172.21.0.176 -H 'host: ingress-a-default.apps.ocp-cluster01.internal'
OpenShiftのrouter(HAProxy)は、IPではなくHTTP HostヘッダでRoute を選ぶため、名前解決できなくてもHost ヘッダさえ正しければ Routeにマッチします。
外部LB設定
routerpodはworkernode上のいずれか2台のhostNetwork上で動作し、外部にL7通信の振り分けを行う必要があるため、BIGIPのvLBを使用することとします。
また本稿では、metallb経由とroute経由をvLBのVirtualServerを分ける形で振り分けるようにしています。
Virtual Server (metallb用)
vIP:172.21.0.175
pool member:
10.10.10.110
Virtual Server (OCP Ingress用)
vIP:172.21.0.176
pool member:
10.10.10.70
10.10.10.71
ltm snat /Common/ocp-snat {
origins 10.10.10.64/26
translation 172.21.0.179 }
MetalLB:外部入口が IP(10.10.10.110)。L2でVIPを名乗る。
Route/Ingress:外部入口が FQDN(*.apps.ocp-cluster01.internal)入口は routerPod(ingresscontroller)。
LBconfig例
BIGIP#1(base)
#TMSH-VERSION: 17.5.1
cm cert /Common/dtca-bundle.crt {
cache-path /config/filestore/files_d/Common_d/trust_certificate_d/:Common:dtca-bundle.crt_59555_1
checksum SHA1:1289:01d6daf0f8b47132d6d7f8977794f03f10be94bd
revision 1
}
cm cert /Common/dtca.crt {
cache-path /config/filestore/files_d/Common_d/trust_certificate_d/:Common:dtca.crt_59551_1
checksum SHA1:1289:01d6daf0f8b47132d6d7f8977794f03f10be94bd
revision 1
}
cm cert /Common/dtdi.crt {
cache-path /config/filestore/files_d/Common_d/trust_certificate_d/:Common:dtdi.crt_59547_3
checksum SHA1:1310:6c649c3760aee0ded4c38f9a50ded841757d4b4c
revision 3
}
cm device /Common/test-vlb01.internal {
active-modules { "Local Traffic Manager, VE-1G|ILVMPOM-DNCUDLD|Rate Shaping|APM, Limited|SSL, VE|Max Compression, VE|Exclusive Version, v17.1.X - 23.X|Anti-Virus Checks|Base Endpoint Security Checks|Firewall Checks|Network Access|Secure Virtual Keyboard|APM, Web Application|Machine Certificate Checks|Protected Workspace|Remote Desktop|App Tunnel" }
base-mac 08:32:36:68:ce:88
build 0.0.7
cert /Common/dtdi.crt
chassis-id ff74ec5f-e83b-1144-4ec6d8e09b57
configsync-ip 10.10.10.100
edition Final
hostname test-vlb01.internal
key /Common/dtdi.key
management-ip 192.168.1.100
marketing-name "BIG-IP Virtual Edition"
optional-modules { "Advanced Firewall Manager, VE-1G" "Advanced Policy Manager, VE, 1Gbps" "Advanced Protocols, VE" "Advanced Web Application Firewall, VE-1G" "App Mode (TMSH Only, No Root/Bash)" "ASM to AWF Upgrade, VE-1G" "Better to Best w/AWF Upgrade, 1Gbps" "BIG-IP VE, Multicast Routing" "BIG-IP VE, Privileged User Access, 100 Endpoints" "BIG-IP VE, Privileged User Access, 1000 Endpoints" "BIG-IP VE, Privileged User Access, 250 Endpoints" "BIG-IP VE, Privileged User Access, 50 Endpoints" "BIG-IP VE, Privileged User Access, 500 Endpoints" "BPEM-VE, ADD 1G" "CGN, ADD-VE, 1G" "DataSafe, VE-1G" "DNS and GTM (1K QPS), VE" "DNS and GTM (250 QPS), VE" "Dynamic Policy Provisioning, VE-1G" "External Interface and Network HSM, VE" "FIPS 140, BIG-IP VE-1G to 10G" "Intrusion Prevention System, VE-1G" "IP Intelligence, 1Yr, VE-1G/VE-3G/VE-5G" "IP Intelligence, 3Yr, VE-1G/VE-3G/VE-5G" "IPS, 1Yr, VE-1G / VE-3G / VE-5G" "IPS, 3Yr, VE-1G / VE-3G / VE-5G" "LTM to Best Bundle Upgrade, 1Gbps" "LTM to Better Bundle Upgrade, 1Gbps" "LTM, 1 Gbps -3 Gbps Upgrade" "PEM, ADD-VE, 1G" "Routing Bundle, VE" "SM2 ADD-ON, VE (25MBPS TO 10GBPS)" "SSL Orchestrator, VE (25MB/200MB/1G)" "Subscriber Discovery, VE-1G" "Threat Campaigns, 1Yr, VE-1G" "Threat Campaigns, 3Yr, VE-1G" "Traffic Classification, VE-1G" "URL Filtering, VE-25M-1G, 500 Sessions, 1Yr" "URL Filtering, VE-25M-1G, 500 Sessions, 3Yr" "VE SSL Compression Offload, Low" }
platform-id Z100
product BIG-IP
self-device true
time-zone America/Los_Angeles
unicast-address {
{
effective-ip 10.10.10.100
effective-port 1026
ip 10.10.10.100
}
{
effective-ip management-ip
effective-port 1026
ip management-ip
}
}
version 17.5.1
}
cm device /Common/test-vlb02.internal {
active-modules { "Local Traffic Manager, VE-1G|GHJTPBB-QGNZICZ|Rate Shaping|APM, Limited|SSL, VE|Max Compression, VE|Exclusive Version, v17.1.X - 23.X|Anti-Virus Checks|Base Endpoint Security Checks|Firewall Checks|Network Access|Secure Virtual Keyboard|APM, Web Application|Machine Certificate Checks|Protected Workspace|Remote Desktop|App Tunnel" }
base-mac 08:32:36:63:0e:6e
build 0.0.7
chassis-id 2e6dfd58-3b31-de45-7b5f9772d541
configsync-ip 10.10.10.101
edition Final
hostname test-vlb02.internal
management-ip 192.168.1.101
marketing-name "BIG-IP Virtual Edition"
optional-modules { "Advanced Firewall Manager, VE-1G" "Advanced Policy Manager, VE, 1Gbps" "Advanced Protocols, VE" "Advanced Web Application Firewall, VE-1G" "App Mode (TMSH Only, No Root/Bash)" "ASM to AWF Upgrade, VE-1G" "Better to Best w/AWF Upgrade, 1Gbps" "BIG-IP VE, Multicast Routing" "BIG-IP VE, Privileged User Access, 100 Endpoints" "BIG-IP VE, Privileged User Access, 1000 Endpoints" "BIG-IP VE, Privileged User Access, 250 Endpoints" "BIG-IP VE, Privileged User Access, 50 Endpoints" "BIG-IP VE, Privileged User Access, 500 Endpoints" "BPEM-VE, ADD 1G" "CGN, ADD-VE, 1G" "DataSafe, VE-1G" "DNS and GTM (1K QPS), VE" "DNS and GTM (250 QPS), VE" "Dynamic Policy Provisioning, VE-1G" "External Interface and Network HSM, VE" "FIPS 140, BIG-IP VE-1G to 10G" "Intrusion Prevention System, VE-1G" "IP Intelligence, 1Yr, VE-1G/VE-3G/VE-5G" "IP Intelligence, 3Yr, VE-1G/VE-3G/VE-5G" "IPS, 1Yr, VE-1G / VE-3G / VE-5G" "IPS, 3Yr, VE-1G / VE-3G / VE-5G" "LTM to Best Bundle Upgrade, 1Gbps" "LTM to Better Bundle Upgrade, 1Gbps" "LTM, 1 Gbps -3 Gbps Upgrade" "PEM, ADD-VE, 1G" "Routing Bundle, VE" "SM2 ADD-ON, VE (25MBPS TO 10GBPS)" "SSL Orchestrator, VE (25MB/200MB/1G)" "Subscriber Discovery, VE-1G" "Threat Campaigns, 1Yr, VE-1G" "Threat Campaigns, 3Yr, VE-1G" "Traffic Classification, VE-1G" "URL Filtering, VE-25M-1G, 500 Sessions, 1Yr" "URL Filtering, VE-25M-1G, 500 Sessions, 3Yr" "VE SSL Compression Offload, Low" }
platform-id Z100
product BIG-IP
time-zone America/Los_Angeles
unicast-address {
{
effective-ip 10.10.10.101
effective-port 1026
ip 10.10.10.101
}
{
effective-ip management-ip
effective-port 1026
ip management-ip
}
}
version 17.5.1
}
cm device-group /Common/device-group-1 {
devices {
/Common/test-vlb01.internal { }
/Common/test-vlb02.internal { }
}
type sync-failover
}
cm device-group /Common/device_trust_group {
auto-sync enabled
devices {
/Common/test-vlb01.internal { }
/Common/test-vlb02.internal { }
}
hidden true
network-failover disabled
}
cm device-group /Common/gtm {
devices {
/Common/test-vlb01.internal { }
}
hidden true
network-failover disabled
}
cm key /Common/dtca.key {
cache-path /config/filestore/files_d/Common_d/trust_certificate_key_d/:Common:dtca.key_59553_1
checksum SHA1:1704:ddff49739a7540a29b92ab1ef1ebfcf4992f1d40
revision 1
}
cm key /Common/dtdi.key {
cache-path /config/filestore/files_d/Common_d/trust_certificate_key_d/:Common:dtdi.key_59549_3
checksum SHA1:1704:a5cbd45a216e762d0e4542e3145940ff5dbe7a9f
revision 3
}
cm traffic-group /Common/traffic-group-1 {
failover-method ha-score
monitor {
ha-group HA-Group
}
unit-id 1
}
cm traffic-group /Common/traffic-group-local-only { }
cm trust-domain /Common/Root {
ca-cert /Common/dtca.crt
ca-cert-bundle /Common/dtca-bundle.crt
ca-devices { /Common/test-vlb01.internal /Common/test-vlb02.internal }
ca-key /Common/dtca.key
guid af71c364-d66b-436b-ba3408323668ce88
status initialized
trust-group /Common/device_trust_group
}
net port-list /Common/_sys_self_allow_tcp_defaults {
ports {
22 { }
53 { }
161 { }
443 { }
1029-1043 { }
4353 { }
}
}
net port-list /Common/_sys_self_allow_udp_defaults {
ports {
53 { }
161 { }
520 { }
1026 { }
4353 { }
}
}
net route-domain /Common/0 {
id 0
vlans {
/Common/vlan1000-multus-vlan
/Common/vlan100-mnw-vlan
/Common/http-tunnel
/Common/socks-tunnel
}
}
net self /Common/vlan100-mnw-vip {
address 10.10.10.102/26
allow-service all
traffic-group /Common/traffic-group-1
vlan /Common/vlan100-mnw-vlan
}
net self /Common/vlan1000-multus-ip {
address 172.21.0.177/27
traffic-group /Common/traffic-group-local-only
vlan /Common/vlan1000-multus-vlan
}
net self /Common/vlan100-mnw-ip {
address 10.10.10.100/26
traffic-group /Common/traffic-group-local-only
vlan /Common/vlan100-mnw-vlan
}
net self-allow {
defaults {
igmp:0
ospf:0
pim:0
tcp:161
tcp:22
tcp:4353
tcp:443
tcp:53
udp:1026
udp:161
udp:4353
udp:520
udp:53
}
}
net stp /Common/cist {
trunks {
vlan1006-hc-trunk {
external-path-cost 2000
internal-path-cost 2000
}
vlan1109-mnw-trunk {
external-path-cost 2000
internal-path-cost 2000
}
}
vlans {
/Common/vlan1000-multus-vlan
/Common/vlan100-mnw-vlan
}
}
net trunk vlan1000-multus-trunk {
interfaces {
1.2
}
}
net trunk vlan100-mnw-trunk {
interfaces {
1.1
}
}
net vlan /Common/vlan1000-multus-vlan {
dag-adjustment none
interfaces {
vlan1000-multus-trunk { }
}
sflow {
poll-interval-global no
sampling-rate-global no
}
tag 1000
}
net vlan /Common/vlan100-mnw-vlan {
dag-adjustment none
interfaces {
vlan100-mnw-trunk { }
}
sflow {
poll-interval-global no
sampling-rate-global no
}
tag 100
}
net fdb tunnel /Common/http-tunnel { }
net fdb tunnel /Common/socks-tunnel { }
net fdb vlan /Common/vlan1000-multus-vlan { }
net fdb vlan /Common/vlan100-mnw-vlan { }
net tunnels tunnel /Common/http-tunnel {
description "Tunnel for http-explicit profile"
profile /Common/tcp-forward
}
net tunnels tunnel /Common/socks-tunnel {
description "Tunnel for socks profile"
profile /Common/tcp-forward
}
security device-id attribute /Common/att01 {
id 1
}
security device-id attribute /Common/att02 {
id 2
}
security device-id attribute /Common/att03 {
id 3
}
security device-id attribute /Common/att04 {
id 4
}
security device-id attribute /Common/att05 {
id 5
}
security device-id attribute /Common/att06 {
id 6
}
security device-id attribute /Common/att07 {
id 7
}
security device-id attribute /Common/att08 {
id 8
}
security device-id attribute /Common/att09 {
id 9
}
security device-id attribute /Common/att10 {
id 10
}
security device-id attribute /Common/att11 {
id 11
}
security device-id attribute /Common/att12 {
id 12
}
security device-id attribute /Common/att13 {
id 13
}
security device-id attribute /Common/att14 {
id 14
}
security device-id attribute /Common/att15 {
id 15
}
security device-id attribute /Common/att16 {
id 16
}
security device-id attribute /Common/att17 {
id 17
}
security device-id attribute /Common/att18 {
id 18
}
security device-id attribute /Common/att19 {
id 19
}
security device-id attribute /Common/att20 {
id 20
}
security device-id attribute /Common/att21 {
id 21
}
security device-id attribute /Common/att22 {
id 22
}
security device-id attribute /Common/att23 {
id 23
}
security device-id attribute /Common/att24 {
id 24
}
security device-id attribute /Common/att25 {
id 25
}
security device-id attribute /Common/att26 {
id 26
}
security device-id attribute /Common/att27 {
id 27
}
security device-id attribute /Common/att28 {
id 28
}
security device-id attribute /Common/att29 {
id 29
}
security device-id attribute /Common/att30 {
id 30
}
security device-id attribute /Common/att31 {
id 31
}
security device-id attribute /Common/att32 {
id 32
}
security device-id attribute /Common/att33 {
id 33
}
security device-id attribute /Common/att34 {
id 34
}
security device-id attribute /Common/att35 {
id 35
}
security device-id attribute /Common/att36 {
id 36
}
security device-id attribute /Common/att37 {
id 37
}
security device-id attribute /Common/att38 {
id 38
}
security device-id attribute /Common/att39 {
id 39
}
security firewall config-entity-id /Common/uuid_entity_id {
entity-id 8980702471982878946
}
security firewall rule-list /Common/_sys_self_allow_all {
rules {
_sys_allow_all {
action accept
ip-protocol any
}
}
}
security firewall rule-list /Common/_sys_self_allow_defaults {
rules {
_sys_allow_tcp_defaults {
action accept
ip-protocol tcp
destination {
port-lists {
/Common/_sys_self_allow_tcp_defaults
}
}
}
_sys_allow_udp_defaults {
action accept
ip-protocol udp
destination {
port-lists {
/Common/_sys_self_allow_udp_defaults
}
}
}
_sys_allow_ospf_defaults {
action accept
ip-protocol ospf
}
_sys_allow_pim_defaults {
action accept
ip-protocol pim
}
_sys_allow_igmp_defaults {
action accept
ip-protocol igmp
}
}
}
security firewall rule-list /Common/_sys_self_allow_management {
rules {
_sys_allow_ssh {
action accept
ip-protocol tcp
destination {
ports {
22 { }
}
}
}
_sys_allow_web {
action accept
ip-protocol tcp
destination {
ports {
443 { }
}
}
}
}
}
security ip-intelligence policy /Common/ip-intelligence { }
sys dns {
description configured-by-dhcp
name-servers { 10.10.10.65 }
search { openstackgate.local }
}
sys folder / {
device-group /Common/device-group-1
hidden false
inherited-devicegroup false
inherited-traffic-group false
traffic-group /Common/traffic-group-1
}
sys folder /Common {
device-group /Common/device-group-1
hidden false
inherited-devicegroup true
inherited-traffic-group true
traffic-group /Common/traffic-group-1
}
sys folder /Common/Drafts {
device-group /Common/device-group-1
hidden false
inherited-devicegroup true
inherited-traffic-group true
traffic-group /Common/traffic-group-1
}
sys global-settings {
gui-setup disabled
hostname test-vlb01.internal
}
sys ha-group HA-Group {
active-bonus 20
trunks {
vlan1000-multus-trunk {
weight 100
}
vlan100-mnw-trunk {
weight 100
}
}
}
sys management-dhcp /Common/sys-mgmt-dhcp-config {
request-options { subnet-mask broadcast-address routers domain-name domain-name-servers host-name ntp-servers interface-mtu }
}
sys ntp {
servers { 192.168.0.254 }
}
sys provision ltm {
level nominal
}
sys snmp {
agent-addresses { tcp6:161 udp6:161 }
communities {
/Common/comm-public {
community-name public
source default
}
}
disk-monitors {
/Common/root {
minspace 2000
path /
}
/Common/var {
minspace 10000
path /var
}
}
process-monitors {
/Common/bigd {
max-processes infinity
process bigd
}
/Common/chmand {
process chmand
}
/Common/httpd {
max-processes infinity
process httpd
}
/Common/mcpd {
process mcpd
}
/Common/sod {
process sod
}
/Common/tmm {
max-processes infinity
process tmm
}
}
}
sys dynad settings {
development-mode false
}
sys fpga firmware-config {
type standard-balanced-fpga
}
sys sflow global-settings http { }
sys sflow global-settings vlan { }
sys turboflex profile-config {
type turboflex-adc
}
※BIGIP#2は割愛
BIGIP#同期設定
#TMSH-VERSION: 17.5.1
apm ephemeral-auth ssh-security-config /Common/ssh-security-config {
ciphers {
1 {
cipher-name aes256-ctr
}
2 {
cipher-name aes192-ctr
}
3 {
cipher-name aes128-ctr
}
}
compressions {
1 {
compression-name none
}
}
hmacs {
1 {
hmac-name hmac-sha2-512
}
2 {
hmac-name hmac-sha2-256
}
}
kex-methods {
1 {
kex-method-name ecdh-sha2-nistp256
}
}
}
apm oauth db-instance /Common/oauthdb {
description "Default OAuth DB."
}
apm policy access-policy /Common/kerberos_auth_config_default {
default-ending /Common/kerberos_auth_config_default_end_deny
items {
/Common/kerberos_auth_config_default_act_kerberos_auth { }
/Common/kerberos_auth_config_default_end_allow { }
/Common/kerberos_auth_config_default_end_deny { }
/Common/kerberos_auth_config_default_ent { }
}
start-item /Common/kerberos_auth_config_default_ent
}
apm policy customization-source /Common/modern { }
apm policy customization-source /Common/standard { }
apm policy policy-item /Common/kerberos_auth_config_default_act_kerberos_auth {
agents {
/Common/kerberos_auth_config_default_act_kerberos_auth_ag {
type aaa-kerberos
}
}
caption "Kerberos Auth"
color 1
item-type action
rules {
{
caption Successful
expression "expr {[mcget {session.kerberos.last.authresult}] == 1}"
next-item /Common/kerberos_auth_config_default_end_allow
}
{
caption fallback
next-item /Common/kerberos_auth_config_default_end_deny
}
}
}
apm policy policy-item /Common/kerberos_auth_config_default_end_allow {
agents {
/Common/kerberos_auth_config_default_end_allow_ag {
type ending-allow
}
}
caption Allow
color 1
item-type ending
}
apm policy policy-item /Common/kerberos_auth_config_default_end_deny {
agents {
/Common/kerberos_auth_config_default_end_deny_ag {
type ending-deny
}
}
caption Deny
color 2
item-type ending
}
apm policy policy-item /Common/kerberos_auth_config_default_ent {
caption Start
color 1
rules {
{
caption fallback
next-item /Common/kerberos_auth_config_default_act_kerberos_auth
}
}
}
apm policy agent ending-allow /Common/kerberos_auth_config_default_end_allow_ag { }
apm policy agent ending-deny /Common/kerberos_auth_config_default_end_deny_ag {
customization-group /Common/kerberos_auth_config_default_end_deny_ag
}
apm policy agent kerberos /Common/kerberos_auth_config_default_act_kerberos_auth_ag { }
apm report default-report {
report-name sessionReports/sessionSummary
user /Common/admin
}
ilx global-settings {
debug-port-blacklist { 47019 54321 60000 }
}
ltm default-node-monitor {
rule none
}
ltm node /Common/metallb-1 {
address 10.10.10.110
}
ltm node /Common/worker01 {
address 10.10.10.70
}
ltm node /Common/worker02 {
address 10.10.10.71
}
ltm pool /Common/OCP-Ingress-Pool1 {
members {
/Common/worker01:80 {
address 10.10.10.70
}
/Common/worker02:80 {
address 10.10.10.71
}
}
monitor /Common/tcp
}
ltm pool /Common/OCP-MetalLB-Pool1 {
members {
/Common/metallb-1:80 {
address 10.10.10.110
}
}
monitor /Common/tcp
}
ltm snat /Common/ocp-snat {
origins {
10.10.10.64/26 { }
}
translation /Common/172.21.0.179
}
ltm snat-translation /Common/172.21.0.179 {
address 172.21.0.179
inherited-traffic-group true
traffic-group /Common/traffic-group-1
}
ltm virtual /Common/OCP-Ingress-VS1 {
creation-time 2025-10-09:09:28:45
destination /Common/172.21.0.176:80
ip-protocol tcp
last-modified-time 2025-10-09:09:28:54
mask 255.255.255.255
pool /Common/OCP-Ingress-Pool1
profiles {
/Common/tcp { }
}
serverssl-use-sni disabled
source 0.0.0.0/0
translate-address enabled
translate-port enabled
}
ltm virtual /Common/OCP-MetalLB-VS1 {
creation-time 2025-10-09:09:27:02
destination /Common/172.21.0.175:80
ip-protocol tcp
last-modified-time 2025-10-09:09:27:11
mask 255.255.255.255
pool /Common/OCP-MetalLB-Pool1
profiles {
/Common/tcp { }
}
serverssl-use-sni disabled
source 0.0.0.0/0
translate-address enabled
translate-port enabled
}
ltm virtual-address /Common/172.21.0.175 {
address 172.21.0.175
arp enabled
icmp-echo enabled
mask 255.255.255.255
traffic-group /Common/traffic-group-1
}
ltm virtual-address /Common/172.21.0.176 {
address 172.21.0.176
arp enabled
icmp-echo enabled
mask 255.255.255.255
traffic-group /Common/traffic-group-1
}
ltm profile server-ssl /Common/do-not-remove-without-replacement {
app-service none
}
net dns-resolver /Common/f5-aws-dns {
forward-zones {
amazonaws.com {
nameservers {
8.8.8.8:53 { }
}
}
idservice.net {
nameservers {
8.8.8.8:53 { }
}
}
shpapi.com {
nameservers {
8.8.8.8:53 { }
}
}
}
route-domain /Common/0
}
net route /Common/test-sv {
gw 172.21.0.161
network 172.21.0.192/27
}
net ipsec ike-daemon /Common/ikedaemon {
log-publisher /Common/default-ipsec-log-publisher
}
pem global-settings analytics { }
pem global-settings gx { }
pem global-settings policy { }
security dos ipv6-ext-hdr /Common/dos-ipv6-ext-hdr {
frame-types { auth dstopt esp frag hbh mobility route }
}
security dos udp-portlist /Common/dos-udp-portlist {
list-type exclude-listed-ports
}
security firewall config-change-log {
log-publisher /Common/local-db-publisher
}
security protocol-inspection compliance-map /Common/map_10426 {
insp-id 10426
key-type int
value-type vector-string
}
security protocol-inspection compliance-objects /Common/allowed_ip_addresses {
insp-id 11801
type vector-string
}
security protocol-inspection compliance-objects /Common/allowed_ip_addresses {
insp-id 11800
type vector-string
}
security protocol-inspection compliance-objects /Common/allowed_list {
insp-id 10229
type vector-string
}
security protocol-inspection compliance-objects /Common/allowed_list {
insp-id 11804
type vector-string
}
security protocol-inspection compliance-objects /Common/allowed_list {
insp-id 10430
type vector-string
}
security protocol-inspection compliance-objects /Common/allowed_list {
insp-id 10431
type vector-string
}
security protocol-inspection compliance-objects /Common/allowed_list {
insp-id 10232
type vector-string
}
security protocol-inspection compliance-objects /Common/argument_len_max {
insp-id 10905
type int
}
security protocol-inspection compliance-objects /Common/command_argument_len_max {
insp-id 10609
type int
}
security protocol-inspection compliance-objects /Common/command_len_max {
insp-id 10905
type int
}
security protocol-inspection compliance-objects /Common/command_len_max {
insp-id 10707
type int
}
security protocol-inspection compliance-objects /Common/command_len_max {
insp-id 10609
type int
}
security protocol-inspection compliance-objects /Common/command_parameter_len_max {
insp-id 10707
type int
}
security protocol-inspection compliance-objects /Common/disallowed_ip_addresses {
insp-id 11801
type vector-string
}
security protocol-inspection compliance-objects /Common/disallowed_ip_addresses {
insp-id 11800
type vector-string
}
security protocol-inspection compliance-objects /Common/disallowed_list {
insp-id 10229
type vector-string
}
security protocol-inspection compliance-objects /Common/disallowed_list {
insp-id 11804
type vector-string
}
security protocol-inspection compliance-objects /Common/disallowed_list {
insp-id 10430
type vector-string
}
security protocol-inspection compliance-objects /Common/disallowed_list {
insp-id 10431
type vector-string
}
security protocol-inspection compliance-objects /Common/disallowed_list {
insp-id 10232
type vector-string
}
security protocol-inspection compliance-objects /Common/error_message_max {
insp-id 10102
type int
}
security protocol-inspection compliance-objects /Common/file_name_max {
insp-id 10102
type int
}
security protocol-inspection compliance-objects /Common/file_type_max {
insp-id 10102
type int
}
security protocol-inspection compliance-objects /Common/header_name_len_max {
insp-id 11016
type int
}
security protocol-inspection compliance-objects /Common/header_name_len_max {
insp-id 11223
type int
}
security protocol-inspection compliance-objects /Common/header_value_len_max {
insp-id 11016
type int
}
security protocol-inspection compliance-objects /Common/header_value_len_max {
insp-id 11223
type int
}
security protocol-inspection compliance-objects /Common/inter_mobile_network_list {
insp-id 10234
type vector-int
}
security protocol-inspection compliance-objects /Common/intra_mobile_network_list {
insp-id 10234
type vector-int
}
security protocol-inspection compliance-objects /Common/known_resource_records {
insp-id 10002
type vector-int
}
security protocol-inspection compliance-objects /Common/max_allocated_memory {
insp-id 11040
type int
}
security protocol-inspection compliance-objects /Common/method_len_max {
insp-id 11016
type int
}
security protocol-inspection compliance-objects /Common/method_len_max {
insp-id 11223
type int
}
security protocol-inspection compliance-objects /Common/option_name_max {
insp-id 10102
type int
}
security protocol-inspection compliance-objects /Common/option_value_max {
insp-id 10102
type int
}
security protocol-inspection compliance-objects /Common/response_argument_len_max {
insp-id 10609
type int
}
security protocol-inspection compliance-objects /Common/response_code_len_max {
insp-id 10609
type int
}
security protocol-inspection compliance-objects /Common/response_parameter_len_max {
insp-id 10707
type int
}
security protocol-inspection compliance-objects /Common/status_code_len_max {
insp-id 11016
type int
}
security protocol-inspection compliance-objects /Common/status_code_len_max {
insp-id 11223
type int
}
security protocol-inspection compliance-objects /Common/status_len_max {
insp-id 10707
type int
}
security protocol-inspection compliance-objects /Common/status_reason_len_max {
insp-id 11016
type int
}
security protocol-inspection compliance-objects /Common/status_reason_len_max {
insp-id 11223
type int
}
security protocol-inspection compliance-objects /Common/tag_len_max {
insp-id 10905
type int
}
security protocol-inspection compliance-objects /Common/uri_len_max {
insp-id 11016
type int
}
security protocol-inspection compliance-objects /Common/uri_len_max {
insp-id 11223
type int
}
security protocol-inspection compliance-objects /Common/version_len_max {
insp-id 11016
type int
}
security protocol-inspection compliance-objects /Common/version_len_max {
insp-id 11223
type int
}
security scrubber profile /Common/scrubber-profile-default {
advertisement-ttl 300
}
sys compatibility-level {
level 0
}
sys management-ovsdb {
bfd-disabled
bfd-route-domain none
ca-cert-file none
cert-file none
cert-key-file none
disabled
flooding-type replicator
log-level info
logical-routing-type none
tunnel-maintenance-mode active
}
sys diags ihealth {
expiration 30
no-ihealth false
options none
password none
user none
}
sys ecm cloud-provider /Common/aws-ec2 {
description "The aws-ec2 parameters"
property-template {
account { }
availability-zone {
valid-values { a b c d }
}
instance-type {
valid-values { t2.micro t2.small t2.medium m3.medium m3.large m3.xlarge m3.2xlarge c3.large c3.xlarge c3.2xlarge c3.4xlarge c3.8xlarge r3.large r3.xlarge r3.2xlarge r3.4xlarge r3.8xlarge }
}
region {
valid-values { us-east-1 us-west-1 us-west-2 sa-east-1 eu-west-1 eu-central-1 ap-southeast-2 ap-southeast-1 ap-northeast-1 }
}
}
}
sys ecm cloud-provider /Common/dnet {
description "The dnet parameters"
}
sys ecm cloud-provider /Common/vsphere {
description "The vsphere parameters"
property-template {
cloud-host-ip { }
dhcp-network-name { }
end-point-url { }
node-name { }
}
}
sys file ssl-cert /Common/f5_api_com.crt {
cache-path /config/filestore/files_d/Common_d/certificate_d/:Common:f5_api_com.crt_59702_1
revision 1
source-path file:///config/ssl/ssl.crt/f5_api_com.crt
}
sys file ssl-key /Common/f5_api_com.key {
cache-path /config/filestore/files_d/Common_d/certificate_key_d/:Common:f5_api_com.key_59680_1
passphrase $M$V8$SUPnCOO9ir5BGqGcjMBq1+9zPw9VxLKgfW+BfN33cVfctiB6IEqVyIJGbdI5PAKUDhLDyF33F88Y6MrbkkE4c64JGn6mghvQlvwfiJM6Fdw=
revision 1
source-path file:///config/ssl/ssl.key/f5_api_com.key
}
sys software update {
auto-check enabled
auto-phonehome enabled
frequency weekly
}
wom endpoint-discovery { }
SRIOV設定
SR-IOV(Single Root I/O Virtualization)とは、1枚の物理NICを、複数の“ほぼ物理NIC同等の仮想NIC(VF)”に分割して、Pod や VM に直接割り当てるための仕組みです。
構成図でいうとbondを構成する物理NIC上VFが作成され、OVN/br-int/kube-proxyをバイパスしてPodがVFに直結することでパフォーマンス向上が見込めます。
基本的な設定のみ記載
前提として、HW側のSR-IOVが有効化されている必要があります。
※設定方法はベンダー・メーカーにより異なります。
Nodeへのラベル付け
対象ノードへSRIOV用のLabelをつける
$ oc label node node01.internal feature.node.kubernetes.io/network-sriov.capable="true"
node/node01.internal labeled
$ oc get node --show-labels node01.internal
NAME STATUS ROLES AGE VERSION LABELS
node01.internal Ready control-plane,master,worker 2d13h v1.29.6+aba1e8d beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,cluster.ocs.openshift.io/openshift-storage=,feature.node.kubernetes.io/network-sriov.capable=true,kubernetes.io/arch=amd64,kubernetes.io/hostname=node01.internal,kubernetes.io/os=linux,node-role.kubernetes.io/control-plane=,node-role.kubernetes.io/master=,node-role.kubernetes.io/worker=,node.openshift.io/os_id=rhcos
SR-IOV Operator導入
apiVersion: v1
kind: Namespace
metadata:
name: openshift-sriov-network-operator
annotations:
workload.openshift.io/allowed: management
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: sriov-network-operators
namespace: openshift-sriov-network-operator
spec:
targetNamespaces:
- openshift-sriov-network-operator
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: sriov-network-operator-subscription
namespace: openshift-sriov-network-operator
spec:
channel: stable
name: sriov-network-operator
source: redhat-operators
sourceNamespace: openshift-marketplace
確認。インストール後少し置いてから次手順へ
$ oc get pods -n openshift-sriov-network-operator
NAME READY STATUS RESTARTS AGE
sriov-network-operator-74f996853a-15gnx 1/1 Running 0 3m10s
operator設定
apiVersion: sriovnetwork.openshift.io/v1
kind: SriovOperatorConfig
metadata:
name: default
namespace: openshift-sriov-network-operator
spec:
configurationMode: daemon
enableInjector: true
enableOperatorWebhook: true
logLevel: 2
disableDrain: false
確認
$ oc get pods -n openshift-sriov-network-operator
NAME READY STATUS RESTARTS AGE
network-resources-injector-4af1v 1/1 Running 0 4m30s
network-resources-injector-jbcvs 1/1 Running 0 4m30s
network-resources-injector-vwdfx 1/1 Running 0 4m30s
operator-webhook-jp7ag 1/1 Running 0 4m30s
operator-webhook-nbvb6 1/1 Running 0 4m30s
operator-webhook-qtc1l 1/1 Running 0 4m30s
sriov-network-config-daemon-8dw52 1/1 Running 0 4m30s
sriov-network-config-daemon-9gkv3 1/1 Running 0 4m30s
sriov-network-config-daemon-qsvn1 1/1 Running 0 4m30s
sriov-network-operator-74f9966853a-15gnx 1/1 Running 0 4h20m
Network作成
後述のNetwork定義のnicSelectorのパラメータを事前に確認しておく必要がある。
$ oc debug node/node01.internal
Starting pod/node01internal-debug-wxdll ...
To use host binaries, run `chroot /host`
Pod IP: 172.21.224.130
If you don't see a command prompt, try pressing enter.
sh-5.1# ls /sys/class/net/
## 一部抜粋
ens1f0 ens1f1 ens3f0 ens3f1 lo # pfNames
sh-5.1# lspci -nn -D | grep -i ethernet
0000:22:00.0 Ethernet controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086:1521] (rev 01)
0000:22:00.1 Ethernet controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086:1521] (rev 01)
0000:22:00.2 Ethernet controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086:1521] (rev 01)
0000:22:00.3 Ethernet controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086:1521] (rev 01)
0000:12:00.0 Ethernet controller [0200]: Intel Corporation Ethernet Controller E810-XXV for SFP [8086:159b] (rev 02) # 0000:37:がrootDevices.(ethtool -i ensxxx で特定)
0000:12:00.1 Ethernet controller [0200]: Intel Corporation Ethernet Controller E810-XXV for SFP [8086:159b] (rev 02) # 8086がvendor , 159bがdevideID
0000:9f:00.0 Ethernet controller [0200]: Intel Corporation Ethernet Controller E810-XXV for SFP [8086:159b] (rev 02)
0000:9f:00.1 Ethernet controller [0200]: Intel Corporation Ethernet Controller E810-XXV for SFP [8086:159b] (rev 02)
Nodeのネットワーク定義の設定
apiVersion: sriovnetwork.openshift.io/v1
kind: SriovNetworkNodePolicy
metadata:
name: sriov-network-policy-ens1f1
namespace: openshift-sriov-network-operator
spec:
nodeSelector:
feature.node.kubernetes.io/network-sriov.capable: 'true'
kubernetes.io/hostname: 'node01.internal'
nicSelector: # 事前確認だが、すべて揃っていなくても設定はできる
pfNames:
- ens1f1
rootDevices:
- '0000:12:00.1'
vendor: '8086'
deviceID: 159b
deviceType: netdevice
mtu: 1500
numVfs: 3
priority: 99
resourceName: ens1f1vf
---
apiVersion: sriovnetwork.openshift.io/v1
kind: SriovNetworkNodePolicy
metadata:
name: sriov-network-policy-ens3f1
namespace: openshift-sriov-network-operator
spec:
nodeSelector:
feature.node.kubernetes.io/network-sriov.capable: 'true'
kubernetes.io/hostname: 'node01.internal'
nicSelector:
pfNames:
- ens3f1
rootDevices:
- '0000:9f:00.1'
vendor: '8086'
deviceID: 159b
deviceType: netdevice
mtu: 1500
numVfs: 3
priority: 99
resourceName: ens3f1vf
確認
$ oc get sriovnetworknodepolicy -n openshift-sriov-network-operator
NAME AGE
sriov-network-policy-ens1f1 45s
sriov-network-policy-ens3f1 45s
policy適用後、vfが作成されている
$ oc debug node/node01.internal
Starting pod/node01internal-debug-zgaxc ...
To use host binaries, run `chroot /host`
Pod IP: 172.21.224.164
If you don't see a command prompt, try pressing enter.
sh-5.1# ip link show
~抜粋~
6: ens1f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether b4:83:51:12:6f:be brd ff:ff:ff:ff:ff:ff
vf 0 link/ether 7a:54:3f:81:8c:10 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
vf 1 link/ether 3e:fd:d4:5b:f8:b3 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
vf 2 link/ether b2:6e:ba:fe:c5:d8 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
altname enp55s0f0
8: ens3f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether b4:83:51:12:6f:b0 brd ff:ff:ff:ff:ff:ff
vf 0 link/ether d6:9a:c1:97:5e:c5 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
vf 1 link/ether 1a:81:53:9f:33:d0 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
vf 2 link/ether 56:23:e1:37:6e:c1 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
altname enp160s0f0
Network作成
apiVersion: sriovnetwork.openshift.io/v1
kind: SriovNetwork
metadata:
name: sriov-attach-ens1f1vf
namespace: openshift-sriov-network-operator
spec:
resourceName: ens1f1vf
networkNamespace: default
# vlan: 3010
ipam: |-
{
"type": "host-local",
"subnet": "10.10.10.0/24",
"rangeStart": "10.10.10.100",
"rangeEnd": "10.10.10.150",
"gateway": "10.10.10.254"
}
---
apiVersion: sriovnetwork.openshift.io/v1
kind: SriovNetwork
metadata:
name: sriov-attach-ens3f1vf
namespace: openshift-sriov-network-operator
spec:
resourceName: ens3f1vf
networkNamespace: default
# vlan: 3010
ipam: |-
{
"type": "host-local",
"subnet": "10.10.10.0/24",
"rangeStart": "10.10.10.151",
"rangeEnd": "10.10.10.200",
"gateway": "10.10.10.254"
}
確認
oc get SriovNetwork -n openshift-sriov-network-operator
sriovnetworkリソースと同時にnet-attach-defも確認できる
sriovnetworkの方を消さない限り、net-attach-defは消しても再作成される
Pod作成
apiVersion: v1
kind: Pod
metadata:
name: sriov-pod01
namespace: default
annotations:
k8s.v1.cni.cncf.io/networks: |-
[
{
"name": "sriov-attach-ens1f1vf",
"ips": ["10.10.10.100/24"]
}
]
spec:
containers:
- name: centos-tools
image: docker.io/centos/tools:latest
command:
- /sbin/init
securityContext:
privileged: true
apiVersion: v1
kind: Pod
metadata:
name: sriov-pod02
namespace: default
annotations:
k8s.v1.cni.cncf.io/networks: |-
[
{
"name": "sriov-attach-ens3f1vf",
"ips": ["10.10.10.151/24"]
}
]
spec:
containers:
- name: centos-tools
image: docker.io/centos/tools:latest
command:
- /sbin/init
securityContext:
privileged: true
確認
$ oc exec -it sriov-pod01 -- ip a
(一部省略)
1: lo: <LOOPBACK,UP>
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP>
inet 10.128.2.15/23 # Pod Network (default CNI / OVN)
3: net1: <BROADCAST,MULTICAST,UP,LOWER_UP>
inet 10.10.10.100/24 # SR-IOV VF
net1というNICがアタッチされており、アドレスが付与されている
Bonding設定(参考)
一応、SRIOVのNICでbond設定はできますが、SR-IOV の思想は”1 VF = 1 物理ポート相当”です。
そのため、bondを組むとカーネル処理が増える、VFの直結性が薄れる、DPDK/高速化のメリットが減るため、あまり使いません。
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: sriov-bond
namespace: default
spec:
config: '{
"type": "bond",
"cniVersion": "0.3.1",
"name": "bond-net1",
"mode": "active-backup",
"failOverMac": 1,
"linksInContainer": true,
"miimon": "100",
"mtu": 1500,
"links": [
{"name": "net1"},
{"name": "net2"}
],
"ipam": {
"type": "host-local",
"subnet": "10.10.10.0/24",
"routes": [{
"dst": "0.0.0.0/0"
}],
"gateway": "10.10.10.254"
}
}'
OVN-Kubernetesの動き
OVN-Kubernetes は Open vSwitch (OVS) と OVN (Open Virtual Network) をベースにした CNI プラグインであり、OpenShift 4.12以降ではデフォルトのネットワークプロバイダーとなっている。
OVN は Kubernetes のネットワークオブジェクト(Pod、Service、NetworkPolicy など)を論理ネットワークとして管理し、各 Node 上の OVS を制御して実際のパケット転送を実現する
OVN (Open Virtual Network)
Open vSwitch をベースにしたネットワーク仮想化技術
Geneve
VXLAN の後継として策定されたオーバーレイトンネル方式
OVN-Kubernetes ではノード間通信に利用される
ovn-northd
Northbound DB に定義された論理ネットワーク
(Logical Switch / Router / ACL / LoadBalancer など)
を Southbound DB の論理フロー(Logical Flow)へ変換する
NB DB (Northbound DB)
Kubernetes の論理ネットワークモデルを保持するDB
SB DB (Southbound DB)
各 Node が利用する Logical Flow を保持するDB
ovn-controller
各 Node 上で動作し、SB DB を監視して
Logical Flow を OpenFlow Rule に変換し OVS を設定する
br-int
OVN が利用する OVS の統合ブリッジ
Pod の veth がここへ接続される
一般的な Kubernetes (iptables / IPVS)
一般的な Kubernetes では、Service のロードバランシングは Linux カーネル機能を利用して実現する。
Linuxカーネルにルールを書く方式(iptables / IPVS)で通信させている。
Client
↓
Service IP (ClusterIP)
↓
kube-proxy
↓
iptables / IPVS
↓
Endpoint Pod
各 Node 上の kube-proxy が Kubernetes API を監視し、
・iptables (iptables -t nat)
・IPVS (ipvsadm)
のルールを生成して Service → Pod の負荷分散を行う。
OpenShift (OVN-Kubernetes)
一方、OpenShift のデフォルトである OVN-Kubernetes では、Service のロードバランシングは kube-proxy ではなく OVN が実装する。
Kubernetes API
│
▼
OVN Northbound DB
(Logical Switch / Router / LoadBalancer / ACL)
│
│ ovn-northd
▼
OVN Southbound DB
(Logical Flow)
│
▼
ovn-controller
│
▼
OpenFlow Rule
│
▼
Open vSwitch (br-int)
※ OpenShift では kube-proxy は Service の負荷分散には使用されず、OVN が独自に実装している。
Service 通信の流れ
OVN-Kubernetes では Service は OVN LoadBalancer として表現される。
Client
│
▼
ClusterIP
│
▼
OVN LoadBalancer
│
▼
PodIP
実際には OVN の LoadBalancer オブジェクトが OpenFlow に変換され、OVS が高速に処理する。
Pod 間通信
Pod 間通信は次の流れで行われる。
1. パケットが br-int に到達
2. OpenFlow が Service IP をマッチ
3. OVN LoadBalancer のルールを適用
4. DNAT
ClusterIP
│
▼
PodIP
5. Pod が同一 Node の場合
br-int
│
▼
veth
│
▼
Pod
6. Pod が別 Node の場合
br-int
│
▼
Geneve Encapsulation
│
▼
物理NIC
│
▼
Remote Node
│
▼
Geneve Decapsulation
│
▼
br-int
│
▼
Pod
同一 Node の Pod 間通信は br-int 内で完結する。
別 Node の Pod 間通信は Geneve によりカプセル化され、リモート Node へ転送された後、デカプセル化されて目的の Pod に配送される。
全体イメージ
Kubernetes API
(Pod / Service / NetworkPolicy / EgressIP ...)
│
▼
OVN Northbound DB
(Logical Switch / Router / LoadBalancer / ACL)
│
ovn-northd
▼
OVN Southbound DB
(Logical Flow)
│
▼
ovn-controller
(各 Node)
│
Logical Flow → OpenFlow
│
▼
Open vSwitch (br-int)
│ │
│ └── Geneve Tunnel ──► Remote Node
│
└──────────────► Local Pod
この構成により、OVN-Kubernetes は Kubernetes の論理ネットワークを OpenFlow と OVS に変換し、
Service のロードバランシング、NetworkPolicy、EgressIP、Pod 間通信などを Linux のiptables/IPVS に依存せずに実現している。
CoreOSノード上から見た NIC IF
OVN-Kubernetesでは主に次のIFが作成される。
IF名(例) 用途
ens192, eno1, bond0 物理NIC
br-ex 外部ネットワーク接続用OVS Bridge
br-int OVN内部のIntegration Bridge
genev_sys_6081 GeneveトンネルIF
ovn-k8s-mp0 Node⇔Pod通信(Mgmt Port)
k8s-xxxxxx (環境による) Pod接続用OVS Port
ランダム文字列(veth) Pod側eth0と対になるHost側IF
lo Loopback
br-int
最も重要なOVS Bridge
Pod
│
veth
│
br-int
│
OpenFlow
│
├── Local Pod
└── Geneve
Local Pod / Remote Pod /Service LB /ACL(NetworkPolicy) /NAT
全て br-int 上で処理される。
br-ex
OVNの外部接続(Local Gateway)で利用されるOVSのデフォルトの外部Bridge
OCPノードをクラスタ外の外部NW(物理NWなど)に接続するために使用される。
Node
br-int
│
▼
Local Gateway
│
br-ex
│
Physical NIC(ens192,bond0)
Ingress / Egress / External Gateway / NodePort / HostNetwork
で利用される。
genev_sys_6081
OVS Datapathが作るトンネルIF
OVNはNode間通信をGeneve (UDP/6081)で行うため、genev_sys_6081というIFが見える。
NodeA
|
Geneve Tunnel
|
NodeB
ovn-k8s-mp0
Node自身がPod Networkへアクセスするために使うManagement Port
Node Namespace
ovn-k8s-mp0
│
br-int
│
Pod Network
curl PodIP / oc exec / readiness probe / liveness probe / CoreDNS / Node local process
などで利用される
veth(ランダム文字列)
Host側
0aec99638fac48f
|
veth pair
|
Pod側
eth0
役割としてはPod通信,Pod削除時に自動削除,Pod再作成時に別名で再生成など
$ ovs-vsctl show
$ ip link
$ crictl inspect
$ oc get pod -o wide
と組み合わせることで、どのPodに対応するvethか追跡できる
全体イメージ
Node
+----------------------+
| br-int |
+----------------------+
│ │ │
│ │ │
veth───┘ │ └──── genev_sys_6081
│ │ │
│ │ Remote Node
Pod eth0 ovn-k8s-mp0
│
Node → Pod通信
+----------------------+
| br-ex | (必要な環境のみ)
+----------------------+
│
Physical NIC
(ens192 / eno1 / bond0 ...)
以上
