Skip to content

Implemented TargetAllocator resource deployments. #208

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

Merged
merged 105 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
4b1eb31
Implemented TargetAllocator deployment and other dependencies from up…
musa-asad Aug 20, 2024
0e079bd
Added unit tests, organization, and relevant build files.
musa-asad Aug 20, 2024
ca26265
Fixed tests.
musa-asad Aug 20, 2024
3a871af
Update crds.
musa-asad Aug 20, 2024
0755622
Updated docs.
musa-asad Aug 20, 2024
a77533f
Reversed crd changes.
musa-asad Aug 20, 2024
1d8a923
Generated files.
musa-asad Aug 20, 2024
15a2e2b
Updated webhooks.
musa-asad Aug 20, 2024
2c7b788
Updated config_replace.go to include allocator logic.
musa-asad Aug 20, 2024
4202fae
Revert "Updated config_replace.go to include allocator logic."
musa-asad Aug 20, 2024
ea3c937
Updated doc and imports.
musa-asad Aug 20, 2024
0ef5529
Revert "Updated doc and imports."
musa-asad Aug 20, 2024
ec14fe5
Revert "Updated webhooks."
musa-asad Aug 20, 2024
d324ccf
Replica if enabled.
musa-asad Aug 20, 2024
2979609
Auto-generated.
musa-asad Aug 20, 2024
1235400
Added default config.
musa-asad Aug 20, 2024
db8c52f
Revert "Added default config."
musa-asad Aug 20, 2024
6da51f6
Removed errors for testing.
musa-asad Aug 21, 2024
36d1c6c
Revert "Removed errors for testing."
musa-asad Aug 21, 2024
3cdebd9
Use prometheusConfig.
musa-asad Aug 21, 2024
cfe2dbe
Fix version.
musa-asad Aug 21, 2024
c220dd5
Included validation in webhooks.
musa-asad Aug 21, 2024
561b2ff
Use prometheus config.
musa-asad Aug 21, 2024
60a2856
Updated webook test and added types to v1alpha2.
musa-asad Aug 21, 2024
f8720f4
Fixed test.
musa-asad Aug 21, 2024
75a0168
Removed extra comma.
musa-asad Aug 21, 2024
a1860bd
Auto-generated files.
musa-asad Aug 21, 2024
fe690fd
Removed pod mode validation.
musa-asad Aug 21, 2024
96080d2
Made prometheusConfig format specific to its use-case.
musa-asad Aug 22, 2024
9939f55
Use config instead of global for prometheusConfig yaml.
musa-asad Aug 22, 2024
fad09e9
Addressed some comments: yaml, target-allocator, and use consistent-h…
musa-asad Aug 29, 2024
1102dc1
Changed to TARGET_ALLOCATOR.
musa-asad Aug 29, 2024
ceaaa49
Removed unused escape 16326 logic.
musa-asad Aug 29, 2024
d77d772
Use Prometheus naming convention and fixed Makefile.
musa-asad Aug 29, 2024
d530489
Reverted yaml name.
musa-asad Aug 29, 2024
6002c81
Deploy Prometheus ConfigMap, Volume, and VolumeMount.
musa-asad Aug 30, 2024
2fffbdb
Spacing.
musa-asad Aug 30, 2024
e254d68
Spacing.
musa-asad Aug 30, 2024
15bfd18
Update E2E file name (#213)
harrryr Aug 30, 2024
95a68d1
Adding support for NodeJS auto instrumentation and integ tests (#220)
Paramadon Sep 3, 2024
9aabd53
Version bumps and updating release notes for v1.7.0 release (#221)
mitali-salvi Sep 3, 2024
681ec79
Added unit test for checking added volume.
musa-asad Sep 4, 2024
cff2d6e
Added configmap testing for prometheus.
musa-asad Sep 4, 2024
622570f
Enforce statefulset.
musa-asad Sep 4, 2024
c6a15f3
Implemented ReplacePrometheusConfig to allow for service discovery en…
musa-asad Sep 5, 2024
249c7f9
Fixed incorrect parsing.
musa-asad Sep 6, 2024
48099b4
Added testing for service discovery changes.
musa-asad Sep 8, 2024
ad907fd
Add testing for config_replace.go.
musa-asad Sep 8, 2024
85387a1
Fixing version.txt version of dotnet and nodejs (#228)
Paramadon Sep 9, 2024
25d547c
Fixing integration tests for EKS add-on with the change to separate C…
mitali-salvi Sep 9, 2024
af44378
Support configurable resources for NodeJS. (#225)
musa-asad Sep 9, 2024
a5c350e
Use target allocator service account name.
musa-asad Sep 9, 2024
cbf802f
Give a set name for the target allocator service account.
musa-asad Sep 9, 2024
8b9af0a
Fixed naming.
musa-asad Sep 9, 2024
e79ca42
Updated featuregate description.
musa-asad Sep 10, 2024
3e190b3
Fixed labels, comments, and naming conventions.
musa-asad Sep 10, 2024
f51816b
Change test failure to echo a warning when checking k8s version depen…
lisguo Sep 11, 2024
194b0b8
Re-introduce double dollar env substitution logic.
musa-asad Sep 12, 2024
12fcab9
Migrated prometheus type from string to PrometheusConfig struct.
musa-asad Sep 13, 2024
8a60455
Use yaml2 for configmap_test.go.
musa-asad Sep 13, 2024
28164a4
Add changes to v1alpha2.
musa-asad Sep 13, 2024
8516295
Implement marshaling and unmarshaling for AnyConfig.
musa-asad Sep 13, 2024
a8852ce
Add TA version to labels.
musa-asad Sep 13, 2024
a32bbc0
Open Application Signals ports on CWAgent only when enabled (#230)
Paramadon Sep 13, 2024
d84410b
Merge branch 'main' into target-allocator-v0.90.0
musa-asad Sep 18, 2024
55c57ff
Merge branch 'main' into merge-main
musa-asad Sep 18, 2024
8134bde
Merge branch 'target-allocator' into target-allocator-v0.90.0
musa-asad Sep 18, 2024
377104f
Supporting K8s 1.31 (#222)
mitali-salvi Sep 18, 2024
d124688
Merge branch 'aws:main' into target-allocator-v0.90.0
musa-asad Sep 19, 2024
646940a
Merge branch 'target-allocator' into target-allocator-v0.90.0
musa-asad Sep 19, 2024
130eee3
Fix version back.
musa-asad Sep 19, 2024
7512b4b
Don't unescape 93073 for prometheus config.
musa-asad Sep 22, 2024
87964bf
Fix test.
musa-asad Sep 23, 2024
0afedf1
Fix test.
musa-asad Sep 23, 2024
95d9c66
Removed double dollar to single dollar substitution logic.
musa-asad Sep 24, 2024
ce3edda
Removed more double dollar usages.
musa-asad Sep 24, 2024
b6faf59
Fix import.
musa-asad Sep 24, 2024
e07b0a6
Remove collector_id from httpsd logic.
musa-asad Sep 25, 2024
e432bd9
Remove unused proxy environmental variables.
musa-asad Sep 25, 2024
71d6405
Remove unused proxy tests.
musa-asad Sep 25, 2024
db066a0
Revert "Merge branch 'main' into target-allocator-v0.90.0"
musa-asad Sep 25, 2024
f4783e2
Revert "Merge branch 'target-allocator' into target-allocator-v0.90.0"
musa-asad Sep 25, 2024
923cb42
Revert "Merge branch 'aws:main' into target-allocator-v0.90.0"
musa-asad Sep 25, 2024
32e6e72
Revert "Merge branch 'target-allocator' into target-allocator-v0.90.0"
musa-asad Sep 25, 2024
cf4a6ad
Revert "Merge branch 'main' into merge-main"
musa-asad Sep 25, 2024
05fccd4
Revert last 5 commits.
musa-asad Sep 25, 2024
dab4047
Addressed comments.
musa-asad Sep 25, 2024
2df53f0
Merge remote-tracking branch 'upstream/target-allocator' into target-…
musa-asad Sep 25, 2024
0f3ca46
Updated configmap format.
musa-asad Sep 26, 2024
712bf31
Fixed issues.
musa-asad Sep 26, 2024
9a1c4e4
Made prometheus configmap compatible with current agent prometheus in…
musa-asad Sep 26, 2024
e0ddd4a
Made service name constant.
musa-asad Sep 26, 2024
0c6673e
Revert "Made service name constant."
musa-asad Sep 26, 2024
371812e
Make service name constant.
musa-asad Sep 26, 2024
a4e74da
Fix Makefile.
musa-asad Sep 26, 2024
557c263
Remove comment.
musa-asad Sep 27, 2024
9ec6ae7
Use ConfigMapEntry().
musa-asad Sep 27, 2024
f3446ec
Use function for service name.
musa-asad Sep 27, 2024
acd158f
Use constants isntead of ConfigMapEntry().
musa-asad Sep 27, 2024
4946b79
Use function for TAService().
musa-asad Sep 27, 2024
801e9eb
Use ConfigMapEntry() with fixed tests.
musa-asad Sep 27, 2024
2519ad1
Test ConfigMapEntry() for TA.
musa-asad Sep 27, 2024
deb08d5
Made target port 8080.
musa-asad Sep 27, 2024
ae90c31
Addressed nits.
musa-asad Sep 27, 2024
1986ad7
Fix imports.
musa-asad Oct 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"net/url"
"regexp"

"github.com/aws/amazon-cloudwatch-agent-operator/internal/naming"

"github.com/aws/amazon-cloudwatch-agent-operator/internal/manifests/collector/adapters"
)

Expand Down Expand Up @@ -194,7 +196,7 @@ func AddHTTPSDConfigToPromConfig(prometheus map[interface{}]interface{}, taServi
escapedJob := url.QueryEscape(jobName)
scrapeConfig["http_sd_configs"] = []interface{}{
map[string]interface{}{
"url": fmt.Sprintf("http://%s:80/jobs/%s/targets", taServiceName, escapedJob),
"url": fmt.Sprintf("http://%s:%d/jobs/%s/targets", taServiceName, naming.TargetAllocatorPort, escapedJob),
},
}
}
Expand Down Expand Up @@ -226,7 +228,7 @@ func AddTAConfigToPromConfig(prometheus map[interface{}]interface{}, taServiceNa
return nil, errorNotAMap("target_allocator")
}

targetAllocatorCfg["endpoint"] = fmt.Sprintf("http://%s:80", taServiceName)
targetAllocatorCfg["endpoint"] = fmt.Sprintf("http://%s:%d", taServiceName, naming.TargetAllocatorPort)
targetAllocatorCfg["interval"] = "30s"

// Remove the scrape_configs key from the map
Expand Down
2 changes: 1 addition & 1 deletion internal/manifests/targetallocator/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func Container(cfg config.Config, logger logr.Logger, otelcol v1alpha1.AmazonClo
ports := make([]corev1.ContainerPort, 0)
ports = append(ports, corev1.ContainerPort{
Name: "http",
ContainerPort: 8080,
ContainerPort: naming.TargetAllocatorTargetPort,
Protocol: corev1.ProtocolTCP,
})

Expand Down
4 changes: 2 additions & 2 deletions internal/manifests/targetallocator/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ func Service(params manifests.Params) *corev1.Service {
Selector: selector,
Ports: []corev1.ServicePort{{
Name: "targetallocation",
Port: 80,
TargetPort: intstr.FromString("http"),
Port: naming.TargetAllocatorPort,
TargetPort: intstr.FromInt32(naming.TargetAllocatorTargetPort),
}},
},
}
Expand Down
2 changes: 1 addition & 1 deletion internal/manifests/targetallocator/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestServicePorts(t *testing.T) {
Log: logger,
}

ports := []v1.ServicePort{{Name: "targetallocation", Port: 80, TargetPort: intstr.FromString("http")}}
ports := []v1.ServicePort{{Name: "targetallocation", Port: 80, TargetPort: intstr.FromInt32(8080)}}

s := Service(params)

Expand Down
5 changes: 5 additions & 0 deletions internal/naming/port.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ import (
"strings"
)

const (
TargetAllocatorPort = 80
TargetAllocatorTargetPort = 8080
)

var (
// DNS_LABEL constraints: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names
dnsLabelValidation = regexp.MustCompile("^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$")
Expand Down