Skip to content

Commit 217cda8

Browse files
authored
temporary fix for missing permissions (#373)
*Issue description:* *Description of changes:* Temporarily add the missing permissions to cloudwatch agent. The permission will be added in the next release of cloudwatch agent operator. *Rollback procedure:* <Can we safely revert this commit if needed? If not, detail what must be done to safely revert and why it is needed.> *Ensure you've run the following tests on your changes and include the link below:* To do so, create a `test.yml` file with `name: Test` and workflow description to test your changes, then remove the file for your PR. Link your test run in your PR description. This process is a short term solution while we work on creating a staging environment for testing. NOTE: TESTS RUNNING ON A SINGLE EKS CLUSTER CANNOT BE RUN IN PARALLEL. See the [needs](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idneeds) keyword to run tests in succession. - Run Java EKS on `e2e-playground` in us-east-1 and eu-central-2 - Run Python EKS on `e2e-playground` in us-east-1 and eu-central-2 - Run metric limiter on EKS cluster `e2e-playground` in us-east-1 and eu-central-2 - Run EC2 tests in all regions - Run K8s on a separate K8s cluster (check IAD test account for master node endpoints; these will change as we create and destroy clusters for OS patching) By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent c980d34 commit 217cda8

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

terraform/dotnet/k8s/deploy/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ resource "null_resource" "deploy" {
8383
sleep 10
8484
kubectl wait --for=condition=Ready pod --all -n amazon-cloudwatch
8585
elif [ "${var.repository}" = "amazon-cloudwatch-agent" ]; then
86+
# tempory fix for missing permissions that will be added by next release of cloudwatch agent operator
87+
kubectl patch clusterrole cloudwatch-agent-role --type=json \
88+
-p='[{"op": "add", "path": "/rules/-", "value": {"apiGroups": ["discovery.k8s.io"], "resources": ["endpointslices"], "verbs": ["list", "watch", "get"]}}]'
8689
kubectl patch amazoncloudwatchagents -n amazon-cloudwatch cloudwatch-agent --type='json' -p='[{"op": "replace", "path": "/spec/image", "value": ${var.patch_image_arn}}]'
8790
kubectl delete pods --all -n amazon-cloudwatch
8891
sleep 10

terraform/java/k8s/deploy/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ resource "null_resource" "deploy" {
8484
sleep 10
8585
kubectl wait --for=condition=Ready pod --all -n amazon-cloudwatch
8686
elif [ "${var.repository}" = "amazon-cloudwatch-agent" ]; then
87+
# tempory fix for missing permissions that will be added by next release of cloudwatch agent operator
88+
kubectl patch clusterrole cloudwatch-agent-role --type=json \
89+
-p='[{"op": "add", "path": "/rules/-", "value": {"apiGroups": ["discovery.k8s.io"], "resources": ["endpointslices"], "verbs": ["list", "watch", "get"]}}]'
8790
kubectl patch amazoncloudwatchagents -n amazon-cloudwatch cloudwatch-agent --type='json' -p='[{"op": "replace", "path": "/spec/image", "value": ${var.patch_image_arn}}]'
8891
kubectl delete pods --all -n amazon-cloudwatch
8992
sleep 10

terraform/node/k8s/deploy/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ resource "null_resource" "deploy" {
8686
sleep 10
8787
kubectl wait --for=condition=Ready pod --all -n amazon-cloudwatch
8888
elif [ "${var.repository}" = "amazon-cloudwatch-agent" ]; then
89+
# tempory fix for missing permissions that will be added by next release of cloudwatch agent operator
90+
kubectl patch clusterrole cloudwatch-agent-role --type=json \
91+
-p='[{"op": "add", "path": "/rules/-", "value": {"apiGroups": ["discovery.k8s.io"], "resources": ["endpointslices"], "verbs": ["list", "watch", "get"]}}]'
8992
kubectl patch amazoncloudwatchagents -n amazon-cloudwatch cloudwatch-agent --type='json' -p='[{"op": "replace", "path": "/spec/image", "value": ${var.patch_image_arn}}]'
9093
kubectl delete pods --all -n amazon-cloudwatch
9194
sleep 10

terraform/python/k8s/deploy/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ resource "null_resource" "deploy" {
8585
sleep 10
8686
kubectl wait --for=condition=Ready pod --all -n amazon-cloudwatch
8787
elif [ "${var.repository}" = "amazon-cloudwatch-agent" ]; then
88+
# tempory fix for missing permissions that will be added by next release of cloudwatch agent operator
89+
kubectl patch clusterrole cloudwatch-agent-role --type=json \
90+
-p='[{"op": "add", "path": "/rules/-", "value": {"apiGroups": ["discovery.k8s.io"], "resources": ["endpointslices"], "verbs": ["list", "watch", "get"]}}]'
8891
kubectl patch amazoncloudwatchagents -n amazon-cloudwatch cloudwatch-agent --type='json' -p='[{"op": "replace", "path": "/spec/image", "value": ${var.patch_image_arn}}]'
8992
kubectl delete pods --all -n amazon-cloudwatch
9093
sleep 10

0 commit comments

Comments
 (0)