grafana / grafana-operator

An operator for Grafana that installs and manages Grafana instances, Dashboards and Datasources through Kubernetes/OpenShift CRs
https://grafana.github.io/grafana-operator/
Apache License 2.0
863 stars 384 forks source link

[question] noProxy setting in spec.deployment.httpProxy of Grafana resource fails to take effect #1580

Closed wwillfred closed 2 months ago

wwillfred commented 2 months ago

Following the noProxy configuration example in #778 , if you add the spec.deployment.httpProxy entry to the YAML config of the Custom Resource grafana-a:

apiVersion: grafana.integreatly.org/v1beta1
kind: Grafana
...
spec:
...
  deployment:
    httpProxy:
        enabled: true
        url: http://192.168.1.10:8080
        secureUrl: http://192.168.1.10:8080
        noProxy: ".cluster.local,.svc,.example.com,localhost"

and then click "Save", the httpProxy entry immediately gets deleted and is replaced with curly braces:

spec:
  deployment: {}

From this comment in #778 it seems that there are others for whom this solution does not work.

In our environment we need to be able to specify an HTTPS proxy and a No Proxy in order for grafana-a-deployment to work, but if we set the environment variables https_proxy and no_proxy manually in the Deployment manifest, they will just get overwritten by the grafana-a Custom Resource within a day or so, and the Grafana application becomes broken again.

Grafana Operator v5.9.2 running in OpenShift 4.12.45

NissesSenap commented 2 months ago

@wwillfred the PR you are point to are for version 4 of the operator, you will notice it says alpha in the files changed in the PR. If you want to set an environment variable like http_proxy, you can for example follow the docs .