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
280ea7f4
Commit
280ea7f4
authored
Jul 13, 2017
by
Konstantinos Tsakalozos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set default CIDR to /16
parent
2492477f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
config.yaml
cluster/juju/layers/kubernetes-master/config.yaml
+1
-1
kubernetes_master.py
...ju/layers/kubernetes-master/reactive/kubernetes_master.py
+9
-8
No files found.
cluster/juju/layers/kubernetes-master/config.yaml
View file @
280ea7f4
...
...
@@ -9,7 +9,7 @@ options:
description
:
The local domain for cluster dns
service-cidr
:
type
:
string
default
:
10.152.
183.0/24
default
:
10.152.
0.0/16
description
:
CIDR to user for Kubernetes services. Cannot be changed after deployment.
allow-privileged
:
type
:
string
...
...
cluster/juju/layers/kubernetes-master/reactive/kubernetes_master.py
View file @
280ea7f4
...
...
@@ -22,6 +22,7 @@ import shutil
import
socket
import
string
import
json
import
ipaddress
import
charms.leadership
...
...
@@ -783,18 +784,18 @@ def create_kubeconfig(kubeconfig, server, ca, key=None, certificate=None,
def
get_dns_ip
():
'''Get an IP address for the DNS server on the provided cidr.'''
# Remove the range from the cidr.
ip
=
service_cidr
()
.
split
(
'/'
)[
0
]
# Take the last octet off the IP address and replace it with 10.
return
'.'
.
join
(
ip
.
split
(
'.'
)[
0
:
-
1
])
+
'.10'
interface
=
ipaddress
.
IPv4Interface
(
service_cidr
())
# Add .10 at the end of the network
ip
=
interface
.
network
.
network_address
+
10
return
ip
.
exploded
def
get_kubernetes_service_ip
():
'''Get the IP address for the kubernetes service based on the cidr.'''
# Remove the range from the cidr.
ip
=
service_cidr
()
.
split
(
'/'
)[
0
]
# Remove the last octet and replace it with 1.
return
'.'
.
join
(
ip
.
split
(
'.'
)[
0
:
-
1
])
+
'.1'
interface
=
ipaddress
.
IPv4Interface
(
service_cidr
())
# Add .1 at the end of the network
ip
=
interface
.
network
.
network_address
+
1
return
ip
.
exploded
def
handle_etcd_relation
(
reldata
):
...
...
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