-
序言
-
云原生(Cloud Native)的定义
-
云原生的设计哲学
-
Play with Kubernetes
-
快速部署一个云原生本地实验环境
-
使用Rancher在阿里云上部署Kubenretes集群
-
Kubernetes与云原生应用概览
-
云原生应用之路——从Kubernetes到Cloud Native
- 云原生编程语言
-
云原生的未来
- Kubernetes架构
- Kubernetes中的网络
-
资源对象与基本概念解析
- Pod状态与生命周期管理
- 集群资源管理
- 控制器
- 服务发现
- 身份与权限控制
- 存储
- 集群扩展
- 资源调度
-
用户指南
- 资源对象配置
- 命令使用
- 集群安全性管理
- 访问Kubernetes集群
- 在Kubernetes中开发部署应用
-
最佳实践概览
- 在CentOS上部署Kubernetes集群
- 生产级的Kubernetes简化管理工具kubeadm
- 服务发现与负载均衡
- 运维管理
- 存储管理
- 集群与应用监控
- 分布式跟踪
- 服务编排管理
- 持续集成与发布
- 更新与升级
-
领域应用概览
- 微服务架构
- Service Mesh 服务网格
- 大数据
- Serverless架构
-
边缘计算
-
人工智能
-
开发指南概览
-
SIG和工作组
- 开发环境搭建
-
单元测试和集成测试
-
client-go示例
- Operator
-
kubebuilder
-
高级开发指南
-
社区贡献
-
Minikube
-
CNCF - 云原生计算基金会简介
-
CNCF章程
-
CNCF特别兴趣小组(SIG)说明
-
开源项目加入CNCF Sandbox的要求
-
CNCF中的项目治理
-
CNCF Ambassador
-
附录说明
-
Kubernetes中的应用故障排查
-
Kubernetes相关资讯和情报链接
-
Docker最佳实践
-
使用技巧
-
问题记录
- Kubernetes版本更新日志
- Kubernetes及云原生年度总结及展望
- CNCF年度报告解读
-
Kubernetes认证服务提供商(KCSP)说明
-
认证Kubernetes管理员(CKA)说明
ReplicationController和ReplicaSet
ReplicationController用来确保容器应用的副本数始终保持在用户定义的副本数,即如果有容器异常退出,会自动创建新的Pod来替代;而如果异常多出来的容器也会自动回收。
在新版本的Kubernetes中建议使用ReplicaSet来取代ReplicationController。ReplicaSet跟ReplicationController没有本质的不同,只是名字不一样,并且ReplicaSet支持集合式的selector。
虽然ReplicaSet可以独立使用,但一般还是建议使用 Deployment 来自动管理ReplicaSet,这样就无需担心跟其他机制的不兼容问题(比如ReplicaSet不支持rolling-update但Deployment支持)。
ReplicaSet示例:
apiVersion: extensions/v1beta1
kind: ReplicaSet
metadata:
name: frontend
# these labels can be applied automatically
# from the labels in the pod template if not set
# labels:
# app: guestbook
# tier: frontend
spec:
# this replicas value is default
# modify it according to your case
replicas: 3
# selector can be applied automatically
# from the labels in the pod template if not set,
# but we are specifying the selector here to
# demonstrate its usage.
selector:
matchLabels:
tier: frontend
matchExpressions:
- {key: tier, operator: In, values: [frontend]}
template:
metadata:
labels:
app: guestbook
tier: frontend
spec:
containers:
- name: php-redis
image: gcr.io/google_samples/gb-frontend:v3
resources:
requests:
cpu: 100m
memory: 100Mi
env:
- name: GET_HOSTS_FROM
value: dns
# If your cluster config does not include a dns service, then to
# instead access environment variables to find service host
# info, comment out the 'value: dns' line above, and uncomment the
# line below.
# value: env
ports:
- containerPort: 80
copy