cloudnativer / kube-ipam Goto Github PK
View Code? Open in Web Editor NEW可以固定Pod/容器組IP地址的kubernetes網路輔助管理挿件。Kubernetes network management plug-in based on etcd storage can assign fixed IP for pod.
License: Apache License 2.0
可以固定Pod/容器組IP地址的kubernetes網路輔助管理挿件。Kubernetes network management plug-in based on etcd storage can assign fixed IP for pod.
License: Apache License 2.0
# kubectl version
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.5", GitCommit:"aea7bbadd2fc0cd689de94a54e5b7b758869d691", GitTreeState:"clean", BuildDate:"2021-09-15T21:10:45Z", GoVersion:"go1.16.8", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.5", GitCommit:"aea7bbadd2fc0cd689de94a54e5b7b758869d691", GitTreeState:"clean", BuildDate:"2021-09-15T21:04:16Z", GoVersion:"go1.16.8", Compiler:"gc", Platform:"linux/amd64"}
# cilium version
Client: 1.8.3 54cf3810d 2020-09-04T14:01:53+02:00 go version go1.14.7 linux/amd64
Daemon: 1.8.3 54cf3810d 2020-09-04T14:01:53+02:00 go version go1.14.7 linux/amd64
# uname -a
Linux node1 5.11.0-41-generic #45~20.04.1-Ubuntu SMP Wed Nov 10 10:20:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
# ls -l /opt/cni/bin/
total 131796
-rwxr-xr-x 1 root root 4151672 2月 5 2021 bandwidth
-rwxr-xr-x 1 root root 4536104 2月 5 2021 bridge
-rwxr-xr-x 1 root root 13979648 12月 6 16:34 cilium-cni
-rwxr-xr-x 1 root root 10270090 2月 5 2021 dhcp
-rwxr-xr-x 1 root root 4767801 2月 5 2021 firewall
-rwxr-xr-x 1 root root 3357992 2月 5 2021 flannel
-rwxr-xr-x 1 root root 4144106 2月 5 2021 host-device
-rwxr-xr-x 1 root root 3565330 2月 5 2021 host-local
-rwxr-xr-x 1 root root 4288339 2月 5 2021 ipvlan
-rwxr-xr-x 1 root root 46967980 12月 6 16:50 kube-ipam
-rwxr-xr-x 1 root root 3530531 2月 5 2021 loopback
-rwxr-xr-x 1 root root 4367216 2月 5 2021 macvlan
-rwxr-xr-x 1 root root 3966455 2月 5 2021 portmap
-rwxr-xr-x 1 root root 4467317 2月 5 2021 ptp
-rwxr-xr-x 1 root root 3701138 2月 5 2021 sbr
-rwxr-xr-x 1 root root 3153330 2月 5 2021 static
-rwxr-xr-x 1 root root 3668289 2月 5 2021 tuning
-rwxr-xr-x 1 root root 4287972 2月 5 2021 vlan
-rwxr-xr-x 1 root root 3759977 2月 5 2021 vrf
# ll /etc/cni/net.d/
total 16
drwxr-xr-x 2 kube root 4096 12月 6 17:59 ./
drwxr-xr-x 3 kube root 4096 12月 6 16:31 ../
-rw-r--r-- 1 root root 827 12月 6 17:59 05-cilium.conf
-rw-r--r-- 1 root root 97 12月 6 16:44 05-cilium.conf.bak
# cat /etc/cni/net.d/05-cilium.conf
{
"cniVersion": "0.3.1",
"name": "cilium",
"type": "cilium-cni",
"enable-debug": true,
"ipam": {
"name": "kube-subnet",
"type": "kube-ipam",
"etcdConfig": {
"etcdURL": "https://127.0.0.1:2379",
"kubeConfig": "/etc/kubernetes/admin.conf",
"etcdCertFile": "/etc/ssl/etcd/ssl/admin-node1.pem",
"etcdKeyFile": "/etc/ssl/etcd/ssl/admin-node1-key.pem",
"etcdTrustedCAFileFile": "/etc/ssl/etcd/ssl/ca.pem"
},
"subnet": "10.188.0.0/16",
"rangeStart": "10.188.0.10",
"rangeEnd": "10.188.0.200",
"gateway": "10.188.0.1",
"routes": [{
"dst": "0.0.0.0/0"
}],
"resolvConf": "/etc/resolv.conf"
}
}
And when i created pod, the pod ip is still uses the ip of the cilium network。
# kubectl get pods web-5c57fc9cf6-wp5b6 -owide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
web-5c57fc9cf6-wp5b6 1/1 Running 0 90s 10.233.64.47 node1 <none> <none>
Is there a way to suppprt random fixed ip for pod rather than passed by pod annotation for a concreate ip
etcdConfig, an object of etcd address info
etcdURL (string, required): The URL of etcd
etcdCertFile (string, required): The cert file of etcd
etcdKeyFile (string, required): The key file of etcd
etcdTrustedCAFileFile (string, required): The ca file of etcd
do we test combine with the mutiple CNI ,like Multus?
another QA: do we have a plan to support the data-store with kubernetes?
Question : Whether it's when I try to use this kube-ipam
plugin for fixed my pod IP , my cluster k8s cluster CNI plugin which config and deploy form offical calico-etcd.yaml
,version : v3.19.x .
I try to modify /etc/cni/net.d/10-calico.conflist which created by initContainer : install-cni
like :
{
"name": "k8s-pod-network",
"cniVersion": "0.3.1",
"plugins": [
{
"type": "calico",
"log_level": "info",
...
"ipam": {
"name": "kube-subnet",
"type": "kube-ipam",
"etcdConfig": {
"etcdURL": "https://192.168.1.50:2379,https://192.168.1.58:2379,https://192.168.1.63:2379",
"kubeConfig": "/etc/kubernetes/pki/kubectl.kubeconfig"
"etcdCertFile": "/etc/kubernetes/ssl/etcd.pem",
"etcdKeyFile": "/etc/kubernetes/ssl/etcd-key.pem",
"etcdTrustedCAFileFile": "/etc/kubernetes/ssl/ca.pem"
},
"subnet": "10.188.0.0/16",
"rangeStart": "10.188.0.10",
"rangeEnd": "10.188.0.200",
"gateway": "10.188.0.1",
"routes": [{
"dst": "0.0.0.0/0"
}],
"resolvConf": "/etc/resolv.conf"
},
"policy": {
"type": "k8s"
},
"kubernetes": {
"kubeconfig": "/etc/cni/net.d/calico-kubeconfig"
}
},
...
{
"type": "bandwidth",
"capabilities": {"bandwidth": true}
}
]
}
So if I do this replacement is work or not ? Thanks a lot
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.