Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
main
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Simone Rossi
main
Commits
da752d39
Commit
da752d39
authored
Aug 29, 2017
by
Quang-Nhat HOANG-XUAN
Committed by
GitHub
Aug 29, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #84 from DistributedSystemsGroup/kpmg/fix-service-port-name
multiple port, disable checker for k8s
parents
fa810e0d
7a2dd9d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
zoe_master/backends/kubernetes/api_client.py
zoe_master/backends/kubernetes/api_client.py
+11
-1
zoe_master/backends/kubernetes/backend.py
zoe_master/backends/kubernetes/backend.py
+2
-2
No files found.
zoe_master/backends/kubernetes/api_client.py
View file @
da752d39
...
...
@@ -77,7 +77,7 @@ class KubernetesServiceConf:
for
prt
in
ports
:
aux
=
self
.
conf
[
'spec'
][
'ports'
]
# type: List[Dict[str, str]]
aux
[
count
][
'name'
]
=
'http
'
aux
[
count
][
'name'
]
=
'http
-'
+
str
(
count
)
aux
[
count
][
'port'
]
=
prt
.
number
aux
[
count
][
'targetPort'
]
=
prt
.
number
count
+=
1
...
...
@@ -184,6 +184,13 @@ class KubernetesReplicationControllerConf:
aux
=
self
.
conf
[
'spec'
][
'template'
]
# type: Dict
aux
[
'spec'
][
'containers'
][
0
][
'resources'
][
'limits'
][
'cpu'
]
=
corelimit
def
set_spec_container_command
(
self
,
command
):
"""Setter to set container command"""
aux
=
self
.
conf
[
'spec'
][
'template'
]
aux
[
'spec'
][
'containers'
][
0
][
'command'
]
=
[]
command_arr
=
command
.
split
(
" "
)
aux
[
'spec'
][
'containers'
][
0
][
'command'
]
=
command_arr
def
set_spec_container_volumes
(
self
,
volumes
:
List
[
VolumeDescription
],
name
:
str
):
"""Setter to set container volumes"""
aux
=
self
.
conf
[
'spec'
][
'template'
]
# type: Dict
...
...
@@ -261,6 +268,9 @@ class KubernetesClient:
if
len
(
service_instance
.
volumes
)
>
0
:
config
.
set_spec_container_volumes
(
service_instance
.
volumes
,
service_instance
.
name
)
if
service_instance
.
command
is
not
None
:
config
.
set_spec_container_command
(
service_instance
.
command
)
info
=
{}
try
:
...
...
zoe_master/backends/kubernetes/backend.py
View file @
da752d39
...
...
@@ -43,13 +43,13 @@ class KubernetesBackend(zoe_master.backends.base.BaseBackend):
"""Initializes Kubernetes backend starting the event monitoring thread."""
global
_monitor
,
_checker
_monitor
=
KubernetesMonitor
(
state
)
_checker
=
KubernetesStateSynchronizer
(
state
)
#
_checker = KubernetesStateSynchronizer(state)
@
classmethod
def
shutdown
(
cls
):
"""Performs a clean shutdown of the resources used by Swarm backend."""
_monitor
.
quit
()
_checker
.
quit
()
#
_checker.quit()
def
spawn_service
(
self
,
service_instance
:
ServiceInstance
):
"""Spawn a service, translating a Zoe Service into a Docker container."""
...
...
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