-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add integ tests for EKS windows #387
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
47b88f8
Add terraform for eks windows
KlwntSingh 4733868
Fix CW agent image and test generator
KlwntSingh 78c6d0d
Fix formatting in terraform templates
KlwntSingh 550ddad
Removed temporary link to cw agent container image
KlwntSingh bdc185f
Add terraform templates for both 2019 and 2022
KlwntSingh bcc13b3
Lint formatting
KlwntSingh 73555b8
Merge branch 'aws:main' into main-addIntegTests
KlwntSingh 4f78f52
Remove test cw repo
KlwntSingh 0b9a30d
Fix lint issues
KlwntSingh 0b27210
fix path to CW agent on Windows
KlwntSingh 6c94a72
Fix CW agent for validating individual metric in dimensions
KlwntSingh 9ed5503
fix sytax error
KlwntSingh 3372dcd
Fix lint issues
KlwntSingh 9656063
Remove extra license header from terraform templates
KlwntSingh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
terraform/eks/daemon/default_resources/cwagent-windows.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# create amazon-cloudwatch namespace | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: cloudwatch-agent-windows | ||
namespace: amazon-cloudwatch | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: cloudwatch-agent | ||
template: | ||
metadata: | ||
labels: | ||
app: cloudwatch-agent | ||
spec: | ||
securityContext: | ||
windowsOptions: | ||
hostProcess: true | ||
runAsUserName: "NT AUTHORITY\\SYSTEM" | ||
hostNetwork: true | ||
containers: | ||
- name: cloudwatch-agent | ||
image: CW_TEST_IMAGE | ||
volumeMounts: | ||
- name: cwagentconfig | ||
mountPath: C:\Program Files\Amazon\AmazonCloudWatchAgent\cwagentconfig | ||
resources: | ||
limits: | ||
cpu: 400m | ||
memory: 400Mi | ||
requests: | ||
cpu: 400m | ||
memory: 400Mi | ||
imagePullPolicy: Always | ||
env: | ||
- name: HOST_IP | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: "status.hostIP" | ||
- name: HOST_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
- name: K8S_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
- name: CI_VERSION | ||
value: "k8s/1.3.20" | ||
- name: CWAGENT_LOG_LEVEL | ||
value: DEBUG | ||
- name: RUN_IN_CONTAINER | ||
value: "True" | ||
- name: RUN_AS_HOST_PROCESS_CONTAINER | ||
value: "True" | ||
nodeSelector: | ||
kubernetes.io/os: windows | ||
serviceAccountName: cloudwatch-agent | ||
volumes: | ||
- name: cwagentconfig | ||
configMap: | ||
name: cwagentconfig |
148 changes: 148 additions & 0 deletions
148
terraform/eks/daemon/default_resources/fluenbit-windows-configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: fluent-bit-windows-config | ||
namespace: amazon-cloudwatch | ||
labels: | ||
k8s-app: fluent-bit | ||
data: | ||
fluent-bit.conf: | | ||
[SERVICE] | ||
Flush 5 | ||
Log_Level error | ||
Daemon off | ||
net.dns.resolver LEGACY | ||
Parsers_File parsers.conf | ||
|
||
@INCLUDE application-log.conf | ||
@INCLUDE dataplane-log.conf | ||
@INCLUDE host-log.conf | ||
|
||
application-log.conf: | | ||
[INPUT] | ||
Name tail | ||
Tag application.* | ||
Exclude_Path C:\\var\\log\\containers\\fluent-bit*, C:\\var\\log\\containers\\cloudwatch-agent* | ||
Path C:\\var\\log\\containers\\*.log | ||
Parser docker | ||
DB C:\\var\\fluent-bit\\state\\flb_container.db | ||
Mem_Buf_Limit 50MB | ||
Skip_Long_Lines On | ||
Rotate_Wait 30 | ||
Refresh_Interval 10 | ||
Read_from_Head ${READ_FROM_HEAD} | ||
|
||
[INPUT] | ||
Name tail | ||
Tag application.* | ||
Path C:\\var\\log\\containers\\fluent-bit* | ||
Parser docker | ||
DB C:\\var\\fluent-bit\\state\\flb_log.db | ||
Mem_Buf_Limit 5MB | ||
Skip_Long_Lines On | ||
Rotate_Wait 30 | ||
Refresh_Interval 10 | ||
Read_from_Head ${READ_FROM_HEAD} | ||
|
||
[INPUT] | ||
Name tail | ||
Tag application.* | ||
Path C:\\var\\log\\containers\\cloudwatch-agent* | ||
Parser docker | ||
DB C:\\var\\fluent-bit\\state\\flb_cwagent.db | ||
Mem_Buf_Limit 5MB | ||
Skip_Long_Lines On | ||
Rotate_Wait 30 | ||
Refresh_Interval 10 | ||
Read_from_Head ${READ_FROM_HEAD} | ||
|
||
[OUTPUT] | ||
Name cloudwatch_logs | ||
Match application.* | ||
region ${AWS_REGION} | ||
log_group_name /aws/containerinsights/${CLUSTER_NAME}/application | ||
log_stream_prefix ${HOST_NAME}- | ||
auto_create_group true | ||
extra_user_agent container-insights | ||
|
||
dataplane-log.conf: | | ||
[INPUT] | ||
Name tail | ||
Tag dataplane.tail.* | ||
Path C:\\ProgramData\\containerd\\root\\*.log, C:\\ProgramData\\Amazon\\EKS\\logs\\*.log | ||
Parser dataplane_firstline | ||
DB C:\\var\\fluent-bit\\state\\flb_dataplane_tail.db | ||
Mem_Buf_Limit 5MB | ||
Skip_Long_Lines On | ||
Rotate_Wait 30 | ||
Refresh_Interval 10 | ||
Read_from_Head ${READ_FROM_HEAD} | ||
|
||
[INPUT] | ||
Name tail | ||
Tag dataplane.tail.C.ProgramData.Amazon.EKS.logs.vpc-bridge | ||
Path C:\\ProgramData\\Amazon\\EKS\\logs\\*.log.* | ||
Path_Key file_name | ||
Parser dataplane_firstline | ||
DB C:\\var\\fluent-bit\\state\\flb_dataplane_cni_tail.db | ||
Mem_Buf_Limit 5MB | ||
Skip_Long_Lines On | ||
Rotate_Wait 30 | ||
Refresh_Interval 10 | ||
Read_from_Head ${READ_FROM_HEAD} | ||
|
||
[FILTER] | ||
Name aws | ||
Match dataplane.* | ||
imds_version v2 | ||
|
||
[OUTPUT] | ||
Name cloudwatch_logs | ||
Match dataplane.* | ||
region ${AWS_REGION} | ||
log_group_name /aws/containerinsights/${CLUSTER_NAME}/dataplane | ||
log_stream_prefix ${HOST_NAME}- | ||
auto_create_group true | ||
extra_user_agent container-insights | ||
|
||
host-log.conf: | | ||
[INPUT] | ||
Name winlog | ||
Channels EKS, System | ||
DB C:\\var\\fluent-bit\\state\\flb_system_winlog.db | ||
Interval_Sec 60 | ||
|
||
[FILTER] | ||
Name aws | ||
Match winlog.* | ||
imds_version v2 | ||
|
||
[OUTPUT] | ||
Name cloudwatch_logs | ||
Match winlog.* | ||
region ${AWS_REGION} | ||
log_group_name /aws/containerinsights/${CLUSTER_NAME}/host | ||
log_stream_prefix ${HOST_NAME}. | ||
auto_create_group true | ||
extra_user_agent container-insights | ||
|
||
parsers.conf: | | ||
[PARSER] | ||
Name docker | ||
Format json | ||
Time_Key time | ||
Time_Format %b %d %H:%M:%S | ||
|
||
[PARSER] | ||
Name container_firstline | ||
Format regex | ||
Regex (?<log>(?<="log":")\S(?!\.).*?)(?<!\\)".*(?<stream>(?<="stream":").*?)".*(?<time>\d{4}-\d{1,2}-\d{1,2}T\d{2}:\d{2}:\d{2}\.\w*).*(?=}) | ||
Time_Key time | ||
Time_Format %Y-%m-%dT%H:%M:%S.%LZ | ||
|
||
[PARSER] | ||
Name dataplane_firstline | ||
Format regex | ||
Regex (?<log>(?<="log":")\S(?!\.).*?)(?<!\\)".*(?<stream>(?<="stream":").*?)".*(?<time>\d{4}-\d{1,2}-\d{1,2}T\d{2}:\d{2}:\d{2}\.\w*).*(?=}) | ||
Time_Key time | ||
Time_Format %Y-%m-%dT%H:%M:%S.%LZ |
76 changes: 76 additions & 0 deletions
76
terraform/eks/daemon/default_resources/fluenbit-windows-daemonset.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: fluent-bit-windows | ||
namespace: amazon-cloudwatch | ||
labels: | ||
k8s-app: fluent-bit | ||
version: v1 | ||
kubernetes.io/cluster-service: "true" | ||
spec: | ||
selector: | ||
matchLabels: | ||
k8s-app: fluent-bit | ||
template: | ||
metadata: | ||
labels: | ||
k8s-app: fluent-bit | ||
version: v1 | ||
kubernetes.io/cluster-service: "true" | ||
spec: | ||
securityContext: | ||
windowsOptions: | ||
hostProcess: true | ||
runAsUserName: "NT AUTHORITY\\System" | ||
hostNetwork: true | ||
nodeSelector: | ||
kubernetes.io/os: windows | ||
containers: | ||
- name: fluent-bit | ||
image: public.ecr.aws/aws-observability/aws-for-fluent-bit:windowsservercore-stable | ||
imagePullPolicy: Always | ||
command: ["powershell.exe", "-Command", "New-Item -ItemType Directory -Path C:\\var\\fluent-bit\\state -Force;", "%CONTAINER_SANDBOX_MOUNT_POINT%/fluent-bit/bin/fluent-bit.exe", "-e", "%CONTAINER_SANDBOX_MOUNT_POINT%/fluent-bit/kinesis.dll", "-e", "%CONTAINER_SANDBOX_MOUNT_POINT%/fluent-bit/firehose.dll", "-e", "%CONTAINER_SANDBOX_MOUNT_POINT%/fluent-bit/cloudwatch.dll", "-c", "%CONTAINER_SANDBOX_MOUNT_POINT%/fluent-bit/configuration/fluent-bit.conf"] | ||
env: | ||
- name: AWS_REGION | ||
valueFrom: | ||
configMapKeyRef: | ||
name: "fluent-bit-cluster-info" | ||
key: "logs.region" | ||
- name: CLUSTER_NAME | ||
valueFrom: | ||
configMapKeyRef: | ||
name: "fluent-bit-cluster-info" | ||
key: "cluster.name" | ||
- name: READ_FROM_HEAD | ||
valueFrom: | ||
configMapKeyRef: | ||
name: "fluent-bit-cluster-info" | ||
key: "read.head" | ||
- name: HOST_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
- name: HOSTNAME | ||
valueFrom: | ||
fieldRef: | ||
apiVersion: v1 | ||
fieldPath: metadata.name | ||
- name: CI_VERSION | ||
value: "k8s/1.3.17" | ||
resources: | ||
limits: | ||
cpu: 500m | ||
memory: 600Mi | ||
requests: | ||
cpu: 500m | ||
memory: 600Mi | ||
volumeMounts: | ||
- name: fluent-bit-config | ||
mountPath: fluent-bit\configuration\ | ||
volumes: | ||
- name: fluent-bit-config | ||
configMap: | ||
name: fluent-bit-windows-config | ||
terminationGracePeriodSeconds: 10 | ||
dnsPolicy: ClusterFirstWithHostNet | ||
serviceAccountName: cloudwatch-agent |
28 changes: 28 additions & 0 deletions
28
terraform/eks/daemon/default_resources/test-sample-windows.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: windows-test-deployment | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: windows-test-deployment | ||
tier: backend | ||
track: stable | ||
replicas: REPLICAS | ||
template: | ||
metadata: | ||
labels: | ||
app: windows-test-deployment | ||
tier: backend | ||
track: stable | ||
spec: | ||
containers: | ||
- name: windows-test-deployment | ||
image: mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltscWINDOWS_SERVER_VERSION | ||
command: | ||
- powershell.exe | ||
- -command | ||
- "Add-WindowsFeature Web-Server; Invoke-WebRequest -UseBasicParsing -Uri 'https://dotnetbinaries.blob.core.windows.net/servicemonitor/2.0.1.6/ServiceMonitor.exe' -OutFile 'C:\\ServiceMonitor.exe'; echo '<html><body><br/><br/><H1>Windows Container Workshop - Windows LTSC2019!!!<H1></body><html>' > C:\\inetpub\\wwwroot\\iisstart.htm; C:\\ServiceMonitor.exe 'w3svc'; " | ||
nodeSelector: | ||
kubernetes.io/os: windows | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check if /test/emf is testing any specific feature and implement it for windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @nathalapooja,
these emf test are testing emf receiver/exporter in CW agent.
Since CI tests are indirectly testing emf already, this particular test can be skipped for Windows at the moment but it is still good to have this test for Windows.
I will work on adding this test for Windows as post-release activity.