1.kubernets介绍:
Kubernetes(k8s)是Google开源的容器集群管理系统(谷歌内部:Borg),目前已经成为容器编排一个标准。在Docker技术的基础上,为容器化的应用提供部署运行、资源调度、服务发现和动态伸缩、高可用等一系列完整功能,提高了大规模容器集群管理的便捷性。
Kubernetes优势:
提供的功能:
容器编排
轻量级
开源
弹性伸缩
负载均衡
K8s:1.25 版本
0.master,worker1,worker2
1.server api
2. pod
3.service
4.dashborad仪表盘
5.yaml文件
deployment
replica set: 预设副本数
pod
label:env:test--selector
containers: image:
service: 动态伸缩,负载均衡,滚动发布
endpoints: ip:prot,ip:pord
2.发布的yaml
#bluegreen.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: blue
spec:
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
selector:
matchLabels:
app: bluegreen
replicas: 4
template:
metadata:
labels:
app: bluegreen
version: v1.0
spec:
containers:
- name: bluegreen
image: registry.cn-hangzhou.aliyuncs.com/gerry-docker/k8s-deploy-v1:v1
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: bluegreen
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: bluegreen
version: v1.0
type: ClusterIP
3.support:
https://kubernetes.io/zh-cn/