Skip to content

Commit

Permalink
fix broken links
Browse files Browse the repository at this point in the history
  • Loading branch information
rootsongjc committed Dec 24, 2021
1 parent d6f0887 commit 78ca17b
Show file tree
Hide file tree
Showing 18 changed files with 373 additions and 422 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Kubernetes 的架构做的足够开放,通过系列的接口,如 CRI(Conta

- 2017 年 6 月 19 日 - 20 日,北京,[L3 大会](https://www.bagevent.com/event/561769)(LinuxCon+ContainerCon+CloudOpen China)。CNCF(Cloud Native Computing Foundation)作为云原生应用的联合推广团体,也是由 Google 一手培植起来的强大 “市场媒体”(Kubernetes 是第一个入选该基金会的项目),第一次进入中国,华为、Google、Rancher、红帽等公司分别做了关于 Kubernetes 及 Cloud Native 的演讲。
- 2017 年 7 月 25 日,北京、上海,[k8smeetup](http://www.k8smeetup.com/),Kubernetes 二周年北京 - 上海 Meetup 双城庆生。
- 2017 年 9 月 12 日,北京,[T11 大会](https://www.talkingdata.com/activity/T11-2017/index.html),前 Pivotal 技术专家,现 CapitalOne 高级专家 Kevin Hoffman 做了 [High Level Cloud Native Concepts](https://jimmysong.io/posts/high-level-cloud-native-from-kevin-hoffman/) 的演讲。
- 2017 年 9 月 12 日,北京,T11 大会,前 Pivotal 技术专家,现 CapitalOne 高级专家 Kevin Hoffman 做了 [High Level Cloud Native Concepts](https://jimmysong.io/posts/high-level-cloud-native-from-kevin-hoffman/) 的演讲。
- 2017 年 10 月 15 日,杭州,[KEUC 2017- Kubernetes 中国用户大会](https://www.bagevent.com/event/827437)。由才云科技(Caicloud)、美国 The Linux Foundation 基金会旗下 Cloud Native Computing Foundation (CNCF)、「K8sMeetup 中国社区」联合主办的聚焦 Kubernetes 中国行业应用与技术落地的盛会。
- 2017 年 12 月 13 日 - 15 日,杭州,[云原生技术大会 ——CNTC](https://www.huodongjia.com/event-5854212.html)。这次会议由谐云科技与网易云共同主办,主要探讨云原生技术与应用,同时还进行了云原生集训。

Expand Down
336 changes: 161 additions & 175 deletions cloud-native/kubernetes-and-cloud-native-app-overview.md

Large diffs are not rendered by default.

45 changes: 22 additions & 23 deletions concepts/custom-metrics-hpa.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
# 自定义指标HPA
# 自定义指标 HPA

Kubernetes中不仅支持CPU、内存为指标的HPA,还支持自定义指标的HPA,例如QPS
Kubernetes 中不仅支持 CPU、内存为指标的 HPA,还支持自定义指标的 HPA,例如 QPS

本文中使用的yaml文件见[manifests/HPA](https://github.com/rootsongjc/kubernetes-handbook/tree/master/manifests/HPA)
本文中使用的 yaml 文件见 [manifests/HPA](https://github.com/rootsongjc/kubernetes-handbook/tree/master/manifests/HPA)

## 设置自定义指标

**kubernetes1.6**

> 在kubernetes1.6集群中配置自定义指标的HPA的说明已废弃
> 在 kubernetes1.6 集群中配置自定义指标的 HPA 的说明已废弃
在设置定义指标HPA之前需要先进行如下配置
在设置定义指标 HPA 之前需要先进行如下配置

- 将heapster的启动参数 `--api-server` 设置为 true
- 将 heapster 的启动参数 `--api-server` 设置为 true


- 启用custom metric API
- 将kube-controller-manager的启动参数中`--horizontal-pod-autoscaler-use-rest-clients`设置为true,并指定`--master`为API server地址,如`--master=http://172.20.0.113:8080`
- 启用 custom metric API
- 将 kube-controller-manager 的启动参数中 `--horizontal-pod-autoscaler-use-rest-clients` 设置为 true,并指定 `--master` 为 API server 地址,如 `--master=http://172.20.0.113:8080`

在kubernetes1.5以前很容易设置,参考[1.6以前版本的kubernetes中开启自定义HPA](https://medium.com/@marko.luksa/kubernetes-autoscaling-based-on-custom-metrics-without-using-a-host-port-b783ed6241ac)而在1.6中因为取消了原来的annotation方式设置custom metric,只能通过API server和kube-aggregator来获取custom metric,因为只有两种方式来设置了,一是直接通过API server获取heapster的metrics,二是部署[kube-aggragator](https://github.com/kubernetes/kube-aggregator)来实现。
在 kubernetes1.5 以前很容易设置,参考 [1.6 以前版本的 kubernetes 中开启自定义 HPA](https://medium.com/@marko.luksa/kubernetes-autoscaling-based-on-custom-metrics-without-using-a-host-port-b783ed6241ac)而在 1.6 中因为取消了原来的 annotation 方式设置 custom metric,只能通过 API server 和 kube-aggregator 来获取 custom metric,因为只有两种方式来设置了,一是直接通过 API server 获取 heapster 的 metrics,二是部署 [kube-aggragator](https://github.com/kubernetes/kube-aggregator) 来实现。

我们将在kubernetes1.8版本的kubernetes中,使用聚合的API server来实现自定义指标的HPA
我们将在 kubernetes1.8 版本的 kubernetes 中,使用聚合的 API server 来实现自定义指标的 HPA

**kuberentes1.7+**

确认您的kubernetes版本在1.7或以上,修改以下配置:
确认您的 kubernetes 版本在 1.7 或以上,修改以下配置:

- 将kube-controller-manager的启动参数中`--horizontal-pod-autoscaler-use-rest-clients`设置为true,并指定`--master`为API server地址,如`--master=http://172.20.0.113:8080`
- 修改kube-apiserver的配置文件apiserver,增加一条配置`--requestheader-client-ca-file=/etc/kubernetes/ssl/ca.pem --requestheader-allowed-names=aggregator --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --proxy-client-cert-file=/etc/kubernetes/ssl/kubernetes.pem --proxy-client-key-file=/etc/kubernetes/ssl/kubernetes-key.pem`用来配置aggregator的CA证书
- 将 kube-controller-manager 的启动参数中 `--horizontal-pod-autoscaler-use-rest-clients` 设置为 true,并指定 `--master` 为 API server 地址,如 `--master=http://172.20.0.113:8080`
- 修改 kube-apiserver 的配置文件 apiserver,增加一条配置 `--requestheader-client-ca-file=/etc/kubernetes/ssl/ca.pem --requestheader-allowed-names=aggregator --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --proxy-client-cert-file=/etc/kubernetes/ssl/kubernetes.pem --proxy-client-key-file=/etc/kubernetes/ssl/kubernetes-key.pem`用来配置 aggregator 的 CA 证书

已经内置了`apiregistration.k8s.io/v1beta1` API,可以直接定义APIService,如:
已经内置了 `apiregistration.k8s.io/v1beta1` API,可以直接定义 APIService,如:

```yaml
apiVersion: apiregistration.k8s.io/v1
Expand All @@ -47,13 +47,13 @@ spec:
version: v1alpha1
```
**部署Prometheus**
**部署 Prometheus**
使用[prometheus-operator.yaml](https://github.com/rootsongjc/kubernetes-handbook/blob/master/manifests/HPA/prometheus-operator.yaml)文件部署Prometheus operator。
使用 [prometheus-operator.yaml](https://github.com/rootsongjc/kubernetes-handbook/blob/master/manifests/HPA/prometheus-operator.yaml) 文件部署 Prometheus operator。
**注意:**将镜像修改为你自己的镜像仓库地址。
**注意:** 将镜像修改为你自己的镜像仓库地址。
这产生一个自定义的API:<http://172.20.0.113:8080/apis/custom-metrics.metrics.k8s.io/v1alpha1>,可以通过浏览器访问,还可以使用下面的命令可以检查该API
这产生一个自定义的 API:<http://172.20.0.113:8080/apis/custom-metrics.metrics.k8s.io/v1alpha1>,可以通过浏览器访问,还可以使用下面的命令可以检查该 API
```bash
$ kubectl get --raw=apis/custom-metrics.metrics.k8s.io/v1alpha1
Expand All @@ -62,8 +62,7 @@ $ kubectl get --raw=apis/custom-metrics.metrics.k8s.io/v1alpha1

## 参考

- [1.6以前版本的kubernetes中开启自定义HPA](https://medium.com/@marko.luksa/kubernetes-autoscaling-based-on-custom-metrics-without-using-a-host-port-b783ed6241ac)
- [1.7版本的kubernetes中启用自定义HPA](https://docs.bitnami.com/kubernetes/how-to/configure-autoscaling-custom-metrics/)
- [Horizontal Pod Autoscaler Walkthrough](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/)
- [Kubernetes 1.8: Now with 100% Daily Value of Custom Metrics](https://blog.openshift.com/kubernetes-1-8-now-custom-metrics/)
- [Arbitrary/Custom Metrics in the Horizontal Pod Autoscaler#117](https://github.com/kubernetes/features/issues/117)
- [1.6 以前版本的 kubernetes 中开启自定义 HPA - medium.com](https://medium.com/@marko.luksa/kubernetes-autoscaling-based-on-custom-metrics-without-using-a-host-port-b783ed6241ac)
- [Horizontal Pod Autoscaler Walkthrough - kubernetes.io](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/)
- [Kubernetes 1.8: Now with 100% Daily Value of Custom Metrics - blog.openshift.com](https://blog.openshift.com/kubernetes-1-8-now-custom-metrics/)
- [Arbitrary/Custom Metrics in the Horizontal Pod Autoscaler#117 - github.com](https://github.com/kubernetes/features/issues/117)
2 changes: 1 addition & 1 deletion concepts/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ $ echo $?

#### Rolling Update Deployment

`.spec.strategy.type==RollingUpdate` 时,Deployment 使用 [rolling update](https://kubernetes.io/docs/tasks/run-application/rolling-update-replication-controller) 的方式更新 Pod 。您可以指定 `maxUnavailable``maxSurge` 来控制 rolling update 进程。
`.spec.strategy.type==RollingUpdate` 时,Deployment 使用 Rolling Update 的方式更新 Pod 。您可以指定 `maxUnavailable``maxSurge` 来控制 rolling update 进程。

##### Max Unavailable

Expand Down
4 changes: 0 additions & 4 deletions concepts/pod-preset.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,3 @@ Kubernetes 提供了一个准入控制器(`PodPreset`),当其启用时,P
1. 您已启用 `settings.k8s.io/v1alpha1/podpreset` API 类型。例如,可以通过在 API server 的 `--runtime-config` 选项中包含 `settings.k8s.io/v1alpha1=true` 来完成此操作。
2. 您已启用 `PodPreset` 准入控制器。 一种方法是将 `PodPreset` 包含在为 API server 指定的 `--admission-control` 选项值中。
3. 您已经在要使用的命名空间中通过创建 `PodPreset` 对象来定义 `PodPreset`

## 更多资料

- [使用 PodPreset 向 Pod 中注入数据](https://kubernetes.io/docs/tasks/inject-data-application/podpreset)
2 changes: 1 addition & 1 deletion develop/advance-developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

- Taint(污点)和 Toleration(容忍):这些为节点“吸引”或“排斥” Pod 提供了一种方法。当需要将应用程序部署到特定硬件(例如用于科学计算的 GPU)时,经常使用它们。[阅读更多](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/)
- **向下 API**:这允许您的容器使用有关自己或集群的信息,而不会过度耦合到 Kubernetes API server。这可以通过[环境变量](https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/) 或者 [DownwardAPIVolumeFiles](https://kubernetes.io/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/)
- **Pod 预设**:通常,要将运行时需求(例如环境变量、ConfigMap 和 Secret)安装到资源中,可以在资源的配置文件中指定它们。PodPresets 允许您在创建资源时动态注入这些需求。例如,这允许团队 A 将任意数量的新Secret 安装到团队 B 和 C 创建的资源中,而不需要 B 和 C 的操作。[请参阅示例](https://kubernetes.io/docs/tasks/inject-data-application/podpreset/)
- **Pod 预设**:通常,要将运行时需求(例如环境变量、ConfigMap 和 Secret)安装到资源中,可以在资源的配置文件中指定它们。PodPresets 允许您在创建资源时动态注入这些需求。例如,这允许团队 A 将任意数量的新Secret 安装到团队 B 和 C 创建的资源中,而不需要 B 和 C 的操作。

#### 其他 API 对象

Expand Down
2 changes: 1 addition & 1 deletion guide/kubernetes-security-best-practice.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

## Kubernetes 加固指南

*Kubernetes Hardening Guidance*[查看英文原版 PDF](https://media.defense.gov/2021/Aug/03/2002820425/-1/-1/1/CTR_KUBERNETES HARDENING GUIDANCE.PDF)) 是由美国国家安全局(NSA)于 2021 年 8 月发布的,详见[出版信息](https://jimmysong.io/kubernetes-hardening-guidance/publication-infomation.md)。其中文版《Kubernetes 加固指南》(或译作《Kubernetes 强化指南》)是由 [Jimmy Song](https://jimmysong.i/) 翻译,[点击在线阅读](https://jimmysong.io/kubernetes-hardening-guidance),如您发现错误,欢迎在 [GitHub](https://github.com/rootsongjc/kubernetes-hardening-guidance) 上提交勘误(已知[勘误](https://jimmysong.io/kubernetes-hardening-guidance/corrigendum.html)
*Kubernetes Hardening Guidance*[查看英文原版 PDF](https://media.defense.gov/2021/Aug/03/2002820425/-1/-1/1/CTR_KUBERNETES HARDENING GUIDANCE.PDF)) 是由美国国家安全局(NSA)于 2021 年 8 月发布的,详见[出版信息](https://jimmysong.io/kubernetes-hardening-guidance/publication-infomation.md)。其中文版《Kubernetes 加固指南》(或译作《Kubernetes 强化指南》),可[在线阅读](https://jimmysong.io/kubernetes-hardening-guidance)

## 参考

Expand Down
2 changes: 1 addition & 1 deletion guide/secret-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ imagePullSecret 的使用在 [镜像文档](https://kubernetes.io/docs/concepts/

#### 自动挂载手动创建的 Secret

手动创建的 secret(例如包含用于访问 github 帐户的令牌)可以根据其服务帐户自动附加到 pod。请参阅 [使用 PodPreset 向 Pod 中注入信息](https://kubernetes.io/docs/tasks/run-application/podpreset) 以获取该进程的详细说明。
手动创建的 secret(例如包含用于访问 github 帐户的令牌)可以根据其服务帐户自动附加到 pod。

## 详细

Expand Down
2 changes: 1 addition & 1 deletion guide/tls-bootstrapping.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## TLS Bootstrap
# TLS Bootstrap

本文档介绍如何为 kubelet 设置 TLS 客户端证书引导(bootstrap)。

Expand Down
Binary file added images/apple-touch-icon-precomposed-152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/container-storage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 78ca17b

Please sign in to comment.