Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
feat: updates for container monitoring addon omsagent agent Feb 2021 …
Browse files Browse the repository at this point in the history
…release (#4328)
  • Loading branch information
ganga1980 authored Mar 17, 2021
1 parent 2f854cb commit 807e75d
Show file tree
Hide file tree
Showing 6 changed files with 193 additions and 103 deletions.
123 changes: 80 additions & 43 deletions parts/k8s/addons/container-monitoring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ metadata:
addonmanager.kubernetes.io/mode: Reconcile
rules:
- apiGroups: [""]
resources: ["pods", "events", "nodes", "nodes/stats", "nodes/metrics", "nodes/spec", "nodes/proxy", "namespaces", "services"]
resources: ["pods", "events", "nodes", "nodes/stats", "nodes/metrics", "nodes/spec", "nodes/proxy", "namespaces", "services", "persistentvolumes"]
verbs: ["list", "get", "watch"]
- apiGroups: ["apps", "extensions", "autoscaling"]
resources: ["replicasets", "deployments", "horizontalpodautoscalers"]
Expand Down Expand Up @@ -61,7 +61,7 @@ kind: ConfigMap
apiVersion: v1
data:
kube.conf: |-
# Fluentd config file for OMS Docker - cluster components (kubeAPI)
# Fluentd config file for OMS Docker - cluster components (kubeAPI)
#fluent forward plugin
<source>
type forward
Expand All @@ -75,8 +75,15 @@ data:
type kubepodinventory
tag oms.containerinsights.KubePodInventory
run_interval 60
log_level debug
</source>
#Kubernetes Persistent Volume inventory
<source>
type kubepvinventory
tag oms.containerinsights.KubePVInventory
run_interval 60
log_level debug
custom_metrics_azure_regions eastus,southcentralus,westcentralus,westus2,southeastasia,northeurope,westeurope,southafricanorth,centralus,northcentralus,eastus2,koreacentral,eastasia,centralindia,uksouth,canadacentral,francecentral,japaneast,australiaeast,eastus2,westus,australiasoutheast,brazilsouth,germanywestcentral,northcentralus,switzerlandnorth
</source>
#Kubernetes events
Expand All @@ -85,7 +92,7 @@ data:
tag oms.containerinsights.KubeEvents
run_interval 60
log_level debug
</source>
</source>
#Kubernetes Nodes
<source>
Expand Down Expand Up @@ -128,15 +135,13 @@ data:
</source>
<filter mdm.kubenodeinventory**>
type filter_inventory2mdm
custom_metrics_azure_regions eastus,southcentralus,westcentralus,westus2,southeastasia,northeurope,westeurope,southafricanorth,centralus,northcentralus,eastus2,koreacentral,eastasia,centralindia,uksouth,canadacentral,francecentral,japaneast,australiaeast,eastus2,westus,australiasoutheast,brazilsouth,germanywestcentral,northcentralus,switzerlandnorth
type filter_inventory2mdm
log_level info
</filter>
#custom_metrics_mdm filter plugin for perf data from windows nodes
<filter mdm.cadvisorperf**>
type filter_cadvisor2mdm
custom_metrics_azure_regions eastus,southcentralus,westcentralus,westus2,southeastasia,northeurope,westeurope,southafricanorth,centralus,northcentralus,eastus2,koreacentral,eastasia,centralindia,uksouth,canadacentral,francecentral,japaneast,australiaeast,eastus2,westus,australiasoutheast,brazilsouth,germanywestcentral,northcentralus,switzerlandnorth
metrics_to_collect cpuUsageNanoCores,memoryWorkingSetBytes,pvUsedBytes
log_level info
</filter>
Expand All @@ -149,7 +154,7 @@ data:
<match oms.containerinsights.KubePodInventory**>
type out_oms
log_level debug
num_threads 5
num_threads 2
buffer_chunk_limit 4m
buffer_type file
buffer_path %STATE_DIR_WS%/out_oms_kubepods*.buffer
Expand All @@ -161,12 +166,27 @@ data:
max_retry_wait 5m
</match>
<match oms.containerinsights.KubeEvents**>
<match oms.containerinsights.KubePVInventory**>
type out_oms
log_level debug
num_threads 5
buffer_chunk_limit 4m
buffer_type file
buffer_path %STATE_DIR_WS%/state/out_oms_kubepv*.buffer
buffer_queue_limit 20
buffer_queue_full_action drop_oldest_chunk
flush_interval 20s
retry_limit 10
retry_wait 5s
max_retry_wait 5m
</match>
<match oms.containerinsights.KubeEvents**>
type out_oms
log_level debug
num_threads 2
buffer_chunk_limit 4m
buffer_type file
buffer_path %STATE_DIR_WS%/out_oms_kubeevents*.buffer
buffer_queue_limit 20
buffer_queue_full_action drop_oldest_chunk
Expand Down Expand Up @@ -194,7 +214,7 @@ data:
<match oms.containerinsights.KubeNodeInventory**>
type out_oms
log_level debug
num_threads 5
num_threads 2
buffer_chunk_limit 4m
buffer_type file
buffer_path %STATE_DIR_WS%/state/out_oms_kubenodes*.buffer
Expand Down Expand Up @@ -223,7 +243,7 @@ data:
<match oms.api.KubePerf**>
type out_oms
log_level debug
num_threads 5
num_threads 2
buffer_chunk_limit 4m
buffer_type file
buffer_path %STATE_DIR_WS%/out_oms_kubeperf*.buffer
Expand Down Expand Up @@ -282,35 +302,35 @@ data:
retry_mdm_post_wait_minutes 30
</match>
<match kubehealth.Signals**>
type out_oms
log_level debug
num_threads 5
buffer_chunk_limit 4m
buffer_type file
buffer_path %STATE_DIR_WS%/out_oms_kubehealth*.buffer
buffer_queue_limit 20
buffer_queue_full_action drop_oldest_chunk
flush_interval 20s
retry_limit 10
retry_wait 5s
max_retry_wait 5m
</match>
<match kubehealth.Signals**>
type out_oms
log_level debug
num_threads 5
buffer_chunk_limit 4m
buffer_type file
buffer_path %STATE_DIR_WS%/out_oms_kubehealth*.buffer
buffer_queue_limit 20
buffer_queue_full_action drop_oldest_chunk
flush_interval 20s
retry_limit 10
retry_wait 5s
max_retry_wait 5m
</match>
<match oms.api.InsightsMetrics**>
type out_oms
log_level debug
num_threads 5
buffer_chunk_limit 4m
buffer_type file
buffer_path %STATE_DIR_WS%/out_oms_insightsmetrics*.buffer
buffer_queue_limit 20
buffer_queue_full_action drop_oldest_chunk
flush_interval 20s
retry_limit 10
retry_wait 5s
max_retry_wait 5m
</match>
<match oms.api.InsightsMetrics**>
type out_oms
log_level debug
num_threads 5
buffer_chunk_limit 4m
buffer_type file
buffer_path %STATE_DIR_WS%/out_oms_insightsmetrics*.buffer
buffer_queue_limit 20
buffer_queue_full_action drop_oldest_chunk
flush_interval 20s
retry_limit 10
retry_wait 5s
max_retry_wait 5m
</match>
metadata:
name: omsagent-rs-config
namespace: kube-system
Expand Down Expand Up @@ -345,6 +365,10 @@ spec:
spec:
priorityClassName: system-node-critical
serviceAccountName: omsagent
dnsConfig:
options:
- name: ndots
value: "3"
containers:
- name: omsagent
image: {{ContainerImage "omsagent"}}
Expand Down Expand Up @@ -508,11 +532,11 @@ spec:
imagePullPolicy: IfNotPresent
resources:
limits:
cpu: {{ContainerCPULimits "omsagent"}}
memory: {{ContainerMemLimits "omsagent"}}
cpu: {{ContainerCPULimits "omsagent-rs"}}
memory: {{ContainerMemLimits "omsagent-rs"}}
requests:
cpu: {{ContainerCPUReqs "omsagent"}}
memory: {{ContainerMemReqs "omsagent"}}
cpu: {{ContainerCPUReqs "omsagent-rs"}}
memory: {{ContainerMemReqs "omsagent-rs"}}
env:
- name: NODE_IP
valueFrom:
Expand Down Expand Up @@ -565,6 +589,15 @@ spec:
periodSeconds: 60
affinity:
nodeAffinity:
# affinity to schedule on to ephemeral os node if its available
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: storageprofile
operator: NotIn
values:
- managed
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- labelSelector:
Expand Down Expand Up @@ -642,6 +675,10 @@ spec:
schema-versions: {{ContainerConfig "schema-versions"}}
spec:
serviceAccountName: omsagent
dnsConfig:
options:
- name: ndots
value: "3"
containers:
- name: omsagent-win
image: {{ContainerImage "omsagent-win"}}
Expand Down
24 changes: 16 additions & 8 deletions pkg/api/addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ func (cs *ContainerService) setAddonsConfig(isUpgrade bool) {
kubernetesImageBase = o.KubernetesConfig.KubernetesImageBase
}
k8sComponents := GetK8sComponentsByVersionMap(o.KubernetesConfig)[o.OrchestratorVersion]
omsagentImage := "mcr.microsoft.com/azuremonitor/containerinsights/ciprod:ciprod10052020"
omsagentWinImage := "mcr.microsoft.com/azuremonitor/containerinsights/ciprod:win-ciprod10052020"
omsagentImage := "mcr.microsoft.com/azuremonitor/containerinsights/ciprod:ciprod02232021"
omsagentWinImage := "mcr.microsoft.com/azuremonitor/containerinsights/ciprod:win-ciprod02232021"
var workspaceDomain string
if cs.Properties.IsCustomCloudProfile() {
dependenciesLocation := string(cs.Properties.CustomCloudProfile.DependenciesLocation)
workspaceDomain = helpers.GetLogAnalyticsWorkspaceDomain(dependenciesLocation)
if strings.EqualFold(dependenciesLocation, "china") {
omsagentImage = "mcr.azk8s.cn/azuremonitor/containerinsights/ciprod:ciprod10052020"
omsagentWinImage = "mcr.azk8s.cn/azuremonitor/containerinsights/ciprod:win-ciprod10052020"
omsagentImage = "mcr.azk8s.cn/azuremonitor/containerinsights/ciprod:ciprod02232021"
omsagentWinImage = "mcr.azk8s.cn/azuremonitor/containerinsights/ciprod:win-ciprod02232021"
}
} else {
workspaceDomain = helpers.GetLogAnalyticsWorkspaceDomain(cloudSpecConfig.CloudName)
if strings.EqualFold(cloudSpecConfig.CloudName, "AzureChinaCloud") {
omsagentImage = "mcr.azk8s.cn/azuremonitor/containerinsights/ciprod:ciprod10052020"
omsagentWinImage = "mcr.azk8s.cn/azuremonitor/containerinsights/ciprod:win-ciprod10052020"
omsagentImage = "mcr.azk8s.cn/azuremonitor/containerinsights/ciprod:ciprod02232021"
omsagentWinImage = "mcr.azk8s.cn/azuremonitor/containerinsights/ciprod:win-ciprod02232021"
}
}
workspaceDomain = base64.StdEncoding.EncodeToString([]byte(workspaceDomain))
Expand Down Expand Up @@ -230,18 +230,26 @@ func (cs *ContainerService) setAddonsConfig(isUpgrade bool) {
Enabled: to.BoolPtr(DefaultContainerMonitoringAddonEnabled && !cs.Properties.IsAzureStackCloud()),
Config: map[string]string{
"omsAgentVersion": "1.10.0.1",
"dockerProviderVersion": "10.0.0-1",
"dockerProviderVersion": "13.0.0-0",
"schema-versions": "v1",
"clusterName": clusterDNSPrefix,
"workspaceDomain": workspaceDomain,
},
Containers: []KubernetesContainerSpec{
{
Name: "omsagent",
CPURequests: "75m",
MemoryRequests: "225Mi",
CPULimits: "500m",
MemoryLimits: "600Mi",
Image: omsagentImage,
},
{
Name: "omsagent-rs",
CPURequests: "150m",
MemoryRequests: "250Mi",
CPULimits: "1",
MemoryLimits: "750Mi",
MemoryLimits: "1Gi",
Image: omsagentImage,
},
{
Expand Down
16 changes: 12 additions & 4 deletions pkg/api/addons_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1471,25 +1471,33 @@ func TestSetAddonsConfig(t *testing.T) {
Enabled: to.BoolPtr(true),
Config: map[string]string{
"omsAgentVersion": "1.10.0.1",
"dockerProviderVersion": "10.0.0-1",
"dockerProviderVersion": "13.0.0-0",
"schema-versions": "v1",
"clusterName": "aks-engine-cluster",
"workspaceDomain": "b3BpbnNpZ2h0cy5henVyZS5jb20=",
},
Containers: []KubernetesContainerSpec{
{
Name: "omsagent",
CPURequests: "75m",
MemoryRequests: "225Mi",
CPULimits: "500m",
MemoryLimits: "600Mi",
Image: "mcr.microsoft.com/azuremonitor/containerinsights/ciprod:ciprod02232021",
},
{
Name: "omsagent-rs",
CPURequests: "150m",
MemoryRequests: "250Mi",
CPULimits: "1",
MemoryLimits: "750Mi",
Image: "mcr.microsoft.com/azuremonitor/containerinsights/ciprod:ciprod10052020",
MemoryLimits: "1Gi",
Image: "mcr.microsoft.com/azuremonitor/containerinsights/ciprod:ciprod02232021",
},
{
Name: "omsagent-win",
CPULimits: "200m",
MemoryLimits: "600Mi",
Image: "mcr.microsoft.com/azuremonitor/containerinsights/ciprod:win-ciprod10052020",
Image: "mcr.microsoft.com/azuremonitor/containerinsights/ciprod:win-ciprod02232021",
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func TestAssignDefaultAddonImages(t *testing.T) {
common.DashboardAddonName: k8sComponents[common.DashboardAddonName],
common.MetricsServerAddonName: specConfig.MCRKubernetesImageBase + k8sComponents[common.MetricsServerAddonName],
common.NVIDIADevicePluginAddonName: specConfig.NVIDIAImageBase + k8sComponents[common.NVIDIADevicePluginAddonName],
common.ContainerMonitoringAddonName: "mcr.microsoft.com/azuremonitor/containerinsights/ciprod:ciprod10052020",
common.ContainerMonitoringAddonName: "mcr.microsoft.com/azuremonitor/containerinsights/ciprod:ciprod02232021",
common.IPMASQAgentAddonName: specConfig.MCRKubernetesImageBase + k8sComponents[common.IPMASQAgentAddonName],
common.AzureCNINetworkMonitorAddonName: specConfig.AzureCNIImageBase + k8sComponents[common.AzureCNINetworkMonitorAddonName],
common.CalicoAddonName: specConfig.CalicoImageBase + k8sComponents[common.CalicoTyphaComponentName],
Expand Down
Loading

0 comments on commit 807e75d

Please sign in to comment.