Skip to content

Commit

Permalink
Modify operator integration test to use yaml instead of helm templati…
Browse files Browse the repository at this point in the history
…ng. (#162)

* Modify operator integration test to use yaml instead of helm templating.

* Added missing file.

* Updated to latest.
  • Loading branch information
musa-asad authored Apr 29, 2024
1 parent 0dad62f commit aa7966c
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/operator-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Test case for AmazonCloudWatchAgent pod creation
run: |
helm template --namespace amazon-cloudwatch -s templates/linux/cloudwatch-agent-daemonset.yaml ./helm --set region=us-west-2 | kubectl apply --namespace amazon-cloudwatch -f -
kubectl apply -f integration-tests/manifests/cloudwatch-agent-daemonset.yaml -n amazon-cloudwatch
sleep 60
kubectl describe pods -n amazon-cloudwatch
pod_name="$(kubectl get pods -n amazon-cloudwatch -l app.kubernetes.io/component=amazon-cloudwatch-agent,app.kubernetes.io/instance=amazon-cloudwatch.cloudwatch-agent -o=jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}')"
Expand Down
80 changes: 80 additions & 0 deletions integration-tests/manifests/cloudwatch-agent-daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
apiVersion: cloudwatch.aws.amazon.com/v1alpha1
kind: AmazonCloudWatchAgent
metadata:
name: cloudwatch-agent
namespace: amazon-cloudwatch
spec:
mode: daemonset
serviceAccount: cloudwatch-agent
image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:latest
config: |
{
"agent": {
"region": "${REGION}",
"debug": true
},
"traces": {
"traces_collected": {
"app_signals": {}
}
},
"logs": {
"metrics_collected": {
"app_signals": {}
}
}
}
volumeMounts:
- mountPath: /rootfs
name: rootfs
readOnly: true
- mountPath: /var/run/docker.sock
name: dockersock
readOnly: true
- mountPath: /run/containerd/containerd.sock
name: containerdsock
- mountPath: /var/lib/docker
name: varlibdocker
readOnly: true
- mountPath: /sys
name: sys
readOnly: true
- mountPath: /dev/disk
name: devdisk
readOnly: true
volumes:
- name: rootfs
hostPath:
path: /
- hostPath:
path: /var/run/docker.sock
name: dockersock
- hostPath:
path: /var/lib/docker
name: varlibdocker
- hostPath:
path: /run/containerd/containerd.sock
name: containerdsock
- hostPath:
path: /sys
name: sys
- hostPath:
path: /dev/disk/
name: devdisk
env:
- name: K8S_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: HOST_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: HOST_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: K8S_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace

0 comments on commit aa7966c

Please sign in to comment.