kubernetes-sigs / custom-metrics-apiserver

Framework for implementing custom metrics support for Kubernetes
Apache License 2.0
504 stars 176 forks source link

Bump to Kubernetes 1.14 #50

Closed s-urbaniak closed 5 years ago

s-urbaniak commented 5 years ago

/cc @brancz @sttts

If you don't mind I think i need a little guidance here if the InstrumentRouteFunc declarations are actually correct.

s-urbaniak commented 5 years ago

ok, glog is still a bit in our way in the tests:

/tmp/go-build707190676/b570/installer.test flag redefined: log_dir
panic: /tmp/go-build707190676/b570/installer.test flag redefined: log_dir

I solved this for the main cmd entrypoint, but I'll dig into the tests too.

s-urbaniak commented 5 years ago

just a small data point. I tested this patch successfully, following the readme and POST'ing some test metrics:

$ kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1" | jq .
{
  "kind": "APIResourceList",
  "apiVersion": "v1",
  "groupVersion": "custom.metrics.k8s.io/v1beta1",
  "resources": [
    {
      "name": "services/test-metric",
      "singularName": "",
      "namespaced": true,
      "kind": "MetricValueList",
      "verbs": [
        "get"
      ]
    }
  ]
}

and

$ kubectl get --raw '/apis/custom.metrics.k8s.io/v1beta1/namespaces/default/services/kubernetes/test-metric' | jq .
{
  "kind": "MetricValueList",
  "apiVersion": "custom.metrics.k8s.io/v1beta1",
  "metadata": {
    "selfLink": "/apis/custom.metrics.k8s.io/v1beta1/namespaces/default/services/kubernetes/test-metric"
  },
  "items": [
    {
      "describedObject": {
        "kind": "Service",
        "namespace": "default",
        "name": "kubernetes",
        "apiVersion": "/v1"
      },
      "metricName": "test-metric",
      "timestamp": "2019-04-18T17:20:05Z",
      "value": "300m",
      "selector": null
    }
  ]
}

I also verified that the /metrics endpoint returns proper metrics after factoring the InstrumentRouterFunc, example:

$ kubectl -n custom-metrics port-forward svc/custom-metrics-apiserver 6443:443 &
$ curl -s -k -H "Authorization: Bearer $TOKEN" https://localhost:6443/metrics | grep apiserver_request_duration_seconds_count

apiserver_request_duration_seconds_count{component="custom-metrics",dry_run="",group="custom.metrics.k8s.io",resource="*",scope="resource",subresource="*",verb="LIST",version="v1beta1"} 5
brancz commented 5 years ago

Looks good to me, can you just fix the PR title? Usually I don’t care but this would confuse me if I saw it in the changelog. Feel free to remove the hold once fixed.

/lgtm /hold

s-urbaniak commented 5 years ago

/hold cancel

s-urbaniak commented 5 years ago

/cc @kawych do you mind to have a look? :-)

kawych commented 5 years ago

/lgtm /approve

k8s-ci-robot commented 5 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kawych

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-incubator/custom-metrics-apiserver/blob/master/OWNERS)~~ [kawych] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
s-urbaniak commented 5 years ago

thank you @kawych ! :bowing_man: