scripts/preview/health/omsagent-template-aks-engine.yaml [1:328]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
apiVersion: v1
kind: ServiceAccount
metadata:
  name: omsagent
  namespace: kube-system
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: omsagent-reader
rules:
  - apiGroups: [""]
    resources: ["pods", "events", "nodes", "namespaces", "services"]
    verbs: ["list", "get", "watch"]
  - apiGroups: ["extensions"]
    resources: ["deployments"]
    verbs: ["list"]
  - nonResourceURLs: ["/metrics"]
    verbs: ["get"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: omsagentclusterrolebinding
subjects:
  - kind: ServiceAccount
    name: omsagent
    namespace: kube-system
roleRef:
  kind: ClusterRole
  name: omsagent-reader
  apiGroup: rbac.authorization.k8s.io
---
kind: ConfigMap
apiVersion: v1
data:
  kube.conf: |-
    # Fluentd config file for OMS Docker - cluster components (kubeAPI)
    #fluent forward plugin
    <source>
     type forward
     port 25235
     bind 0.0.0.0
    </source>

    #Kubernetes pod inventory
    <source>
     type kubepodinventory
     tag oms.containerinsights.KubePodInventory
     run_interval 60s
     log_level debug
    </source>

    #Kubernetes events
    <source>
     type kubeevents
     tag oms.containerinsights.KubeEvents
     run_interval 60s
     log_level debug
     </source>

    #Kubernetes logs
    <source>
     type kubelogs
     tag oms.api.KubeLogs
     run_interval 60s
    </source>

    #Kubernetes services
    <source>
     type kubeservices
     tag oms.containerinsights.KubeServices
     run_interval 60s
     log_level debug
    </source>

    #Kubernetes Nodes
    <source>
     type kubenodeinventory
     tag oms.containerinsights.KubeNodeInventory
     run_interval 60s
     log_level debug
    </source>

    #Kubernetes perf
    <source>
     type kubeperf
     tag oms.api.KubePerf
     run_interval 60s
     log_level debug
    </source>

    #Kubernetes health
    <source>
     type kubehealth
     tag kubehealth.ReplicaSet
     run_interval 60s
     log_level debug
    </source>

    #cadvisor perf- Windows nodes
    <source>
     type wincadvisorperf
     tag oms.api.wincadvisorperf
     run_interval 60s
     log_level debug
    </source>

    <filter mdm.kubepodinventory** mdm.kubenodeinventory**>
     type filter_inventory2mdm
     log_level info
    </filter>

    # custom_metrics_mdm filter plugin for perf data from windows nodes
    <filter mdm.cadvisorperf**>
     type filter_cadvisor2mdm
     metrics_to_collect cpuUsageNanoCores,memoryWorkingSetBytes
     log_level info
    </filter>
    #health model aggregation filter
    <filter kubehealth**>
     type filter_health_model_builder
    </filter>

    <match oms.containerinsights.KubePodInventory**>
     type out_oms
     log_level debug
     num_threads 5
     buffer_chunk_limit 20m
     buffer_type file
     buffer_path %STATE_DIR_WS%/out_oms_kubepods*.buffer
     buffer_queue_limit 20
     buffer_queue_full_action drop_oldest_chunk
     flush_interval 20s
     retry_limit 10
     retry_wait 30s
     max_retry_wait 9m
    </match>

    <match oms.containerinsights.KubeEvents**>
     type out_oms
     log_level debug
     num_threads 5
     buffer_chunk_limit 5m
     buffer_type file
     buffer_path %STATE_DIR_WS%/out_oms_kubeevents*.buffer
     buffer_queue_limit 10
     buffer_queue_full_action drop_oldest_chunk
     flush_interval 20s
     retry_limit 10
     retry_wait 30s
     max_retry_wait 9m
    </match>

    <match oms.api.KubeLogs**>
     type out_oms_api
     log_level debug
     buffer_chunk_limit 10m
     buffer_type file
     buffer_path %STATE_DIR_WS%/out_oms_api_kubernetes_logs*.buffer
     buffer_queue_limit 10
     flush_interval 20s
     retry_limit 10
     retry_wait 30s
    </match>

    <match oms.containerinsights.KubeServices**>
     type out_oms
     log_level debug
     num_threads 5
     buffer_chunk_limit 20m
     buffer_type file
     buffer_path %STATE_DIR_WS%/out_oms_kubeservices*.buffer
     buffer_queue_limit 20
     buffer_queue_full_action drop_oldest_chunk
     flush_interval 20s
     retry_limit 10
     retry_wait 30s
     max_retry_wait 9m
    </match>

    <match oms.containerinsights.KubeNodeInventory**>
     type out_oms
     log_level debug
     num_threads 5
     buffer_chunk_limit 20m
     buffer_type file
     buffer_path %STATE_DIR_WS%/state/out_oms_kubenodes*.buffer
     buffer_queue_limit 20
     buffer_queue_full_action drop_oldest_chunk
     flush_interval 20s
     retry_limit 10
     retry_wait 30s
     max_retry_wait 9m
    </match>

    <match oms.containerinsights.ContainerNodeInventory**>
     type out_oms
     log_level debug
     buffer_chunk_limit 20m
     buffer_type file
     buffer_path %STATE_DIR_WS%/out_oms_containernodeinventory*.buffer
     buffer_queue_limit 20
     flush_interval 20s
     retry_limit 10
     retry_wait 15s
     max_retry_wait 9m
    </match>

    <match oms.api.KubePerf**>
     type out_oms
     log_level debug
     num_threads 5
     buffer_chunk_limit 20m
     buffer_type file
     buffer_path %STATE_DIR_WS%/out_oms_kubeperf*.buffer
     buffer_queue_limit 20
     buffer_queue_full_action drop_oldest_chunk
     flush_interval 20s
     retry_limit 10
     retry_wait 30s
     max_retry_wait 9m
    </match>

    <match mdm.kubepodinventory** mdm.kubenodeinventory** >
     type out_mdm
     log_level debug
     num_threads 5
     buffer_chunk_limit 20m
     buffer_type file
     buffer_path %STATE_DIR_WS%/out_mdm_*.buffer
     buffer_queue_limit 20
     buffer_queue_full_action drop_oldest_chunk
     flush_interval 20s
     retry_limit 10
     retry_wait 30s
     max_retry_wait 9m
     retry_mdm_post_wait_minutes 60
    </match>

    <match oms.api.wincadvisorperf**>
     type out_oms
     log_level debug
     num_threads 5
     buffer_chunk_limit 20m
     buffer_type file
     buffer_path %STATE_DIR_WS%/out_oms_api_wincadvisorperf*.buffer
     buffer_queue_limit 20
     buffer_queue_full_action drop_oldest_chunk
     flush_interval 20s
     retry_limit 10
     retry_wait 30s
     max_retry_wait 9m
    </match>

    <match mdm.cadvisorperf**>
     type out_mdm
     log_level debug
     num_threads 5
     buffer_chunk_limit 20m
     buffer_type file
     buffer_path %STATE_DIR_WS%/out_mdm_cdvisorperf*.buffer
     buffer_queue_limit 20
     buffer_queue_full_action drop_oldest_chunk
     flush_interval 20s
     retry_limit 10
     retry_wait 30s
     max_retry_wait 9m
     retry_mdm_post_wait_minutes 60
    </match>

    <match oms.api.KubeHealth.AgentCollectionTime**>
     type out_oms_api
     log_level debug
     buffer_chunk_limit 10m
     buffer_type file
     buffer_path %STATE_DIR_WS%/out_oms_api_kubehealth*.buffer
     buffer_queue_limit 10
     flush_interval 20s
     retry_limit 10
     retry_wait 30s
    </match>
metadata:
  name: omsagent-rs-config
  namespace: kube-system
---
apiVersion: v1
kind: Secret
metadata:
  name: omsagent-secret
  namespace: kube-system
type: Opaque
data:
  #BASE64 ENCODED (Both WSID & KEY) INSIDE DOUBLE QUOTE ("")
  WSID: "VALUE_WSID"
  KEY: "VALUE_KEY"
---
kind: Service
apiVersion: v1
metadata:
  name: replicaset-service
  namespace: kube-system
spec:
  selector:
    rsName: "omsagent-rs"
  ports:
    - protocol: TCP
      port: 25235
      targetPort: in-rs-tcp
---
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: azurefile
provisioner: kubernetes.io/azure-file
mountOptions:
  - dir_mode=0777
  - file_mode=0777
  - uid=1000
  - gid=1000
parameters:
  skuName: Standard_LRS
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: system:azure-cloud-provider
rules:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



scripts/preview/health/omsagent-template.yaml [1:328]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
apiVersion: v1
kind: ServiceAccount
metadata:
  name: omsagent
  namespace: kube-system
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: omsagent-reader
rules:
- apiGroups: [""]
  resources: ["pods", "events", "nodes", "namespaces", "services"]
  verbs: ["list", "get", "watch"]
- apiGroups: ["extensions"]
  resources: ["deployments"]
  verbs: ["list"]
- nonResourceURLs: ["/metrics"]
  verbs: ["get"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: omsagentclusterrolebinding
subjects:
  - kind: ServiceAccount
    name: omsagent
    namespace: kube-system
roleRef:
  kind: ClusterRole
  name: omsagent-reader
  apiGroup: rbac.authorization.k8s.io
---
kind: ConfigMap
apiVersion: v1
data:
  kube.conf: |-
     # Fluentd config file for OMS Docker - cluster components (kubeAPI)
     #fluent forward plugin
     <source>
      type forward
      port 25235
      bind 0.0.0.0
     </source>

     #Kubernetes pod inventory
     <source>
      type kubepodinventory
      tag oms.containerinsights.KubePodInventory
      run_interval 60s
      log_level debug
     </source>

     #Kubernetes events
     <source>
      type kubeevents
      tag oms.containerinsights.KubeEvents
      run_interval 60s
      log_level debug
      </source>

     #Kubernetes logs
     <source>
      type kubelogs
      tag oms.api.KubeLogs
      run_interval 60s
     </source>

     #Kubernetes services
     <source>
      type kubeservices
      tag oms.containerinsights.KubeServices
      run_interval 60s
      log_level debug
     </source>

     #Kubernetes Nodes
     <source>
      type kubenodeinventory
      tag oms.containerinsights.KubeNodeInventory
      run_interval 60s
      log_level debug
     </source>

     #Kubernetes perf
     <source>
      type kubeperf
      tag oms.api.KubePerf
      run_interval 60s
      log_level debug
     </source>

     #Kubernetes health
     <source>
      type kubehealth
      tag kubehealth.ReplicaSet
      run_interval 60s
      log_level debug
     </source>

     #cadvisor perf- Windows nodes
     <source>
      type wincadvisorperf
      tag oms.api.wincadvisorperf
      run_interval 60s
      log_level debug
     </source>

     <filter mdm.kubepodinventory** mdm.kubenodeinventory**>
      type filter_inventory2mdm
      log_level info
     </filter>

     # custom_metrics_mdm filter plugin for perf data from windows nodes
     <filter mdm.cadvisorperf**>
      type filter_cadvisor2mdm
      metrics_to_collect cpuUsageNanoCores,memoryWorkingSetBytes
      log_level info
     </filter>
     #health model aggregation filter
     <filter kubehealth**>
      type filter_health_model_builder
     </filter>

     <match oms.containerinsights.KubePodInventory**>
      type out_oms
      log_level debug
      num_threads 5
      buffer_chunk_limit 20m
      buffer_type file
      buffer_path %STATE_DIR_WS%/out_oms_kubepods*.buffer
      buffer_queue_limit 20
      buffer_queue_full_action drop_oldest_chunk
      flush_interval 20s
      retry_limit 10
      retry_wait 30s
      max_retry_wait 9m
     </match>

     <match oms.containerinsights.KubeEvents**>
      type out_oms
      log_level debug
      num_threads 5
      buffer_chunk_limit 5m
      buffer_type file
      buffer_path %STATE_DIR_WS%/out_oms_kubeevents*.buffer
      buffer_queue_limit 10
      buffer_queue_full_action drop_oldest_chunk
      flush_interval 20s
      retry_limit 10
      retry_wait 30s
      max_retry_wait 9m
     </match>

     <match oms.api.KubeLogs**>
      type out_oms_api
      log_level debug
      buffer_chunk_limit 10m
      buffer_type file
      buffer_path %STATE_DIR_WS%/out_oms_api_kubernetes_logs*.buffer
      buffer_queue_limit 10
      flush_interval 20s
      retry_limit 10
      retry_wait 30s
     </match>

     <match oms.containerinsights.KubeServices**>
      type out_oms
      log_level debug
      num_threads 5
      buffer_chunk_limit 20m
      buffer_type file
      buffer_path %STATE_DIR_WS%/out_oms_kubeservices*.buffer
      buffer_queue_limit 20
      buffer_queue_full_action drop_oldest_chunk
      flush_interval 20s
      retry_limit 10
      retry_wait 30s
      max_retry_wait 9m
     </match>

     <match oms.containerinsights.KubeNodeInventory**>
      type out_oms
      log_level debug
      num_threads 5
      buffer_chunk_limit 20m
      buffer_type file
      buffer_path %STATE_DIR_WS%/state/out_oms_kubenodes*.buffer
      buffer_queue_limit 20
      buffer_queue_full_action drop_oldest_chunk
      flush_interval 20s
      retry_limit 10
      retry_wait 30s
      max_retry_wait 9m
     </match>

     <match oms.containerinsights.ContainerNodeInventory**>
      type out_oms
      log_level debug
      buffer_chunk_limit 20m
      buffer_type file
      buffer_path %STATE_DIR_WS%/out_oms_containernodeinventory*.buffer
      buffer_queue_limit 20
      flush_interval 20s
      retry_limit 10
      retry_wait 15s
      max_retry_wait 9m
     </match>

     <match oms.api.KubePerf**>
      type out_oms
      log_level debug
      num_threads 5
      buffer_chunk_limit 20m
      buffer_type file
      buffer_path %STATE_DIR_WS%/out_oms_kubeperf*.buffer
      buffer_queue_limit 20
      buffer_queue_full_action drop_oldest_chunk
      flush_interval 20s
      retry_limit 10
      retry_wait 30s
      max_retry_wait 9m
     </match>

     <match mdm.kubepodinventory** mdm.kubenodeinventory** >
      type out_mdm
      log_level debug
      num_threads 5
      buffer_chunk_limit 20m
      buffer_type file
      buffer_path %STATE_DIR_WS%/out_mdm_*.buffer
      buffer_queue_limit 20
      buffer_queue_full_action drop_oldest_chunk
      flush_interval 20s
      retry_limit 10
      retry_wait 30s
      max_retry_wait 9m
      retry_mdm_post_wait_minutes 60
     </match>

     <match oms.api.wincadvisorperf**>
      type out_oms
      log_level debug
      num_threads 5
      buffer_chunk_limit 20m
      buffer_type file
      buffer_path %STATE_DIR_WS%/out_oms_api_wincadvisorperf*.buffer
      buffer_queue_limit 20
      buffer_queue_full_action drop_oldest_chunk
      flush_interval 20s
      retry_limit 10
      retry_wait 30s
      max_retry_wait 9m
     </match>

     <match mdm.cadvisorperf**>
      type out_mdm
      log_level debug
      num_threads 5
      buffer_chunk_limit 20m
      buffer_type file
      buffer_path %STATE_DIR_WS%/out_mdm_cdvisorperf*.buffer
      buffer_queue_limit 20
      buffer_queue_full_action drop_oldest_chunk
      flush_interval 20s
      retry_limit 10
      retry_wait 30s
      max_retry_wait 9m
      retry_mdm_post_wait_minutes 60
     </match>

     <match oms.api.KubeHealth.AgentCollectionTime**>
      type out_oms_api
      log_level debug
      buffer_chunk_limit 10m
      buffer_type file
      buffer_path %STATE_DIR_WS%/out_oms_api_kubehealth*.buffer
      buffer_queue_limit 10
      flush_interval 20s
      retry_limit 10
      retry_wait 30s
     </match>
metadata:
  name: omsagent-rs-config
  namespace: kube-system
---
apiVersion: v1
kind: Secret
metadata:
 name: omsagent-secret
 namespace: kube-system
type: Opaque
data:
  #BASE64 ENCODED (Both WSID & KEY) INSIDE DOUBLE QUOTE ("")
  WSID: "VALUE_WSID"
  KEY: "VALUE_KEY"
---
kind: Service
apiVersion: v1
metadata:
  name: replicaset-service
  namespace: kube-system
spec:
  selector:
    rsName: "omsagent-rs"
  ports:
  - protocol: TCP
    port: 25235
    targetPort: in-rs-tcp
---
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: azurefile
provisioner: kubernetes.io/azure-file
mountOptions:
  - dir_mode=0777
  - file_mode=0777
  - uid=1000
  - gid=1000
parameters:
  skuName: Standard_LRS
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: system:azure-cloud-provider
rules:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



