Skip to content

Commit

Permalink
Fixes for large overlay networks
Browse files Browse the repository at this point in the history
[#136965707]

Signed-off-by: Genevieve LEsperance <[email protected]>
  • Loading branch information
rosenhouse authored and Genevieve LEsperance committed Jan 6, 2017
1 parent 9a4be24 commit 9b5d649
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
4 changes: 3 additions & 1 deletion docs/operation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
### Flannel Network Configuration
The default flannel network is `10.255.0.0/16` which will allow for a maximum of 256 cells.

The network can be configured via the bosh property: `cni-flannel.flannel.Network`.
The network can be configured via **two** bosh properties:
- `cni-flannel.flannel.Network`
- `garden-cni.overlay_network`

For instance, to allow for up to 4096 cells, `10.240.0.0/12` could be used.

Expand Down
16 changes: 2 additions & 14 deletions src/example-apps/cats-and-dogs/backend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"html/template"
"log"
"net"
"net/http"
"os"
"strconv"
Expand Down Expand Up @@ -105,22 +104,11 @@ var catPageTemplate string = `

func (h *InfoHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
log.Printf("InfoHandler: request received from %s", req.RemoteAddr)
addrs, err := net.InterfaceAddrs()
if err != nil {
panic(err)
}
var overlayIP string
for _, addr := range addrs {
listenAddr := strings.Split(addr.String(), "/")[0]
if strings.HasPrefix(listenAddr, "10.255.") {
overlayIP = listenAddr
}
}

instanceIndex := os.Getenv("CF_INSTANCE_INDEX")

overlayIP := os.Getenv("CF_INSTANCE_INTERNAL_IP")
template := template.Must(template.New("publicPage").Parse(publicPageTemplate))
err = template.Execute(resp, PublicPage{
err := template.Execute(resp, PublicPage{
Stylesheet: stylesheet,
OverlayIP: overlayIP,
InstanceIndex: instanceIndex,
Expand Down

0 comments on commit 9b5d649

Please sign in to comment.