Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
aef2aecd
Commit
aef2aecd
authored
Jan 23, 2018
by
Mike Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding network spaces support for kubeapi-load-balancer.
parent
ee14d2ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
load_balancer.py
...ju/layers/kubeapi-load-balancer/reactive/load_balancer.py
+18
-3
No files found.
cluster/juju/layers/kubeapi-load-balancer/reactive/load_balancer.py
View file @
aef2aecd
...
@@ -56,8 +56,23 @@ apilb_nginx = """/var/log/nginx.*.log {
...
@@ -56,8 +56,23 @@ apilb_nginx = """/var/log/nginx.*.log {
}"""
}"""
@when
(
'certificates.available'
)
def
get_ingress_address
(
relation
):
def
request_server_certificates
(
tls
):
try
:
network_info
=
hookenv
.
network_get
(
relation
.
relation_name
)
except
NotImplementedError
:
network_info
=
[]
if
network_info
and
'ingress-addresses'
in
network_info
:
# just grab the first one for now, maybe be more robust here?
return
network_info
[
'ingress-addresses'
][
0
]
else
:
# if they don't have ingress-addresses they are running a juju that
# doesn't support spaces, so just return the private address
return
hookenv
.
unit_get
(
'private-address'
)
@when
(
'certificates.available'
,
'website.available'
)
def
request_server_certificates
(
tls
,
website
):
'''Send the data that is required to create a server certificate for
'''Send the data that is required to create a server certificate for
this server.'''
this server.'''
# Use the public ip of this unit as the Common Name for the certificate.
# Use the public ip of this unit as the Common Name for the certificate.
...
@@ -65,7 +80,7 @@ def request_server_certificates(tls):
...
@@ -65,7 +80,7 @@ def request_server_certificates(tls):
# Create SANs that the tls layer will add to the server cert.
# Create SANs that the tls layer will add to the server cert.
sans
=
[
sans
=
[
hookenv
.
unit_public_ip
(),
hookenv
.
unit_public_ip
(),
hookenv
.
unit_private_ip
(
),
get_ingress_address
(
website
),
socket
.
gethostname
(),
socket
.
gethostname
(),
]
]
# maybe they have extra names they want as SANs
# maybe they have extra names they want as SANs
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment