Closed s-urbaniak closed 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.
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
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
/hold cancel
/cc @kawych do you mind to have a look? :-)
/lgtm /approve
[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
thank you @kawych ! :bowing_man:
/cc @brancz @sttts
If you don't mind I think i need a little guidance here if the InstrumentRouteFunc declarations are actually correct.