常见资源类型

image.png
控制器继承关系

image.png
核心组建交互流程

image.png

image.png
如何使用外部服务
使用无头服务+endpoints
apiVersion: v1
kind: Service
metadata:
name: mysql
namespace: default
spec:
clusterIP: None # 无头service
ports:
- name: mysql
port: 3306
protocol: TCP
targetPort: 3306
type: ClusterIP
---
apiVersion: v1
kind: Endpoints
metadata:
name: mysql
namespace: default
subsets:
- addresses:
- ip: 192.168.20.2
ports:
- name: mysql
port: 3306
protocol: TCP
使用service的ExternalName
apiVersion: v1
kind: Service
metadata:
name: service-externalname
namespace: dev
spec:
type: ExternalName # service类型
externalName: www.baidu.com #改成ip地址也可以