mirror of
https://github.com/cloudnativelabs/kube-router.git
synced 2025-12-10 22:31:24 +01:00
Use forward domain notation for annotations
"kube-router.io/..." This is in line with convention set by k8s upstream.
This commit is contained in:
parent
c714a80fcc
commit
a5a446a6ca
@ -180,7 +180,7 @@ and run kube-proxy with the configuration you have.
|
|||||||
|
|
||||||
Communication from a Pod that is behind a Service to its own ClusterIP:Port is
|
Communication from a Pod that is behind a Service to its own ClusterIP:Port is
|
||||||
not supported by default. However, It can be enabled per-service by adding the
|
not supported by default. However, It can be enabled per-service by adding the
|
||||||
`io.kube-router.net.service.hairpin=` annotation, or for all Services in a cluster by
|
`kube-router.io/service.hairpin=` annotation, or for all Services in a cluster by
|
||||||
passing the flag `--hairpin-mode=true` to kube-router.
|
passing the flag `--hairpin-mode=true` to kube-router.
|
||||||
|
|
||||||
Additionally, the `hairpin_mode` sysctl option must be set to `1` for all veth
|
Additionally, the `hairpin_mode` sysctl option must be set to `1` for all veth
|
||||||
@ -209,7 +209,7 @@ Service ClusterIP if it is logging the source IP.
|
|||||||
|
|
||||||
To enable hairpin traffic for Service `my-service`:
|
To enable hairpin traffic for Service `my-service`:
|
||||||
```
|
```
|
||||||
kubectl annotate service my-service "io.kube-router.net.service.hairpin="
|
kubectl annotate service my-service "kube-router.io/service.hairpin="
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -23,13 +23,13 @@ per node models. Nodes in the cluster does not form full node-to-node mesh.
|
|||||||
Users has to explicitly select this mode by specifying `--nodes-full-mesh=false`
|
Users has to explicitly select this mode by specifying `--nodes-full-mesh=false`
|
||||||
when launching kube-router. In this mode kube-router expects each node is
|
when launching kube-router. In this mode kube-router expects each node is
|
||||||
configured with an ASN number from the node's API object annoations. Kube-router
|
configured with an ASN number from the node's API object annoations. Kube-router
|
||||||
will use the node's `io.kube-router.net.node.asn` annotation value as the ASN
|
will use the node's `kube-router.io/node.asn` annotation value as the ASN
|
||||||
number for the node.
|
number for the node.
|
||||||
|
|
||||||
Users can annotate node objects with the following command:
|
Users can annotate node objects with the following command:
|
||||||
|
|
||||||
```
|
```
|
||||||
kubectl annotate node <kube-node> "io.kube-router.net.node.asn=64512"
|
kubectl annotate node <kube-node> "kube-router.io/node.asn=64512"
|
||||||
```
|
```
|
||||||
|
|
||||||
Only nodes with in same ASN form full mesh. Two nodes with different ASNs never
|
Only nodes with in same ASN form full mesh. Two nodes with different ASNs never
|
||||||
@ -55,21 +55,21 @@ For example:
|
|||||||
Alternativley, each node can be configured with one or more node specific BGP
|
Alternativley, each node can be configured with one or more node specific BGP
|
||||||
peers. Information regarding node specific BGP peer is read from node API object
|
peers. Information regarding node specific BGP peer is read from node API object
|
||||||
annotations:
|
annotations:
|
||||||
- `io.kube-router.net.peer.ips`
|
- `kube-router.io/peer.ips`
|
||||||
- `io.kube-router.net.peer.asns`
|
- `kube-router.io/peer.asns`
|
||||||
|
|
||||||
|
|
||||||
For e.g users can annotate node object with below commands
|
For e.g users can annotate node object with below commands
|
||||||
```
|
```
|
||||||
kubectl annotate node <kube-node> "io.kube-router.net.peer.ips=192.168.1.99,192.168.1.100"
|
kubectl annotate node <kube-node> "kube-router.io/peer.ips=192.168.1.99,192.168.1.100"
|
||||||
kubectl annotate node <kube-node> "io.kube-router.net.peer.asns=65000,65000"
|
kubectl annotate node <kube-node> "kube-router.io/peer.asns=65000,65000"
|
||||||
```
|
```
|
||||||
|
|
||||||
### BGP Peer Password Authentication
|
### BGP Peer Password Authentication
|
||||||
|
|
||||||
The examples above have assumed there is no password authentication with BGP
|
The examples above have assumed there is no password authentication with BGP
|
||||||
peer routers. If you need to use a password for peering, you can use the
|
peer routers. If you need to use a password for peering, you can use the
|
||||||
`--peer-router-passwords` CLI flag or the `io.kube-router.net.peer.passwords` node
|
`--peer-router-passwords` CLI flag or the `kube-router.io/peer.passwords` node
|
||||||
annotation.
|
annotation.
|
||||||
|
|
||||||
#### Base64 Encoding Passwords
|
#### Base64 Encoding Passwords
|
||||||
@ -97,7 +97,7 @@ Note the comma indicating the end of the first password.
|
|||||||
|
|
||||||
Now here's the same example but configured as node annotations:
|
Now here's the same example but configured as node annotations:
|
||||||
```
|
```
|
||||||
kubectl annotate node <kube-node> "io.kube-router.net.peer.ips=192.168.1.99,192.168.1.100"
|
kubectl annotate node <kube-node> "kube-router.io/peer.ips=192.168.1.99,192.168.1.100"
|
||||||
kubectl annotate node <kube-node> "io.kube-router.net.peer.asns=65000,65000"
|
kubectl annotate node <kube-node> "kube-router.io/peer.asns=65000,65000"
|
||||||
kubectl annotate node <kube-node> "io.kube-router.net.peer.passwords=U2VjdXJlUGFzc3dvcmQK,"
|
kubectl annotate node <kube-node> "kube-router.io/peer.passwords=U2VjdXJlUGFzc3dvcmQK,"
|
||||||
```
|
```
|
||||||
|
|||||||
@ -95,13 +95,13 @@ CLI flag additions:
|
|||||||
|
|
||||||
Annotation key changes:
|
Annotation key changes:
|
||||||
- OLD: `kube-router.io/hairpin-mode=` -> NEW:
|
- OLD: `kube-router.io/hairpin-mode=` -> NEW:
|
||||||
`io.kube-router.net.service.hairpin=`
|
`kube-router.io/service.hairpin=`
|
||||||
- OLD: `net.kuberouter.nodeasn=` -> NEW: `io.kube-router.net.node.asn=`
|
- OLD: `net.kuberouter.nodeasn=` -> NEW: `kube-router.io/node.asn=`
|
||||||
- OLD: `net.kuberouter.node.bgppeer.address=` -> NEW: `io.kube-router.net.peer.ips`
|
- OLD: `net.kuberouter.node.bgppeer.address=` -> NEW: `kube-router.io/peer.ips`
|
||||||
- OLD: `net.kuberouter.node.bgppeer.asn` -> NEW: `io.kube-router.net.peer.asns`
|
- OLD: `net.kuberouter.node.bgppeer.asn` -> NEW: `kube-router.io/peer.asns`
|
||||||
|
|
||||||
Annotation key additions:
|
Annotation key additions:
|
||||||
- NEW: `io.kube-router.net.peer.passwords`
|
- NEW: `kube-router.io/peer.passwords`
|
||||||
|
|
||||||
#### v0.0.17 Upgrade Procedure
|
#### v0.0.17 Upgrade Procedure
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ Annotations: kube-router.io/hairpin-mode=
|
|||||||
|
|
||||||
You will then want to make a new annotation with the new key:
|
You will then want to make a new annotation with the new key:
|
||||||
```sh
|
```sh
|
||||||
kubectl annotate service hairpin-service "io.kube-router.net.service.hairpin="
|
kubectl annotate service hairpin-service "kube-router.io/service.hairpin="
|
||||||
```
|
```
|
||||||
|
|
||||||
Once all new annotations are created, proceed with the
|
Once all new annotations are created, proceed with the
|
||||||
|
|||||||
@ -779,7 +779,7 @@ func (nrc *NetworkRoutingController) syncPeers() {
|
|||||||
// if node full mesh is not requested then just peer with nodes with same ASN
|
// if node full mesh is not requested then just peer with nodes with same ASN
|
||||||
// (run iBGP among same ASN peers)
|
// (run iBGP among same ASN peers)
|
||||||
if !nrc.bgpFullMeshMode {
|
if !nrc.bgpFullMeshMode {
|
||||||
nodeasn, ok := node.ObjectMeta.Annotations["io.kube-router.net.node.asn"]
|
nodeasn, ok := node.ObjectMeta.Annotations["kube-router.io/node.asn"]
|
||||||
if !ok {
|
if !ok {
|
||||||
glog.Infof("Not peering with the Node %s as ASN number of the node is unknown.",
|
glog.Infof("Not peering with the Node %s as ASN number of the node is unknown.",
|
||||||
nodeIP.String())
|
nodeIP.String())
|
||||||
@ -982,7 +982,7 @@ func (nrc *NetworkRoutingController) startBgpServer() error {
|
|||||||
if nrc.bgpFullMeshMode {
|
if nrc.bgpFullMeshMode {
|
||||||
nodeAsnNumber = nrc.defaultNodeAsnNumber
|
nodeAsnNumber = nrc.defaultNodeAsnNumber
|
||||||
} else {
|
} else {
|
||||||
nodeasn, ok := node.ObjectMeta.Annotations["io.kube-router.net.node.asn"]
|
nodeasn, ok := node.ObjectMeta.Annotations["kube-router.io/node.asn"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return errors.New("Could not find ASN number for the node. " +
|
return errors.New("Could not find ASN number for the node. " +
|
||||||
"Node needs to be annotated with ASN number details to start BGP server.")
|
"Node needs to be annotated with ASN number details to start BGP server.")
|
||||||
@ -1030,7 +1030,7 @@ func (nrc *NetworkRoutingController) startBgpServer() error {
|
|||||||
// else attempt to get peers from node specific BGP annotations.
|
// else attempt to get peers from node specific BGP annotations.
|
||||||
if len(nrc.globalPeerRouters) == 0 {
|
if len(nrc.globalPeerRouters) == 0 {
|
||||||
// Get Global Peer Router ASN configs
|
// Get Global Peer Router ASN configs
|
||||||
nodeBgpPeerAsnsAnnotation, ok := node.ObjectMeta.Annotations["io.kube-router.net.peer.asns"]
|
nodeBgpPeerAsnsAnnotation, ok := node.ObjectMeta.Annotations["kube-router.io/peer.asns"]
|
||||||
if !ok {
|
if !ok {
|
||||||
glog.Infof("Could not find BGP peer info for the node in the node annotations so skipping configuring peer.")
|
glog.Infof("Could not find BGP peer info for the node in the node annotations so skipping configuring peer.")
|
||||||
return nil
|
return nil
|
||||||
@ -1044,7 +1044,7 @@ func (nrc *NetworkRoutingController) startBgpServer() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get Global Peer Router IP Address configs
|
// Get Global Peer Router IP Address configs
|
||||||
nodeBgpPeersAnnotation, ok := node.ObjectMeta.Annotations["io.kube-router.net.peer.ips"]
|
nodeBgpPeersAnnotation, ok := node.ObjectMeta.Annotations["kube-router.io/peer.ips"]
|
||||||
if !ok {
|
if !ok {
|
||||||
glog.Infof("Could not find BGP peer info for the node in the node annotations so skipping configuring peer.")
|
glog.Infof("Could not find BGP peer info for the node in the node annotations so skipping configuring peer.")
|
||||||
return nil
|
return nil
|
||||||
@ -1058,7 +1058,7 @@ func (nrc *NetworkRoutingController) startBgpServer() error {
|
|||||||
|
|
||||||
// Get Global Peer Router Password configs
|
// Get Global Peer Router Password configs
|
||||||
peerPasswords := []string{}
|
peerPasswords := []string{}
|
||||||
nodeBGPPasswordsAnnotation, ok := node.ObjectMeta.Annotations["io.kube-router.net.peer.passwords"]
|
nodeBGPPasswordsAnnotation, ok := node.ObjectMeta.Annotations["kube-router.io/peer.passwords"]
|
||||||
if !ok {
|
if !ok {
|
||||||
glog.Infof("Could not find BGP peer password info in the node's annotations. Assuming no passwords.")
|
glog.Infof("Could not find BGP peer password info in the node's annotations. Assuming no passwords.")
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -426,7 +426,7 @@ func buildServicesInfo() serviceInfoMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
svcInfo.sessionAffinity = (svc.Spec.SessionAffinity == "ClientIP")
|
svcInfo.sessionAffinity = (svc.Spec.SessionAffinity == "ClientIP")
|
||||||
_, svcInfo.hairpin = svc.ObjectMeta.Annotations["io.kube-router.net.service.hairpin"]
|
_, svcInfo.hairpin = svc.ObjectMeta.Annotations["kube-router.io/service.hairpin"]
|
||||||
|
|
||||||
svcId := generateServiceId(svc.Namespace, svc.Name, port.Name)
|
svcId := generateServiceId(svc.Namespace, svc.Name, port.Name)
|
||||||
serviceMap[svcId] = &svcInfo
|
serviceMap[svcId] = &svcInfo
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user