Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
凌波微步_大先生
dashboard
提交
b2652f8f
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,发现更多精彩内容 >>
提交
b2652f8f
编写于
1月 20, 2016
作者:
L
Lukasz Zajaczkowski
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert changes for Heapster to deploy it in Docker conatiner
上级
c44179ff
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
25 addition
and
149 deletion
+25
-149
build/cluster.js
build/cluster.js
+13
-43
build/conf.js
build/conf.js
+4
-1
build/heapster-controller.json
build/heapster-controller.json
+0
-56
build/heapster-service.json
build/heapster-service.json
+0
-23
build/heapster.sh
build/heapster.sh
+0
-26
build/hyperkube.sh
build/hyperkube.sh
+8
-0
未找到文件。
build/cluster.js
浏览文件 @
b2652f8f
...
...
@@ -29,13 +29,7 @@ const clusterHealthzUrl = `http://${conf.backend.apiServerHost}/healthz`;
/**
* The validate URL of the heapster to check that it is running.
*/
const
heapsterValidateUrl
=
`http://
${
conf
.
backend
.
apiServerHost
}
/api/v1/namespaces/kube-system/pods`
;
/**
* Name of running state.
*/
const
runningState
=
"
Running
"
;
const
heapsterValidateUrl
=
`http://
${
conf
.
backend
.
heapsterServerHost
}
/api/v1/model/stats/`
;
/**
* A Number, representing the ID value of the timer that is set for function which periodically
...
...
@@ -72,23 +66,15 @@ function clusterHealthCheck(doneFn) {
* @param {function(?Error=)} doneFn
*/
function
heapsterHealthCheck
(
doneFn
)
{
childProcess
.
exec
(
`curl
${
heapsterValidateUrl
}
`
,
function
(
err
,
stdout
)
{
childProcess
.
exec
(
`curl
--compressed
${
heapsterValidateUrl
}
`
,
function
(
err
,
stdout
)
{
if
(
err
)
{
return
doneFn
(
new
Error
(
err
));
}
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
);
}
}
}
}
});
let
statistics
=
JSON
.
parse
(
stdout
.
trim
());
let
uptime
=
statistics
.
uptime
;
if
(
!
isNaN
(
uptime
))
{
return
doneFn
();
}
});
}
...
...
@@ -103,7 +89,7 @@ function heapsterHealthCheck(doneFn) {
* * Install golang
* * Install etcd
*/
gulp
.
task
(
'
local-up-cluster
'
,
[
'
spawn-cluster
'
,
'
deploy-heap
ster
'
,
'
wait-for-heapster
'
]);
gulp
.
task
(
'
local-up-cluster
'
,
[
'
spawn-cluster
'
,
'
wait-for-clu
ster
'
,
'
wait-for-heapster
'
]);
/**
* Spawns a local Kubernetes cluster running inside a Docker container.:
...
...
@@ -119,20 +105,6 @@ 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.
*/
...
...
@@ -149,13 +121,11 @@ gulp.task('wait-for-heapster', function(doneFn) {
counter
+=
1
;
// constantly query the heapster until it is properly running
heapsterHealthCheck
(
function
(
result
)
{
if
(
result
===
runningState
)
{
gulpUtil
.
log
(
gulpUtil
.
colors
.
magenta
(
'
Heapster is up and running.
'
));
clearTimeout
(
isHeapsterRunningSetIntervalHandler
);
isHeapsterRunningSetIntervalHandler
=
null
;
doneFn
();
}
heapsterHealthCheck
(
function
()
{
gulpUtil
.
log
(
gulpUtil
.
colors
.
magenta
(
'
Heapster is up and running.
'
));
clearTimeout
(
isHeapsterRunningSetIntervalHandler
);
isHeapsterRunningSetIntervalHandler
=
null
;
doneFn
();
});
}
});
...
...
build/conf.js
浏览文件 @
b2652f8f
...
...
@@ -46,6 +46,10 @@ export default {
* Address for the Kubernetes API server.
*/
apiServerHost
:
'
localhost:8080
'
,
/**
* Address for the Heapster API server.
*/
heapsterServerHost
:
'
localhost:8082
'
,
},
/**
...
...
@@ -96,7 +100,6 @@ 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
已删除
100644 → 0
浏览文件 @
c44179ff
{
"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
已删除
100644 → 0
浏览文件 @
c44179ff
{
"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
已删除
100755 → 0
浏览文件 @
c44179ff
#!/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
浏览文件 @
b2652f8f
...
...
@@ -18,8 +18,12 @@
# Version of kubernetes to use.
K8S_VERSION
=
"1.1.2"
# Version heapster to use.
HEAPSTER_VERSION
=
"0.18.3"
# 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
...
...
@@ -43,3 +47,7 @@ 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:v
${
HEAPSTER_VERSION
}
-port
${
HEAPSTER_PORT
}
\
--source
=
kubernetes:http://127.0.0.1:
${
PORT
}
?inClusterConfig
=
false
&auth
=
""
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录