-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Endpoint metadata #1559
Comments
The idea to mix kubernetes IDs into backend id seem not reasonable to me.
|
Well, routes themselves are a leak from dataclient then :)
Not sure I understand, IP reuse appears to be a very real thing: apiVersion: apps/v1
kind: Deployment
metadata:
name: ip-reuse
spec:
replicas: 0
selector:
matchLabels:
app: busybox
template:
metadata:
labels:
app: busybox
spec:
terminationGracePeriodSeconds: 1
containers:
- name: busybox
image: busybox
command: ["sleep", "3600"]
imagePullPolicy: IfNotPresent
I am not sure I can read it correctly, but what I propose are: |
In Kubernetes endpoint metadata might also include pod name which, if logged along with endpoint IP, would simplify correlation with application and event logs that contain pod name. |
Yes ep addresses has pod names:
|
Adds a special route with a predefined id `kube__metadata` that contains `False` predicate and no filters. The first argument of `False` predicate (which it ignores anyway) contains endpoint metadata encoded as JSON. Example (formatted): ``` kube__metadata: False("{ \"addresses\":[ { \"address\":\"1.2.3.4\", \"zone\":\"zoneA\", \"nodeName\":\"node1\", \"targetRef\":{ \"kind\":\"Pod\", \"name\":\"foo-app\", \"namespace\":\"default\", \"uid\":\"83a6408f-8a5b-405c-93f4-1199f7712956\" } }, ... ]") ``` This route could be used to obtain zone, node and pod names for a given address. E.g. EndpointRegistry postprocessos may check this route and store zone, node and pod name for each endpoint. TODO: - [ ] add flag to enable metadata route - [ ] tests Fixes #1559 Signed-off-by: Alexander Yastrebov <[email protected]>
Adds a special route with a predefined id `kube__metadata` that contains `False` predicate and no filters. The first argument of `False` predicate (which it ignores anyway) contains endpoint metadata encoded as JSON. Example (formatted): ``` kube__metadata: False("{ \"addresses\":[ { \"address\":\"1.2.3.4\", \"zone\":\"zoneA\", \"nodeName\":\"node1\", \"targetRef\":{ \"kind\":\"Pod\", \"name\":\"foo-app\", \"namespace\":\"default\", \"uid\":\"83a6408f-8a5b-405c-93f4-1199f7712956\" } }, ... ]") ``` This route could be used to obtain zone, node and pod names for a given address. E.g. EndpointRegistry postprocessor may check this route and store zone, node and pod name for each endpoint. TODO: - [ ] add flag to enable metadata route - [ ] tests Fixes #1559 Signed-off-by: Alexander Yastrebov <[email protected]>
Adds a special route with a predefined id `kube__metadata` that contains `False` predicate and no filters. The first argument of `False` predicate (which it ignores anyway) contains endpoint metadata encoded as JSON. Example (formatted): ``` kube__metadata: False("{ \"addresses\":[ { \"address\":\"1.2.3.4\", \"zone\":\"zoneA\", \"nodeName\":\"node1\", \"targetRef\":{ \"kind\":\"Pod\", \"name\":\"foo-app\", \"namespace\":\"default\", \"uid\":\"83a6408f-8a5b-405c-93f4-1199f7712956\" } }, ... ]") ``` This route could be used to obtain zone, node and pod names for a given address. E.g. EndpointRegistry postprocessor may check this route and store zone, node and pod name for each endpoint. TODO: - [ ] add flag to enable metadata route - [ ] tests Fixes #1559 Signed-off-by: Alexander Yastrebov <[email protected]>
Adds a special route with a predefined id `kube__metadata` that contains `False` predicate, no filters and endpoints metadata. Endpoints metadata is encoded as JSON via [data URI scheme](https://en.wikipedia.org/wiki/Data_URI_scheme) into the route backend address field. Example eskip: ``` kube__metadata: False() -> "data:application/json;base64,eyJhZGRyZXNzZXMiO..."; ... ``` This route could be used to obtain zone, node and pod names for a given address. A special route pre-processor detects and removes this route, decodes metadata and stores it as EndpointRegistry metrics. TODO: - [ ] add flag to enable metadata route - [ ] tests Fixes #1559 Signed-off-by: Alexander Yastrebov <[email protected]>
Adds a special route with a predefined id `kube__metadata` that contains `False` predicate, no filters and endpoints metadata. Endpoints metadata is encoded as JSON via [data URI scheme](https://en.wikipedia.org/wiki/Data_URI_scheme) into the route backend address field. Example eskip: ``` kube__metadata: False() -> "data:application/json;base64,eyJhZGRyZXNzZXMiO..."; ... ``` A special route pre-processor detects and removes this route, decodes metadata and stores it as EndpointRegistry metrics. The endpoint metrics then used to obtain endpoint zone, node and pod names for tracing and logging. TODO: - [ ] add flag to enable metadata route - [ ] tests Fixes #1559 Signed-off-by: Alexander Yastrebov <[email protected]>
Adds a special route with a predefined id `kube__metadata` that contains `False` predicate, no filters and endpoints metadata. Endpoints metadata is encoded as JSON via [data URI scheme](https://en.wikipedia.org/wiki/Data_URI_scheme) into the route backend address field. Example eskip: ``` kube__metadata: False() -> "data:application/json;base64,eyJhZGRyZXNzZXMiO..."; ... ``` A special route pre-processor detects and removes this route, decodes metadata and stores it as EndpointRegistry metrics. The endpoint metrics then used to obtain endpoint node and pod names for tracing and logging. TODO: - [ ] add flag to enable metadata route - [ ] tests Fixes #1559 Signed-off-by: Alexander Yastrebov <[email protected]>
Adds a special route with a predefined id `kube__metadata` that contains `False` predicate, no filters and endpoints metadata. Endpoints metadata is encoded as JSON via [data URI scheme](https://en.wikipedia.org/wiki/Data_URI_scheme) into the route backend address field. Example eskip: ``` kube__metadata: False() -> "data:application/json;base64,eyJhZGRyZXNzZXMiO..."; ... ``` A special route pre-processor detects and removes this route, decodes metadata and stores it as EndpointRegistry metrics. The endpoint metrics then used to obtain endpoint node and pod names for tracing and logging. TODO: - [ ] add flag to enable metadata route - [ ] tests Fixes #1559 Signed-off-by: Alexander Yastrebov <[email protected]>
Adds a special route with a predefined id `kube__metadata` that contains `False` predicate, no filters and endpoints metadata. Endpoints metadata is encoded as JSON via [data URI scheme](https://en.wikipedia.org/wiki/Data_URI_scheme) into the route backend address field. Example eskip: ``` kube__metadata: False() -> "data:application/json;base64,eyJhZGRyZXNzZXMiO..."; ... ``` A special route pre-processor detects and removes this route, decodes metadata and stores it as EndpointRegistry metrics. The endpoint metrics then used to obtain endpoint node and pod names for tracing and logging. TODO: - [ ] add flag to enable metadata route - [ ] tests Fixes #1559 Signed-off-by: Alexander Yastrebov <[email protected]>
Is your feature request related to a problem? Please describe.
Load balancing algorithms (#557) require or would benefit from additional endpoint information besides currently available
scheme, ip address and port. For example slow start aka fadeIn algorithm (#1207) has to know when endpoint became available to receive traffic. Other algorithms need endpoint metrics and thus endpoint identity is required (ip address is not suitable as identity because it can be reused).
Useful endpoint metadata values are:
targetRef.uid
in k8s)createdAt
oftargetRef
in k8s)name
oftargetRef
in k8s)The mechanism for passing metadata should support possible future metadata extensions.
Describe the solution you would like
Endpoint metadata may be queried by skipper via infrastructure API and/or delivered to skipper proxy/algorithms via route definitions.
Within route definition the following ways are possible to pass endpoint metadata:
Marker filters
Example route:
Eskip backend definition
Example route:
Syntax is subject to be discussed.
Endpoint url parameters
It is possible to use url parameters because only scheme and host of endpoint url are currently used for routing.
Example route:
Would you like to work on it?
I would like to validate, discuss and possibly extend the ideas first.
The text was updated successfully, but these errors were encountered: