Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
kubernetes-learning
提交
2c7624e6
K
kubernetes-learning
项目概览
OpenDocCN
/
kubernetes-learning
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kubernetes-learning
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2c7624e6
编写于
5月 21, 2019
作者:
阳明的博客
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of github.com:cnych/kubernetes-learning
上级
e2acc03c
6d3988cf
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
47 addition
and
47 deletion
+47
-47
docs/18.YAML 文件.md
docs/18.YAML 文件.md
+31
-31
docs/50.Kubernetes调度策略.md
docs/50.Kubernetes调度策略.md
+16
-16
未找到文件。
docs/18.YAML 文件.md
浏览文件 @
2c7624e6
...
...
@@ -55,14 +55,14 @@ metadata:
同
样的,我们可以将上面的 YAML 文件转换成 JSON 文件:
`
``json
{
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"name": "kube100-site",
"labels": {
"app": "web"
}
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"name": "kube100-site",
"labels": {
"app": "web"
}
}
}
`
``
...
...
@@ -80,7 +80,7 @@ args
你
可以有任何数量的项在列表中,每个项的定义以破折号(-)开头的,与父元素直接可以缩进一个空格。对应的 JSON 格式如下:
`
``json
{
"args": [ 'Cat', 'Dog', 'Fish'
]
"args": ["Cat", "Dog", "Fish"
]
}
`
``
...
...
@@ -108,29 +108,29 @@ spec:
比如这个 YAML 文件,我们定义了一个叫 containers 的 List 对象,每个子项都由 name、image、ports 组成,每个 ports 都有一个 key 为 containerPort 的 Map 组成,同样的,我们可以转成如下 JSON 格式文件:
```
json
{
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"name": "kube100-site",
"labels": {
"app":
web"
}
},
"spec": {
"containers": [{
"name": "front-end",
"image": "nginx",
"ports": [{
"containerPort": "80"
}]
}, {
"name": "flaskapp-demo",
"image": "jcdemo/flaskapp",
"ports": [{
"containerPort": "5000"
}]
}]
}
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"name": "kube100-site",
"labels": {
"app": "
web"
}
},
"spec": {
"containers": [{
"name": "front-end",
"image": "nginx",
"ports": [{
"containerPort": 80
}]
}, {
"name": "flaskapp-demo",
"image": "jcdemo/flaskapp",
"ports": [{
"containerPort": 5000
}]
}]
}
}
```
...
...
docs/50.Kubernetes调度策略.md
浏览文件 @
2c7624e6
...
...
@@ -93,22 +93,22 @@ finalScoreNode = (weight1 * priorityFunc1) + (weight2 * priorityFunc2) + … + (
下面是官方的 Policy 文件示例:
```
json
{
"kind"
:
"Policy"
,
"apiVersion"
:
"v1"
,
"predicates"
:
[
{
"name"
:
"PodFitsHostPorts"
},
{
"name"
:
"PodFitsResources"
},
{
"name"
:
"NoDiskConflict"
},
{
"name"
:
"NoVolumeZoneConflict"
},
{
"name"
:
"MatchNodeSelector"
},
{
"name"
:
"HostName"
}
],
"priorities"
:
[
{
"name"
:
"LeastRequestedPriority"
,
"weight"
:
1
},
{
"name"
:
"BalancedResourceAllocation"
,
"weight"
:
1
},
{
"name"
:
"ServiceSpreadingPriority"
,
"weight"
:
1
},
{
"name"
:
"EqualPriority"
,
"weight"
:
1
}
]
"kind"
:
"Policy"
,
"apiVersion"
:
"v1"
,
"predicates"
:
[
{
"name"
:
"PodFitsHostPorts"
},
{
"name"
:
"PodFitsResources"
},
{
"name"
:
"NoDiskConflict"
},
{
"name"
:
"NoVolumeZoneConflict"
},
{
"name"
:
"MatchNodeSelector"
},
{
"name"
:
"HostName"
}
],
"priorities"
:
[
{
"name"
:
"LeastRequestedPriority"
,
"weight"
:
1
},
{
"name"
:
"BalancedResourceAllocation"
,
"weight"
:
1
},
{
"name"
:
"ServiceSpreadingPriority"
,
"weight"
:
1
},
{
"name"
:
"EqualPriority"
,
"weight"
:
1
}
]
}
```
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录