forked from docc-lab/dsb_k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add MetalLB to provide a loadbalancer for services.
(defaults to on; profile also requests a single public IP.)
- Loading branch information
1 parent
3ae0111
commit dcaf7b5
Showing
4 changed files
with
125 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env python | ||
|
||
from __future__ import print_function | ||
import sys | ||
import lxml.etree | ||
|
||
f = open(sys.argv[1],'r') | ||
contents = f.read() | ||
f.close() | ||
root = lxml.etree.fromstring(contents) | ||
|
||
mycluster = None | ||
if len(sys.argv) > 2: | ||
mycluster = sys.argv[2] | ||
|
||
# Find all the public IP addresses: | ||
for elm in root.getchildren(): | ||
if not elm.tag.endswith("}routable_pool"): | ||
continue | ||
name = elm.get("client_id") | ||
if mycluster and not name.endswith("-%s" % (mycluster,)): | ||
continue | ||
for elm2 in elm.getchildren(): | ||
if elm2.tag.endswith("}ipv4"): | ||
print("%s/%s" % (elm2.get("address"),elm2.get("netmask"))) | ||
|
||
sys.exit(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters