排名
1
文章
875
粉丝
112
评论
163
.net core自定义项目模板,创建自己的模板项目,使用命令行创建模板项目
尘叶心繁 : 可以可以讲真的我都想弄个模板
net core webapi post传递参数
庸人 :
确实坑哈,我也是下班好了好几次,发现后台传递对象是可以的,但...
.net webapi 返回需要的字段,忽略某些字段,修改字段名等
雨雨雨雨雨辰 : 已精
.net webapi 返回需要的字段,忽略某些字段,修改字段名等
雨雨雨雨雨辰 :
疯狂反射
百度编辑器自定义模板
庸人 : 我建议换个编辑器,因为现在百度富文本已经停止维护了,用tinymec...
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2025TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:
50010702506256


欢迎加群交流技术

Multus-CNI
Multus-CNI 简介
简单来讲,这玩意可以对一个pod插入多张网卡进行通信。同时也支持多种cni的插件,什么Flannle、calico、macvlan都是可以的。
它的工作流程如下图所示:
这样看不清晰流程可以看创建的pod信息。
执行如下命令进行安装。
git clone https://github.com/k8snetworkplumbingwg/multus-cni.git
cd multus-cni
cat ./deployments/multus-daemonset.yml | kubectl apply -f -
安装完成后,会多一个名为NetworkAttachmentDefinition
资源来定义cni的配置。
whereabouts 简介
在以前的博客中,使用local-host
需要为每台主机分配不同的ip地址范围才能实现,而whereabouts会自动进行分配ip地址且不会发生两台主机同一个ip的情况。
可通过如下命令进行安装:
git clone https://github.com/k8snetworkplumbingwg/whereabouts && cd whereabouts
kubectl apply \
-f doc/crds/daemonset-install.yaml \
-f doc/crds/whereabouts.cni.cncf.io_ippools.yaml \
-f doc/crds/whereabouts.cni.cncf.io_overlappingrangeipreservations.yaml
ipvlan 实践
首先我们定义ipvlan的配置文件。
vim networkad.yaml
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: whereabouts-ipvlan-conf-1
spec:
config: '{
"cniVersion": "0.3.0",
"name": "ipvlan-conf-1",
"type": "ipvlan",
"master": "eth0",
"mode": "l2",
"ipam": {
"type": "whereabouts",
"range": "10.211.55.0/24",
"range_start": "10.211.55.129",
"range_end": "10.211.55.159",
"gateway": "10.211.55.1"
}
}'
然后apply一下。
kubectl apply -f networkad.yaml
创建一个指定使用whereabouts-ipvlan-conf-1
配置的pod,并将该网卡设置为eth1
。
vim ipvlan.yaml
apiVersion: v1
kind: Pod
metadata:
name: pod0-case-02
annotations:
k8s.v1.cni.cncf.io/networks: whereabouts-ipvlan-conf-1@eth1
spec:
containers:
- name: pod0-case-02
image: burlyluo/nettoolbox
command:
- /sbin/init
kubectl apply -f ipvlan.yaml
kubectl get pod
kubectl exec pod/pod0-case-02 -- ifconfig
外网仍然可以访问。
macvlan 实践
首先定义macvlan配置文件。
vim networkwhereabouts.yaml
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: whereabouts-conf
spec:
config: '{
"cniVersion": "0.3.0",
"name": "whereaboutsexample",
"type": "macvlan",
"master": "eth0",
"mode": "bridge",
"ipam": {
"type": "whereabouts",
"range": "192.168.2.225/28"
}
}'
kubectl apply -f networkwhereabouts.yaml
kubectl get net-attach-def
kubectl get net-attach-def whereabouts-conf
创建一个指定使用whereabouts-conf
配置的pod,并将该网卡设置为eth3
。
cat <<EOF | kubectl create -f -
apiVersion: v1
kind: Pod
metadata:
name: pod-macvlan
annotations:
k8s.v1.cni.cncf.io/networks: whereabouts-conf@eth3
spec:
containers:
- name: pod
image: burlyluo/nettoolbox
EOF
kubectl get pods -o wide
kubectl exec pod/pod-macvlan -- ifconfig
欢迎加群讨论技术,1群:677373950(满了,可以加,但通过不了),2群:656732739
评价