Skip to content

Commit

Permalink
fix: reintroduce-support-for-proxy (#1286)
Browse files Browse the repository at this point in the history
* fix: reintroduce-support-for-proxy

* 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](tj-actions/changed-files@408093d...95690f9)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* update documentation to include proxy settings

* feat(chart): env

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Peter Braun <[email protected]>
  • Loading branch information
3 people authored Oct 31, 2023
1 parent 50382a7 commit 7f4ee59
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
12 changes: 4 additions & 8 deletions controllers/client/round_tripper.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package client

import (
"crypto/tls"
"net/http"
"strconv"

Expand All @@ -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,
Expand Down
1 change: 1 addition & 0 deletions deploy/helm/grafana-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
3 changes: 3 additions & 0 deletions deploy/helm/grafana-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
5 changes: 5 additions & 0 deletions deploy/helm/grafana-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions docs/docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

0 comments on commit 7f4ee59

Please sign in to comment.