Skip to content

Commit

Permalink
test: fix logging for EKS e2e runs (cloudnative-pg#5051)
Browse files Browse the repository at this point in the history
Use the CloudWatch addon to save pod logs on EKS container insight.
Ignore the controlplane logs, we've never used them.

Closes: cloudnative-pg#5050

Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
  • Loading branch information
fcanovai authored Jul 10, 2024
1 parent 5c12c83 commit 626e32a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1366,16 +1366,6 @@ jobs:
--snapshot-location-config region="${AWS_REGION}" \
--secret-file ./credentials-velero \
--wait
-
name: Setup log archiving via fluentd and insights
uses: nick-fields/retry@v3
with:
timeout_minutes: 1
max_attempts: 3
command: |
curl https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring/quickstart/cwagent-fluentd-quickstart.yaml \
| sed "s/{{cluster_name}}/${{ env.CLUSTER_NAME }}/;s/{{region_name}}/${{ env.AWS_REGION }}/" \
| kubectl apply -f -
-
name: Prepare patch for customization
env:
Expand Down
31 changes: 18 additions & 13 deletions hack/e2e/eks-cluster.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,21 @@ managedNodeGroups:
desiredCapacity: 3

addons:
- name: vpc-cni
attachPolicyARNs:
- arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy
- name: coredns
version: latest
- name: kube-proxy
version: latest
- name: aws-ebs-csi-driver
version: latest

cloudWatch:
clusterLogging:
enableTypes: ["all"]
- name: vpc-cni
attachPolicyARNs:
- arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy
- name: coredns
version: latest
- name: kube-proxy
version: latest
- name: aws-ebs-csi-driver
version: latest
# Default configuration for CloudWatch agent enabled by the addon can be found here:
# https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring/fluent-bit/fluent-bit.yaml
# There is no retention for the logs by default. You can override the FluentBit configuration to set
# log_retention_days, or use a lambda to set the retention period, like
# https://github.com/binxio/aws-cloudwatch-log-minder
- name: amazon-cloudwatch-observability
version: latest
attachPolicyARNs:
- arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy

0 comments on commit 626e32a

Please sign in to comment.