1.yaml文件如下
spec: clusterIP: 10.233.43.125 ports: - name: http-metrics port: 8080 protocol: TCP targetPort: http-metrics - name: telemetry port: 8081 protocol: TCP targetPort: telemetry selector: k8s-app: kube-state-metrics sessionAffinity: None #type: ClusterIP type: NodePort