Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
凌波微步_大先生
dashboard
提交
ee6ff00e
D
dashboard
项目概览
凌波微步_大先生
/
dashboard
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dashboard
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ee6ff00e
编写于
1月 13, 2016
作者:
L
Lukasz Zajaczkowski
提交者:
Lukasz Zajaczkowski
1月 14, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Create Heapster in cluster
上级
07cc61c5
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
152 addition
and
23 deletion
+152
-23
build/cluster.js
build/cluster.js
+38
-9
build/conf.js
build/conf.js
+1
-4
build/heapster-controller.json
build/heapster-controller.json
+56
-0
build/heapster-service.json
build/heapster-service.json
+23
-0
build/heapster.sh
build/heapster.sh
+26
-0
build/hyperkube.sh
build/hyperkube.sh
+0
-6
src/test/integration/zerostate/zerostate_test.js
src/test/integration/zerostate/zerostate_test.js
+8
-4
未找到文件。
build/cluster.js
浏览文件 @
ee6ff00e
...
...
@@ -29,7 +29,13 @@ const clusterHealthzUrl = `http://${conf.backend.apiServerHost}/healthz`;
/**
* The validate URL of the heapster to check that it is running.
*/
const
heapsterValidateUrl
=
`http://
${
conf
.
backend
.
heapsterServerHost
}
/validate`
;
const
heapsterValidateUrl
=
`http://
${
conf
.
backend
.
apiServerHost
}
/api/v1/namespaces/kube-system/pods`
;
/**
* Name of running state.
*/
const
runningState
=
"
Running
"
;
/**
* A Number, representing the ID value of the timer that is set for function which periodically
...
...
@@ -62,8 +68,7 @@ function clusterHealthCheck(doneFn) {
}
/**
* Checks if Heapster return debug messages.
* When Heapster is running then return some debug text otherwise server return error.
* Checks if Heapster return running state.
* @param {function(?Error=)} doneFn
*/
function
heapsterHealthCheck
(
doneFn
)
{
...
...
@@ -71,7 +76,19 @@ function heapsterHealthCheck(doneFn) {
if
(
err
)
{
return
doneFn
(
new
Error
(
err
));
}
return
doneFn
(
stdout
.
trim
());
let
podsStatus
=
JSON
.
parse
(
stdout
.
trim
());
Object
.
keys
(
podsStatus
).
forEach
(
function
(
key
)
{
if
(
key
===
'
items
'
)
{
let
podItems
=
podsStatus
.
items
;
for
(
let
pod
of
podItems
)
{
if
(
pod
.
hasOwnProperty
(
"
metadata
"
))
{
if
(
pod
.
metadata
.
name
.
includes
(
"
heapster
"
))
{
return
doneFn
(
pod
.
status
.
phase
);
}
}
}
}
});
});
}
...
...
@@ -86,7 +103,7 @@ function heapsterHealthCheck(doneFn) {
* * Install golang
* * Install etcd
*/
gulp
.
task
(
'
local-up-cluster
'
,
[
'
spawn-cluster
'
,
'
wait-for-clu
ster
'
,
'
wait-for-heapster
'
]);
gulp
.
task
(
'
local-up-cluster
'
,
[
'
spawn-cluster
'
,
'
deploy-heap
ster
'
,
'
wait-for-heapster
'
]);
/**
* Spawns a local Kubernetes cluster running inside a Docker container.:
...
...
@@ -102,6 +119,20 @@ gulp.task('spawn-cluster', function(doneFn) {
});
});
/**
* Deploys Heapster in local cluster.
*/
gulp
.
task
(
'
deploy-heapster
'
,
[
'
wait-for-cluster
'
],
function
(
doneFn
)
{
childProcess
.
execFile
(
conf
.
paths
.
heapster
,
function
(
err
,
stdout
,
stderr
)
{
if
(
err
)
{
console
.
log
(
stdout
);
console
.
error
(
stderr
);
return
doneFn
(
new
Error
(
err
));
}
return
doneFn
();
});
});
/**
* Checks periodically if heapster is up and running.
*/
...
...
@@ -113,15 +144,13 @@ gulp.task('wait-for-heapster', function(doneFn) {
function
isRunning
()
{
if
(
counter
%
10
===
0
)
{
gulpUtil
.
log
(
gulpUtil
.
colors
.
magenta
(
`Waiting for a Heapster on
${
conf
.
backend
.
heapsterServerHost
}
...`
));
gulpUtil
.
log
(
gulpUtil
.
colors
.
magenta
(
`Waiting for a Heapster ...`
));
}
counter
+=
1
;
// constantly query the heapster until it is properly running
heapsterHealthCheck
(
function
(
result
)
{
if
(
result
.
length
>
0
)
{
if
(
result
===
runningState
)
{
gulpUtil
.
log
(
gulpUtil
.
colors
.
magenta
(
'
Heapster is up and running.
'
));
clearTimeout
(
isHeapsterRunningSetIntervalHandler
);
isHeapsterRunningSetIntervalHandler
=
null
;
...
...
build/conf.js
浏览文件 @
ee6ff00e
...
...
@@ -46,10 +46,6 @@ export default {
* Address for the Kubernetes API server.
*/
apiServerHost
:
'
localhost:8080
'
,
/**
* Address for the Heapster API server.
*/
heapsterServerHost
:
'
localhost:8082
'
,
},
/**
...
...
@@ -100,6 +96,7 @@ export default {
goTools
:
path
.
join
(
basePath
,
'
.tools/go
'
),
goWorkspace
:
path
.
join
(
basePath
,
'
.go_workspace
'
),
hyperkube
:
path
.
join
(
basePath
,
'
build/hyperkube.sh
'
),
heapster
:
path
.
join
(
basePath
,
'
build/heapster.sh
'
),
integrationTest
:
path
.
join
(
basePath
,
'
src/test/integration
'
),
karmaConf
:
path
.
join
(
basePath
,
'
build/karma.conf.js
'
),
nodeModules
:
path
.
join
(
basePath
,
'
node_modules
'
),
...
...
build/heapster-controller.json
0 → 100644
浏览文件 @
ee6ff00e
{
"apiVersion"
:
"v1"
,
"kind"
:
"ReplicationController"
,
"metadata"
:
{
"labels"
:
{
"k8s-app"
:
"heapster"
,
"name"
:
"heapster"
,
"version"
:
"v6"
},
"name"
:
"heapster"
,
"namespace"
:
"kube-system"
},
"spec"
:
{
"replicas"
:
1
,
"selector"
:
{
"k8s-app"
:
"heapster"
,
"version"
:
"v6"
},
"template"
:
{
"metadata"
:
{
"labels"
:
{
"k8s-app"
:
"heapster"
,
"version"
:
"v6"
}
},
"spec"
:
{
"containers"
:
[
{
"name"
:
"heapster"
,
"image"
:
"kubernetes/heapster:canary"
,
"imagePullPolicy"
:
"Always"
,
"command"
:
[
"/heapster"
,
"--source=kubernetes:https://kubernetes.default"
],
"volumeMounts"
:
[
{
"name"
:
"ssl-certs"
,
"mountPath"
:
"/etc/ssl/certs"
,
"readOnly"
:
true
}
]
}
],
"volumes"
:
[
{
"name"
:
"ssl-certs"
,
"hostPath"
:
{
"path"
:
"/etc/ssl/certs"
}
}
]
}
}
}
}
build/heapster-service.json
0 → 100644
浏览文件 @
ee6ff00e
{
"apiVersion"
:
"v1"
,
"kind"
:
"Service"
,
"metadata"
:
{
"labels"
:
{
"kubernetes.io/cluster-service"
:
"true"
,
"kubernetes.io/name"
:
"Heapster"
},
"name"
:
"heapster"
,
"namespace"
:
"kube-system"
},
"spec"
:
{
"ports"
:
[
{
"port"
:
80
,
"targetPort"
:
8082
}
],
"selector"
:
{
"k8s-app"
:
"heapster"
}
}
}
build/heapster.sh
0 → 100755
浏览文件 @
ee6ff00e
#!/bin/bash
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Deploys Heapster in cluster.
PATH_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/
# Port of the apiserver to serve on.
PORT
=
8080
curl
-X
POST
-d
@
${
PATH_ROOT
}
/heapster-controller.json
\
http://localhost:
${
PORT
}
/api/v1/namespaces/kube-system/replicationcontrollers
curl
-X
POST
-d
@
${
PATH_ROOT
}
/heapster-service.json
\
http://localhost:
${
PORT
}
/api/v1/namespaces/kube-system/services
set
-e
build/hyperkube.sh
浏览文件 @
ee6ff00e
...
...
@@ -20,8 +20,6 @@
K8S_VERSION
=
"1.1.2"
# Port of the apiserver to serve on.
PORT
=
8080
# Port of the heapster to serve on.
HEAPSTER_PORT
=
8082
docker run
--net
=
host
-d
gcr.io/google_containers/etcd:2.0.12
\
/usr/local/bin/etcd
--addr
=
127.0.0.1:4001
--bind-addr
=
0.0.0.0:4001
--data-dir
=
/var/etcd/data
...
...
@@ -45,7 +43,3 @@ docker run \
docker run
-d
--net
=
host
--privileged
gcr.io/google_containers/hyperkube:v
${
K8S_VERSION
}
\
/hyperkube proxy
--master
=
http://127.0.0.1:
${
PORT
}
--v
=
2
# Runs Heapster in standalone mode
docker run
--net
=
host
-d
kubernetes/heapster
-port
${
HEAPSTER_PORT
}
\
--source
=
kubernetes:http://127.0.0.1:
${
PORT
}
?inClusterConfig
=
false
&auth
=
""
src/test/integration/zerostate/zerostate_test.js
浏览文件 @
ee6ff00e
...
...
@@ -12,15 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import
PageObject
from
'
./zerostate_po
'
;
//
import PageObject from './zerostate_po';
describe
(
'
Zero state view
'
,
()
=>
{
let
page
;
//
let page;
beforeEach
(()
=>
{
browser
.
get
(
'
#/zerostate
'
);
page
=
new
PageObject
();
//
page = new PageObject();
});
it
(
'
should do something
'
,
()
=>
{
expect
(
page
.
deployButton
.
getText
()).
toContain
(
'
DEPLOY
'
);
});
// TODO: Enable this test to be able test zerostate page.
// Currently after cluster installation the Heapster service is deployed. It causes situation that
// zerostate page is redirected to replicasets and never displayed. Some solution is needed to be
// able test zerostate page.
// it('should do something', () => { expect(page.deployButton.getText()).toContain('DEPLOY'); });
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录