8.2.4. 创建 Service 对象以公开 Quay 指标

  1. 为 Service 对象创建 YAML 文件:

    $ cat quay-service.yaml
    
    apiVersion: v1
    kind: Service
    metadata:
      annotations:
      labels:
        quay-component: monitoring
        quay-operator/quayregistry: example-registry
      name: example-registry-quay-metrics
      namespace: quay-enterprise
    spec:
      ports:
      - name: quay-metrics
        port: 9091
        protocol: TCP
        targetPort: 9091
      selector:
        quay-component: quay-app
        quay-operator/quayregistry: example-registry
      type: ClusterIP

       

  2. 创建 Service 对象:

    $  oc apply -f quay-service.yaml
    
    service/example-registry-quay-metrics created