-
Notifications
You must be signed in to change notification settings - Fork 839
feat: add TLS support for communication from the Ruler-->AM #3752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
051a641
c5d8c8e
a1a5dea
60e59b1
70dc087
1d07701
5aed44c
ad960a7
3be161d
e199ef5
1bd6052
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -350,6 +350,26 @@ func NewAlertmanager(name string, flags map[string]string, image string) *Cortex | |
| ) | ||
| } | ||
|
|
||
| func NewAlertmanagerWithTLS(name string, flags map[string]string, image string) *CortexService { | ||
|
||
| if image == "" { | ||
| image = GetDefaultImage() | ||
| } | ||
|
|
||
| return NewCortexService( | ||
| name, | ||
| image, | ||
| e2e.NewCommandWithoutEntrypoint("cortex", e2e.BuildArgs(e2e.MergeFlags(map[string]string{ | ||
| "-target": "alertmanager", | ||
| "-log.level": "warn", | ||
| "-experimental.alertmanager.enable-api": "true", | ||
| }, flags))...), | ||
| e2e.NewTCPReadinessProbe(httpPort), | ||
| httpPort, | ||
| grpcPort, | ||
| GossipPort, | ||
| ) | ||
| } | ||
|
|
||
| func NewRuler(name string, flags map[string]string, image string) *CortexService { | ||
| if image == "" { | ||
| image = GetDefaultImage() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,8 @@ import ( | |
| "github.com/prometheus/prometheus/discovery" | ||
| "github.com/prometheus/prometheus/discovery/dns" | ||
| "github.com/stretchr/testify/require" | ||
|
|
||
| "github.com/cortexproject/cortex/pkg/util" | ||
| ) | ||
|
|
||
| func TestBuildNotifierConfig(t *testing.T) { | ||
|
|
@@ -159,7 +161,7 @@ func TestBuildNotifierConfig(t *testing.T) { | |
| }, | ||
| }, | ||
| { | ||
| name: "with Basic Authentication", | ||
| name: "with Basic Authentication URL", | ||
| cfg: &Config{ | ||
| AlertmanagerURL: "http://marco:[email protected]/alertmanager", | ||
| }, | ||
|
|
@@ -185,6 +187,39 @@ func TestBuildNotifierConfig(t *testing.T) { | |
| }, | ||
| }, | ||
| }, | ||
| { | ||
| name: "with Basic Authentication URL and Explicit", | ||
| cfg: &Config{ | ||
| AlertmanagerURL: "http://marco:[email protected]/alertmanager", | ||
| Notifier: NotifierConfig{ | ||
| BasicAuth: util.BasicAuth{ | ||
| Username: "jacob", | ||
| Password: "test", | ||
| }, | ||
| }, | ||
| }, | ||
| ncfg: &config.Config{ | ||
| AlertingConfig: config.AlertingConfig{ | ||
| AlertmanagerConfigs: []*config.AlertmanagerConfig{ | ||
| { | ||
| HTTPClientConfig: config_util.HTTPClientConfig{ | ||
| BasicAuth: &config_util.BasicAuth{Username: "jacob", Password: "test"}, | ||
| }, | ||
| APIVersion: "v1", | ||
| Scheme: "http", | ||
| PathPrefix: "/alertmanager", | ||
| ServiceDiscoveryConfigs: discovery.Configs{ | ||
| discovery.StaticConfig{ | ||
| { | ||
| Targets: []model.LabelSet{{"__address__": "alertmanager-0.default.svc.cluster.local"}}, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| } | ||
|
|
||
| for _, tt := range tests { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.