hanahmily opened a new issue #6606:
URL: https://github.com/apache/skywalking/issues/6606
Please answer these questions before submitting your issue.
- Why do you submit this issue?
- [ ] Question or discussion
- [ ] Bug
- [x] Requirement
- [ ] Feature or performance improvement
### Requirement or improvement
If the following piece is appended to HPA metrics:
```yaml
- type: External
external:
metric:
name: service_cpm
selector:
matchLabels:
service: "v1|productpage|bookinfo|demo|-"
target:
type: Value
value: 80
```
An error will be thrown:
```
HPA was unable to compute the replica count: invalid label value:
\"v1|productpage|bookinfo|demo\":
a valid label must be an empty string or consist of alphanumeric
characters,
''-'', ''_'' or ''.'', and must start and end with an alphanumeric
character
(e.g. ''MyValue'', or ''my_value'', or ''12345'', regex used for
validation
is ''(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?'')"}]'
```
The reason as above error messages indicated is that k8s label key and value
doesn't contain special characters except for ".", "-" and "_", and those
valid special characters must NOT be at head and tail position.
A possible solution is to leverage a composited `name` field
*metric_namespace*|*metric_name*|*entity_name*
>metric_namespace could be the domain name of skywalking, for example,
skywalking.apache.org, which could help distinguish two same metrics from
different metric servers.
Based on this new rule, the above HPA piece could be rewritten to
```yaml
- type: External
external:
metric:
name:
skywalking.apache.org|service_cpm|v1|productpage|bookinfo|demo|-
target:
type: Value
value: 80
```
@wu-sheng @kezhenxu94 @arugal any thoughts?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]