Zebradil commented on issue #330:
URL: 
https://github.com/apache/apisix-helm-chart/issues/330#issuecomment-1611410839

   This issue is already a bit old, but sharing additional detail for future 
lurkers might make sense.
   
   This happens because of the following condition in the helm template: 
https://github.com/apache/apisix-helm-chart/blob/b33af1a4719049cb0b353fd9118b9421c521eea4/charts/apisix-ingress-controller/templates/servicemonitor.yaml#L17
   
   As you can see, it is not enough to enable ServiceMonitor via 
`serviceMonitor.enabled = true`. The Kubernetes context must also have the 
`monitoring.coreos.com/v1` API version available. By default, the `helm 
template` command checks API versions available in the compiled client. Any 
custom version won't be available in this case.
   
   The workaround is to use `--api-versions` flag, like in this example:
   
   ```console
   $ helm template \
       --api-versions=monitoring.coreos.com/v1 \
       --release-name apisix-istio \
       -f ./values.yaml apisix/apisix \
       --output-dir ./apisix-deploy
   ```
   
   **In my opinion, this check is redundant and should be removed.** If a 
user's cluster doesn't have the corresponding custom resource definition 
installed, the `serviceMonitor.enabled` must simply be set to `false` (which is 
already 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to