Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 34 additions & 0 deletions charts/member-agent-arc/charts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,38 @@ func TestHelmChartTemplatesRenderValidYAML(t *testing.T) {
"enableTrafficManagerFeature": true,
"enableNetworkingFeatures": true,
"propertyProvider": "azure",
"geneva": map[string]interface{}{
"mdsd": map[string]interface{}{
"repository": "linuxgeneva-microsoft.azurecr.io/genevamdsd",
"tag": "v1.0.0",
},
"fluentd": map[string]interface{}{
"repository": "linuxgeneva-microsoft.azurecr.io/genevafluentd_td-agent",
"tag": "v1.0.0",
},
"mdm": map[string]interface{}{
"repository": "linuxgeneva-microsoft.azurecr.io/genevamdm",
"tag": "v1.0.0",
"account": "test-mdm-account",
},
"gcs": map[string]interface{}{
"environment": "Test",
"account": "test-account",
"region": "test-region",
"namespace": "test-namespace",
"configVersion": "1.0",
"authIdType": "AuthMSIToken",
},
"config": map[string]interface{}{
"tenant": "test-tenant",
"role": "test-role",
"azureEnvironment": "AzurePublicCloud",
"enableGigBridgeMode": "1",
},
"debugging": map[string]interface{}{
"dockerLogging": "false",
},
},
"Azure": map[string]interface{}{
"proxySettings": map[string]interface{}{
"isProxyEnabled": true,
Expand Down Expand Up @@ -91,6 +123,8 @@ func TestHelmChartTemplatesRenderValidYAML(t *testing.T) {
{name: "rbac template", templateFile: "rbac.yaml"},
{name: "serviceaccount template", templateFile: "serviceaccount.yaml"},
{name: "azure-proxy-secrets template", templateFile: "azure-proxy-secrets.yaml"},
{name: "configmap-fluentd template", templateFile: "configmap-fluentd.yaml"},
{name: "configmap-mdm template", templateFile: "configmap-mdm.yaml"},
}

for _, tt := range tests {
Expand Down
65 changes: 65 additions & 0 deletions charts/member-agent-arc/configs/fluent.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<source>
@type tail
# Matching the following log files:
# fleet-hub-agent-*_fleet-hub-agent-*.log
# fleet-member-agent-*_msi-adapter-*.log
# fleet-member-agent-*_refresh-tokent-*.log
# fleet-member-agent-*_fleet-member-agent-*.log
path /var/log/containers/fleet-*-agent-*.log
path_key tailed_path
pos_file /var/log/td-agent.fleet-agent.log.pos
tag arc-extension.fleet-agent.*
read_from_head true
<parse>
@type regexp
time_format %Y-%m-%dT%H:%M:%S.%L%z
expression /^(?<time>.+)\s*(?<stream>stdout|stderr)\s*(?<partitiontag>[PF])\s*(?<log>.*)$/
</parse>
</source>
# Collect logs for fleet networking controller managers, which are pods with names like fleet-*-controller-manager-*.log
# Same as fleet-agent, these logs are tagged with `arc-extension.fleet-agent.*` and will show up in the same table.
<source>
@type tail
# Matching the following log files:
# fleet-hub-net-controller-manager-*_fleet-hub-net-controller-manager-*.log
# fleet-member-net-controller-manager-*_msi-adapter-*.log
# fleet-member-net-controller-manager-*_refresh-tokent-*.log
# fleet-member-net-controller-manager-*_fleet-member-net-controller-manager-*.log
# fleet-mcs-controller-manager-*_fleet-mcs-controller-manager-*.log
path /var/log/containers/fleet-*-controller-manager-*.log
path_key tailed_path
pos_file /var/log/td-agent.fleet-net-controller-manager.log.pos
tag arc-extension.fleet-agent.*
read_from_head true
<parse>
@type regexp
time_format %Y-%m-%dT%H:%M:%S.%L%z
expression /^(?<time>.+)\s*(?<stream>stdout|stderr)\s*(?<partitiontag>[PF])\s*(?<log>.*)$/
</parse>
</source>
# Collect logs for CRD installer, which are pods with names like crd-installer-*.log
# Same as fleet-agent, these logs are tagged with `arc-extension.fleet-agent.*` and will show up in the same table.
# <source>
# @type tail
# # Matching the following log files:
# # crd-installer-*_crd-installer-*.log
# path /var/log/containers/crd-installer-*.log
# path_key tailed_path
# pos_file /var/log/td-agent.crd-installer.log.pos
# tag arc-extension.fleet-agent.*
# read_from_head true
# <parse>
# @type regexp
# time_format %Y-%m-%dT%H:%M:%S.%L%z
# expression /^(?<time>.+)\s*(?<stream>stdout|stderr)\s*(?<partitiontag>[PF])\s*(?<log>.*)$/
# </parse>
# </source>
# Add tag arc.fleetagent to logs from fleet agents, which are running under CCP namespaces.
<match arc-extension.fleet-agent.**>
@type rewrite_tag_filter
<rule>
key namespace
pattern ^.*$
tag arc.fleetagent
</rule>
</match>
48 changes: 48 additions & 0 deletions charts/member-agent-arc/templates/configmap-fluentd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: fluentd-config
namespace: {{ .Values.namespace }}
data:
fluentd.conf: |
<source>
@type tail
# Matching the following log files:
# fleet-hub-agent-*_fleet-hub-agent-*.log
# fleet-member-agent-*_msi-adapter-*.log
# fleet-member-agent-*_refresh-tokent-*.log
# fleet-member-agent-*_fleet-member-agent-*.log
path /var/log/containers/fleet-*-agent-*.log
path_key tailed_path
pos_file /var/log/td-agent.fleet-agent.log.pos
tag arc-extension.fleet-agent.*
read_from_head true
<parse>
@type regexp
time_format %Y-%m-%dT%H:%M:%S.%L%z
expression /^(?<time>.+)\s*(?<stream>stdout|stderr)\s*(?<partitiontag>[PF])\s*(?<log>.*)$/
</parse>
</source>
# Collect logs for fleet networking controller managers
<source>
@type tail
path /var/log/containers/fleet-*-controller-manager-*.log
path_key tailed_path
pos_file /var/log/td-agent.fleet-net-controller-manager.log.pos
tag arc-extension.fleet-agent.*
read_from_head true
<parse>
@type regexp
time_format %Y-%m-%dT%H:%M:%S.%L%z
expression /^(?<time>.+)\s*(?<stream>stdout|stderr)\s*(?<partitiontag>[PF])\s*(?<log>.*)$/
</parse>
</source>
# Add tag arc.fleetagent to logs from fleet agents
<match arc-extension.fleet-agent.**>
@type rewrite_tag_filter
<rule>
key namespace
pattern ^.*$
tag arc.fleetagent
</rule>
</match>
11 changes: 11 additions & 0 deletions charts/member-agent-arc/templates/configmap-mdm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: mdm-config
namespace: {{ .Values.namespace }}
data:
mdmconfig.json: |
{
"account": "{{ .Values.geneva.mdm.account }}",
"input": "influxdb_udp"
}
Loading
Loading