From c00346d5d506443093f33702ac8e31547d68f5cc Mon Sep 17 00:00:00 2001 From: Igor Beliakov Date: Mon, 23 Oct 2023 10:26:02 +0200 Subject: [PATCH 1/4] fix: reintroduce-support-for-proxy --- controllers/client/round_tripper.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/controllers/client/round_tripper.go b/controllers/client/round_tripper.go index 56f7fadce..108060b67 100644 --- a/controllers/client/round_tripper.go +++ b/controllers/client/round_tripper.go @@ -1,7 +1,6 @@ package client import ( - "crypto/tls" "net/http" "strconv" @@ -15,13 +14,10 @@ type instrumentedRoundTripper struct { } func NewInstrumentedRoundTripper(relatedResource string, metric *prometheus.CounterVec) http.RoundTripper { - transport := &http.Transport{ - DisableKeepAlives: true, - MaxIdleConnsPerHost: -1, - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, //nolint - }, - } + transport := http.DefaultTransport.(*http.Transport).Clone() + transport.DisableKeepAlives = true + transport.MaxIdleConnsPerHost = -1 + transport.TLSClientConfig.InsecureSkipVerify = true //nolint return &instrumentedRoundTripper{ relatedResource: relatedResource, From f084038303f2585b7c0414d2c800a13d8a923962 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 10:21:37 +0200 Subject: [PATCH 2/4] chore(deps): bump tj-actions/changed-files from 39.2.2 to 39.2.3 (#1285) Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 39.2.2 to 39.2.3. - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/408093d9ff9c134c33b974e0722ce06b9d6e8263...95690f9ece77c1740f4a55b7f1de9023ed6b1f87) --- updated-dependencies: - dependency-name: tj-actions/changed-files dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/e2e.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 65830e50e..1bd8a2775 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -23,7 +23,7 @@ jobs: fetch-depth: 0 - id: changed-files name: Get changed files - uses: tj-actions/changed-files@408093d9ff9c134c33b974e0722ce06b9d6e8263 #v39.2.2 + uses: tj-actions/changed-files@95690f9ece77c1740f4a55b7f1de9023ed6b1f87 #v39.2.3 with: files_ignore: | **/*.md From d8ad7fa144be4e10a75e9ab0eaa6437309a20497 Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Tue, 31 Oct 2023 10:45:18 +0100 Subject: [PATCH 3/4] update documentation to include proxy settings --- docs/docs/_index.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/docs/_index.md b/docs/docs/_index.md index 7a7c41292..88b7e0025 100644 --- a/docs/docs/_index.md +++ b/docs/docs/_index.md @@ -84,3 +84,8 @@ To solve this we introduced `spec.allowCrossNamespaceImport` option to, dashboar This setting makes it so a grafana instance in another namespace don't get the grafana resources applied to it even if the label matches. This is because especially the data sources contain secret information and we don't want another team to be able to use your datasource unless defined to do so in both CR:s. + +## Using a proxy server + +The Operator can use a proxy server when making requests to Grafana. +The proxy settings can be controlled through environment variables as documented [here](https://pkg.go.dev/golang.org/x/net/http/httpproxy#FromEnvironment). From b433757073f4d8918fa6caaffd3de6594f2ba7ed Mon Sep 17 00:00:00 2001 From: Igor Beliakov Date: Tue, 31 Oct 2023 12:06:21 +0100 Subject: [PATCH 4/4] feat(chart): env --- deploy/helm/grafana-operator/README.md | 1 + deploy/helm/grafana-operator/templates/deployment.yaml | 3 +++ deploy/helm/grafana-operator/values.yaml | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/deploy/helm/grafana-operator/README.md b/deploy/helm/grafana-operator/README.md index e4f062703..514704616 100644 --- a/deploy/helm/grafana-operator/README.md +++ b/deploy/helm/grafana-operator/README.md @@ -37,6 +37,7 @@ It's easier to just manage this configuration outside of the operator. |-----|------|---------|-------------| | additionalLabels | object | `{}` | additional labels to add to all resources | | affinity | object | `{}` | pod affinity | +| env | list | `[]` | Additional environment variables | | fullnameOverride | string | `""` | | | image.pullPolicy | string | `"IfNotPresent"` | The image pull policy to use in grafana operator container | | image.repository | string | `"ghcr.io/grafana-operator/grafana-operator"` | grafana operator image repository | diff --git a/deploy/helm/grafana-operator/templates/deployment.yaml b/deploy/helm/grafana-operator/templates/deployment.yaml index 1fae3c8cb..db3f2ff0f 100644 --- a/deploy/helm/grafana-operator/templates/deployment.yaml +++ b/deploy/helm/grafana-operator/templates/deployment.yaml @@ -48,6 +48,9 @@ spec: {{ else }} value: {{ .Values.watchNamespaces }} {{- end }} + {{- with .Values.env }} + {{- toYaml . | nindent 12 }} + {{- end }} args: - --health-probe-bind-address=:8081 - --metrics-bind-address=0.0.0.0:{{ .Values.metricsService.metricsPort }} diff --git a/deploy/helm/grafana-operator/values.yaml b/deploy/helm/grafana-operator/values.yaml index 149ef0ea3..ae3caa1f0 100644 --- a/deploy/helm/grafana-operator/values.yaml +++ b/deploy/helm/grafana-operator/values.yaml @@ -10,6 +10,11 @@ leaderElect: false # By default it's all namespaces, if you only want to listen for the same namespace as the operator is deployed to look at namespaceScope. watchNamespaces: "" +# -- Additional environment variables +env: [] + # - name: MY_VAR + # value: "myvalue" + image: # -- grafana operator image repository repository: ghcr.io/grafana-operator/grafana-operator