Please enable Javascript to view the contents

Kubernetes 基础环境要求

 ·  ☕ 2 分钟

1. 基础包

Kubernetes 版本 ≥ 1.18
socat必须安装
conntrack必须安装
ebtables可选,但推荐安装
ipset可选,但推荐安装
ipvsadm可选,但推荐安装
1
apt-get -y install socat conntrack ebtables ipset ipvsadm

2. 端口要求

2.1 基础节点服务

ServiceProtocolActionStart PortEnd PortComment
sshTCPallow2222节点远程管理
dockerTCPallow23752376Docker 远程通信
etcdTCPallow23792380etcd 集群通信

2.2 Master/Control Plane 组件

ServiceProtocolActionStart PortEnd PortComment
apiserverTCPallow64436443K8s API Server (HTTPS)
apiserver-insecureTCPallow80808080K8s API Server (HTTP, 已废弃)
etcd-clientTCPallow23792379etcd 客户端通信
etcd-peerTCPallow23802380etcd 节点间通信
schedulerTCPallow1025910259kube-scheduler
controller-managerTCPallow1025710257kube-controller-manager
kubeletTCPallow1025010250kubelet API
kubelet-readonlyTCPallow1025510255kubelet 只读端口 (已废弃)
kube-proxy-metricsTCPallow1024910249kube-proxy 指标

2.3 Worker Node 组件

ServiceProtocolActionStart PortEnd PortComment
kubeletTCPallow1025010250kubelet API
kubelet-readonlyTCPallow1025510255kubelet 只读端口 (已废弃)
kube-proxyTCPallow1025610256kube-proxy 健康检查
nodeportTCPallow3000032767NodePort 服务范围

2.4 网络组件 (CNI)

  • Calico
ServiceProtocolActionStart PortEnd PortComment
calico-typhaTCPallow54735473Calico Typha
calico-nodeTCPallow90999100Calico 监控端口
bgpTCPallow179179Calico BGP
ipipIPENCAP/IPIPallowCalico IP-in-IP 封装模式
wireguardUDPallow5182051821Calico WireGuard (可选)
  • Flannel
ServiceProtocolActionStart PortEnd PortComment
flannel-vxlanUDPallow84728472Flannel VXLAN 模式
flannel-host-gwTCPallow82858285Flannel host-gw 模式
  • Cilium
ServiceProtocolActionStart PortEnd PortComment
cilium-agentTCPallow98769876Cilium Agent
cilium-operatorTCPallow92349234Cilium Operator
cilium-hubbleTCPallow42444244Hubble gRPC
  • Weave Net
ServiceProtocolActionStart PortEnd PortComment
weaveTCPallow67836783Weave 网络通信
weaveUDPallow67836784Weave 网络通信

2.5 存储相关

  • NFS
ServiceProtocolActionStart PortEnd PortComment
rpcbindTCPallow111111NFS RPC 绑定
rpcbindUDPallow111111NFS RPC 绑定
nfsTCPallow20492049NFS 服务
nfsUDPallow20492049NFS 服务
  • iSCSI
ServiceProtocolActionStart PortEnd PortComment
iscsiTCPallow32603260iSCSI 目标端口

2.6 服务发现和 DNS

ServiceProtocolActionStart PortEnd PortComment
corednsTCPallow5353CoreDNS 解析
corednsUDPallow5353CoreDNS 解析
coredns-metricsTCPallow91539153CoreDNS 指标

2.7 监控和日志

  • Prometheus
ServiceProtocolActionStart PortEnd PortComment
prometheusTCPallow90909090Prometheus 服务器
node-exporterTCPallow91009100Node Exporter
kube-state-metricsTCPallow80808081kube-state-metrics
  • Grafana
ServiceProtocolActionStart PortEnd PortComment
grafanaTCPallow30003000Grafana Web UI
  • ELK Stack
ServiceProtocolActionStart PortEnd PortComment
elasticsearchTCPallow92009300Elasticsearch
kibanaTCPallow56015601Kibana Web UI
logstashTCPallow50445044Logstash Beats
  • Jaeger
ServiceProtocolActionStart PortEnd PortComment
jaeger-queryTCPallow1668616686Jaeger UI
jaeger-collectorTCPallow1426814268Jaeger HTTP
jaeger-agentUDPallow68316832Jaeger UDP

2.8 Ingress

  • NGINX Ingress
ServiceProtocolActionStart PortEnd PortComment
nginx-httpTCPallow8080HTTP 流量
nginx-httpsTCPallow443443HTTPS 流量
nginx-metricsTCPallow1025410254NGINX 指标
  • Traefik
ServiceProtocolActionStart PortEnd PortComment
traefik-webTCPallow80808080Traefik Dashboard
traefik-httpTCPallow8080HTTP 流量
traefik-httpsTCPallow443443HTTPS 流量

2.9 Service Mesh

  • Istio
ServiceProtocolActionStart PortEnd PortComment
istiodTCPallow1501015017Istiod 控制平面
envoy-adminTCPallow1500015000Envoy 管理端口
envoy-outboundTCPallow1500115001Envoy 出站流量
envoy-inboundTCPallow1500615006Envoy 入站流量
istio-proxyTCPallow1502015020Istio Proxy 状态

2.10 负载均衡器

  • MetalLB
ServiceProtocolActionStart PortEnd PortComment
metallb-speakerTCPallow74727472MetalLB Speaker
metallb-webhookTCPallow94439443MetalLB Webhook

微信公众号
作者
微信公众号