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
4f7d9863
Commit
4f7d9863
authored
Aug 10, 2015
by
Marek Grabowski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12362 from mbruzek/post-v1-fixes
Post v1 fixes
parents
e0347124
b0ee17c4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
+11
-7
install.py
...ter/juju/charms/trusty/kubernetes-master/hooks/install.py
+8
-5
hooks.py
cluster/juju/charms/trusty/kubernetes/hooks/hooks.py
+2
-1
registrator.py
...er/juju/charms/trusty/kubernetes/hooks/lib/registrator.py
+1
-1
No files found.
cluster/juju/charms/trusty/kubernetes-master/hooks/install.py
View file @
4f7d9863
...
@@ -64,7 +64,10 @@ def clone_repository():
...
@@ -64,7 +64,10 @@ def clone_repository():
"""
"""
repository
=
'https://github.com/GoogleCloudPlatform/kubernetes.git'
repository
=
'https://github.com/GoogleCloudPlatform/kubernetes.git'
kubernetes_directory
=
'/opt/kubernetes'
kubernetes_directory
=
path
(
'/opt/kubernetes'
)
# Since we can not clone twice, check for the directory and remove it.
if
kubernetes_directory
.
isdir
():
kubernetes_directory
.
rmtree_p
()
command
=
[
'git'
,
'clone'
,
repository
,
kubernetes_directory
]
command
=
[
'git'
,
'clone'
,
repository
,
kubernetes_directory
]
print
(
command
)
print
(
command
)
...
@@ -75,8 +78,8 @@ def clone_repository():
...
@@ -75,8 +78,8 @@ def clone_repository():
def
install_packages
():
def
install_packages
():
"""
"""
Install required packages to build the k8s source, and syndicate between
Install required packages to build the k8s source, and syndicate between
minion nodes. In addition, fetch pip to handle python dependencies
minion nodes. In addition, fetch pip to handle python dependencies
"""
"""
hookenv
.
log
(
'Installing Debian packages'
)
hookenv
.
log
(
'Installing Debian packages'
)
# Create the list of packages to install.
# Create the list of packages to install.
...
@@ -87,8 +90,8 @@ def install_packages():
...
@@ -87,8 +90,8 @@ def install_packages():
def
update_rc_files
(
strings
):
def
update_rc_files
(
strings
):
"""
"""
Preseed the bash environment for ubuntu and root with K8's env vars to
Preseed the bash environment for ubuntu and root with K8's env vars to
make interfacing with the api easier. (see: kubectrl docs)
make interfacing with the api easier. (see: kubectrl docs)
"""
"""
rc_files
=
[
path
(
'/home/ubuntu/.bashrc'
),
path
(
'/root/.bashrc'
)]
rc_files
=
[
path
(
'/home/ubuntu/.bashrc'
),
path
(
'/root/.bashrc'
)]
for
rc_file
in
rc_files
:
for
rc_file
in
rc_files
:
...
...
cluster/juju/charms/trusty/kubernetes/hooks/hooks.py
View file @
4f7d9863
...
@@ -204,8 +204,9 @@ def register_machine(apiserver, retry=False):
...
@@ -204,8 +204,9 @@ def register_machine(apiserver, retry=False):
mem
=
info
.
strip
()
.
split
(
':'
)[
1
]
.
strip
()
.
split
()[
0
]
mem
=
info
.
strip
()
.
split
(
':'
)[
1
]
.
strip
()
.
split
()[
0
]
cpus
=
os
.
sysconf
(
'SC_NPROCESSORS_ONLN'
)
cpus
=
os
.
sysconf
(
'SC_NPROCESSORS_ONLN'
)
# https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/admin/node.md
registration_request
=
Registrator
()
registration_request
=
Registrator
()
registration_request
.
data
[
'
Kind'
]
=
'Minion
'
registration_request
.
data
[
'
kind'
]
=
'Node
'
registration_request
.
data
[
'id'
]
=
private_address
registration_request
.
data
[
'id'
]
=
private_address
registration_request
.
data
[
'name'
]
=
private_address
registration_request
.
data
[
'name'
]
=
private_address
registration_request
.
data
[
'metadata'
][
'name'
]
=
private_address
registration_request
.
data
[
'metadata'
][
'name'
]
=
private_address
...
...
cluster/juju/charms/trusty/kubernetes/hooks/lib/registrator.py
View file @
4f7d9863
...
@@ -24,7 +24,7 @@ class Registrator:
...
@@ -24,7 +24,7 @@ class Registrator:
def
__init__
(
self
):
def
__init__
(
self
):
self
.
ds
=
{
self
.
ds
=
{
"creationTimestamp"
:
""
,
"creationTimestamp"
:
""
,
"kind"
:
"
Minion
"
,
"kind"
:
"
Node
"
,
"name"
:
""
,
# private_address
"name"
:
""
,
# private_address
"metadata"
:
{
"metadata"
:
{
"name"
:
""
,
#private_address,
"name"
:
""
,
#private_address,
...
...
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