You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "RichardSufliarsky (via GitHub)" <gi...@apache.org> on 2023/03/08 10:41:54 UTC
[GitHub] [apisix-helm-chart] RichardSufliarsky opened a new issue, #502: ServiceMonitor not working if put into different namespace
RichardSufliarsky opened a new issue, #502:
URL: https://github.com/apache/apisix-helm-chart/issues/502
If you change the namespace to which ServiceMonitor is deployed (e.g. monitoring), then it will not work as it also uses same namespace for metrics collection:
https://github.com/apache/apisix-helm-chart/blob/e75ea7b656d9fc5632d40db0345cb4c16f5cb7c3/charts/apisix/templates/service-monitor.yaml#L34
To fix this, the line should be:
`- {{ .Release.Namespace }}`
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-helm-chart] RichardSufliarsky closed issue #502: ServiceMonitor not working if put into different namespace
Posted by "RichardSufliarsky (via GitHub)" <gi...@apache.org>.
RichardSufliarsky closed issue #502: ServiceMonitor not working if put into different namespace
URL: https://github.com/apache/apisix-helm-chart/issues/502
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-helm-chart] tao12345666333 commented on issue #502: ServiceMonitor not working if put into different namespace
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #502:
URL: https://github.com/apache/apisix-helm-chart/issues/502#issuecomment-1666502544
1. As I have said many times, this allows users to control themselves 2. In fact apisix-ingress-controller was never designed to be used independently, it should be a sub-chart of apisix, so it has many configurations that should follow apisix. Also, if you need them to be consistent, please provide your actual use case, and submit a PR
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-helm-chart] tao12345666333 commented on issue #502: ServiceMonitor not working if put into different namespace
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #502:
URL: https://github.com/apache/apisix-helm-chart/issues/502#issuecomment-1460016034
It's the default value
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-helm-chart] tulequ commented on issue #502: ServiceMonitor not working if put into different namespace
Posted by "tulequ (via GitHub)" <gi...@apache.org>.
tulequ commented on issue #502:
URL: https://github.com/apache/apisix-helm-chart/issues/502#issuecomment-1666410476
@tao12345666333 please reopen this issue
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-helm-chart] tao12345666333 commented on issue #502: ServiceMonitor not working if put into different namespace
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #502:
URL: https://github.com/apache/apisix-helm-chart/issues/502#issuecomment-1612312571
If the user specifically specified that namespace, I think there may be some other reasons.
However, if the user does not specifically specify it, it can still work well.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-helm-chart] tulequ commented on issue #502: ServiceMonitor not working if put into different namespace
Posted by "tulequ (via GitHub)" <gi...@apache.org>.
tulequ commented on issue #502:
URL: https://github.com/apache/apisix-helm-chart/issues/502#issuecomment-1666452805
So can you explain 2 things:
- What is the purpose of `.Values.serviceMonitor.namespace`?
- Why that value in `apisix-ingress-controller/templates/servicemonitor.yaml` has different meaning?
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-helm-chart] tulequ commented on issue #502: ServiceMonitor not working if put into different namespace
Posted by "tulequ (via GitHub)" <gi...@apache.org>.
tulequ commented on issue #502:
URL: https://github.com/apache/apisix-helm-chart/issues/502#issuecomment-1666554200
I really don't have any patience more. I will create the ServiceMonitor myself!
As my test below, the ` serviceMonitor.namespace=monitoring` is garbage
`ingress-controller.serviceMonitor.namespace=monitoring` is perfect
### Test 1
```bash
helm template -n ingress-apisix mytest apisix/apisix --version 1.5.1 \
--set serviceMonitor.enabled=true
```
Result
```yaml
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: mytest-apisix
namespace: ingress-apisix
spec:
namespaceSelector:
matchNames:
- ingress-apisix
...
```
### Test 2
```bash
helm template -n ingress-apisix mytest apisix/apisix --version 1.5.1 \
--set serviceMonitor.enabled=true \
--set serviceMonitor.namespace=monitoring
```
Result:
```yaml
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: mytest-apisix
namespace: monitoring
spec:
namespaceSelector:
matchNames:
- monitoring
...
```
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-helm-chart] tao12345666333 commented on issue #502: ServiceMonitor not working if put into different namespace
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #502:
URL: https://github.com/apache/apisix-helm-chart/issues/502#issuecomment-1666421648
https://github.com/apache/apisix-helm-chart/pull/572#issuecomment-1620937323
As discussed earlier, I haven't changed my mind. The choice should be left to the users instead of imposing restrictions. Moreover, these "features" are not something that A must have just because B has them; I don't see their value.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-helm-chart] tulequ commented on issue #502: ServiceMonitor not working if put into different namespace
Posted by "tulequ (via GitHub)" <gi...@apache.org>.
tulequ commented on issue #502:
URL: https://github.com/apache/apisix-helm-chart/issues/502#issuecomment-1621134703
I think you are missing something
Most of chart support this type of config
**.Values.serviceMonitor.namespace**: where to put servicemonitor
**namespaceSelector.matchNames**: where to select service (it should always be namespace of the service)
apisix-ingress-controller chart is use like above, but apisix chart is not
Some examples:
https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix-ingress-controller/templates/servicemonitor.yaml
https://github.com/bitnami/charts/blob/main/bitnami/redis/templates/servicemonitor.yaml
https://github.com/bitnami/charts/blob/main/bitnami/rabbitmq/templates/servicemonitor.yaml
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-helm-chart] RichardSufliarsky commented on issue #502: ServiceMonitor not working if put into different namespace
Posted by "RichardSufliarsky (via GitHub)" <gi...@apache.org>.
RichardSufliarsky commented on issue #502:
URL: https://github.com/apache/apisix-helm-chart/issues/502#issuecomment-1460459031
@tao12345666333 if you deploy to _dev-apisix_ namespace and just enable serviceMonitor, it will create it in _dev-apisix_ namespace with spec like this:
```spec:
endpoints:
- interval: 15s
path: /apisix/prometheus/metrics
scheme: http
targetPort: prometheus
namespaceSelector:
matchNames:
- dev-apisix
```
But if you deploy to _dev-apisix_ namespace and enable serviceMonitor with namespace specified (e. g. _monitoring_), then it will create it in namespace _monitoring_ (which is correct) but will also specify namespace _monitoring_ in the _namespaceSelector_, but this is wrong as it needs to be _dev-apisix_ as gateway is running in that namespace:
```spec:
endpoints:
- interval: 15s
path: /apisix/prometheus/metrics
scheme: http
targetPort: prometheus
namespaceSelector:
matchNames:
- monitoring ### ERROR - should be dev-apisix
```
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org