Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
6ec1c9e3
Commit
6ec1c9e3
authored
Mar 30, 2016
by
Jack Greenfield
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #500 from jackgr/deployment
More tweaks to enable end to end deployment
parents
c69ed291
0b3f545b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
42 deletions
+42
-42
expander_test.go
cmd/expandybird/expander/expander_test.go
+31
-31
properties.go
cmd/helm/properties.go
+3
-3
replicatedservice-3.tgz
examples/charts/replicatedservice-3.tgz
+0
-0
replicatedservice.py
...s/charts/replicatedservice/templates/replicatedservice.py
+8
-8
No files found.
cmd/expandybird/expander/expander_test.go
View file @
6ec1c9e3
...
...
@@ -756,44 +756,16 @@ func TestReplicatedService(t *testing.T) {
&
expansion
.
ServiceResponse
{
Resources
:
[]
interface
{}{
map
[
string
]
interface
{}{
"type"
:
"Service"
,
"name"
:
"test_invocation-service"
,
"properties"
:
map
[
string
]
interface
{}{
"kind"
:
"Service"
,
"apiVersion"
:
"v1"
,
"namespace"
:
"default"
,
"metadata"
:
map
[
string
]
interface
{}{
"name"
:
"test_invocation-service"
,
"labels"
:
map
[
string
]
interface
{}{
"name"
:
"test_invocation-service"
,
},
},
"spec"
:
map
[
string
]
interface
{}{
"ports"
:
[]
interface
{}{
map
[
string
]
interface
{}{
"name"
:
"test_invocation"
,
"port"
:
1234.0
,
"targetPort"
:
1234.0
,
},
},
"selector"
:
map
[
string
]
interface
{}{
"name"
:
"test_invocation"
,
},
},
},
},
map
[
string
]
interface
{}{
"type"
:
"ReplicationController"
,
"name"
:
"test_invocation-rc"
,
"properties"
:
map
[
string
]
interface
{}{
"kind"
:
"ReplicationController"
,
"apiVersion"
:
"v1"
,
"
namespace"
:
"default
"
,
"
kind"
:
"ReplicationController
"
,
"metadata"
:
map
[
string
]
interface
{}{
"name"
:
"test_invocation-rc"
,
"labels"
:
map
[
string
]
interface
{}{
"name"
:
"test_invocation-rc"
,
},
"name"
:
"test_invocation-rc"
,
"namespace"
:
"default"
,
},
"spec"
:
map
[
string
]
interface
{}{
"replicas"
:
3.0
,
...
...
@@ -824,6 +796,34 @@ func TestReplicatedService(t *testing.T) {
},
},
},
"type"
:
"ReplicationController"
,
},
map
[
string
]
interface
{}{
"name"
:
"test_invocation-service"
,
"properties"
:
map
[
string
]
interface
{}{
"apiVersion"
:
"v1"
,
"kind"
:
"Service"
,
"metadata"
:
map
[
string
]
interface
{}{
"labels"
:
map
[
string
]
interface
{}{
"name"
:
"test_invocation-service"
,
},
"name"
:
"test_invocation-service"
,
"namespace"
:
"default"
,
},
"spec"
:
map
[
string
]
interface
{}{
"ports"
:
[]
interface
{}{
map
[
string
]
interface
{}{
"name"
:
"test_invocation"
,
"port"
:
1234.0
,
"targetPort"
:
1234.0
,
},
},
"selector"
:
map
[
string
]
interface
{}{
"name"
:
"test_invocation"
,
},
},
},
"type"
:
"Service"
,
},
},
},
...
...
cmd/helm/properties.go
View file @
6ec1c9e3
...
...
@@ -40,15 +40,15 @@ func parseProperties(kvstr string) (map[string]interface{}, error) {
// Allow for "k=v, k=v"
p
=
strings
.
TrimSpace
(
p
)
pair
:=
strings
.
Split
(
p
,
"="
)
if
len
(
pair
)
==
1
{
if
len
(
pair
)
<
2
{
return
properties
,
errInvalidProperty
}
// If the value looks int-like, convert it.
if
i
,
err
:=
strconv
.
Atoi
(
pair
[
1
]);
err
==
nil
{
properties
[
pair
[
0
]]
=
pair
[
1
]
}
else
{
properties
[
pair
[
0
]]
=
i
}
else
{
properties
[
pair
[
0
]]
=
pair
[
1
]
}
}
...
...
examples/charts/replicatedservice-3.tgz
View file @
6ec1c9e3
No preview for this file type
examples/charts/replicatedservice/templates/replicatedservice.py
View file @
6ec1c9e3
...
...
@@ -37,20 +37,20 @@ def GenerateConfig(context):
service
=
{
'name'
:
service_name
,
'type'
:
service_type
,
'properties'
:
{
'apiVersion'
:
'v1'
,
'kind'
:
'Service'
,
'namespace'
:
namespace
,
'metadata'
:
{
'name'
:
service_name
,
'labels'
:
GenerateLabels
(
context
,
service_name
),
'name'
:
service_name
,
'namespace'
:
namespace
,
},
'spec'
:
{
'ports'
:
[
GenerateServicePorts
(
context
,
container_name
)],
'selector'
:
GenerateLabels
(
context
,
name
)
}
}
},
'type'
:
service_type
,
}
set_up_external_lb
=
context
.
properties
.
get
(
'external_service'
,
None
)
if
set_up_external_lb
:
...
...
@@ -58,7 +58,6 @@ def GenerateConfig(context):
cluster_ip
=
context
.
properties
.
get
(
'cluster_ip'
,
None
)
if
cluster_ip
:
service
[
'properties'
][
'spec'
][
'clusterIP'
]
=
cluster_ip
config
[
'resources'
]
.
append
(
service
)
rc
=
{
'name'
:
rc_name
,
...
...
@@ -66,10 +65,10 @@ def GenerateConfig(context):
'properties'
:
{
'apiVersion'
:
'v1'
,
'kind'
:
'ReplicationController'
,
'namespace'
:
namespace
,
'metadata'
:
{
'name'
:
rc_name
,
'labels'
:
GenerateLabels
(
context
,
rc_name
),
'name'
:
rc_name
,
'namespace'
:
namespace
,
},
'spec'
:
{
'replicas'
:
context
.
properties
[
'replicas'
],
...
...
@@ -82,8 +81,8 @@ def GenerateConfig(context):
'containers'
:
[
{
'env'
:
GenerateEnv
(
context
),
'name'
:
container_name
,
'image'
:
context
.
properties
[
'image'
],
'name'
:
container_name
,
'ports'
:
[
{
'name'
:
container_name
,
...
...
@@ -121,6 +120,7 @@ def GenerateConfig(context):
}
config
[
'resources'
]
.
append
(
rc
)
config
[
'resources'
]
.
append
(
service
)
return
yaml
.
dump
(
config
)
...
...
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