Service
测试 Service
apiVersion: v1
kind: Service
metadata:
name: nginx
labels:
app: nginx
spec:
type: ClusterIP
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: nginx
CLB 直连 Pod
apiVersion: v1
kind: Service
metadata:
name: nginx
labels:
app: nginx
annotations:
# 显式声明使用直连
service.cloud.tencent.com/direct-access: "true"
spec:
type: LoadBalancer
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: nginx