diff --git a/parts/k8s/addons/omsagent-daemonset.yaml b/parts/k8s/addons/omsagent-daemonset.yaml index f593c9398b..48e94e1f0a 100644 --- a/parts/k8s/addons/omsagent-daemonset.yaml +++ b/parts/k8s/addons/omsagent-daemonset.yaml @@ -3,11 +3,17 @@ kind: ServiceAccount metadata: name: omsagent namespace: kube-system + labels: + kubernetes.io/cluster-service: "true" + addonmanager.kubernetes.io/mode: Reconcile --- kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1beta1 metadata: name: omsagent-reader + labels: + kubernetes.io/cluster-service: "true" + addonmanager.kubernetes.io/mode: Reconcile rules: - apiGroups: [""] resources: ["pods", "events", "nodes", "namespaces", "services"] @@ -17,6 +23,9 @@ kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1beta1 metadata: name: omsagentclusterrolebinding + labels: + kubernetes.io/cluster-service: "true" + addonmanager.kubernetes.io/mode: Reconcile subjects: - kind: ServiceAccount name: omsagent @@ -26,86 +35,233 @@ roleRef: name: omsagent-reader apiGroup: rbac.authorization.k8s.io --- +kind: ConfigMap +apiVersion: v1 +data: + kube.conf: "# Fluentd config file for OMS Docker - cluster components (kubeAPI)\r\n\r\n#Kubernetes + pod inventory\r\n\r\n\ttype kubepodinventory\r\n\ttag oms.containerinsights.KubePodInventory\r\n\trun_interval + 60s\r\n log_level debug\r\n\r\n\r\n#Kubernetes events\r\n\r\n\ttype + kubeevents\r\n\ttag oms.api.KubeEvents.CollectionTime\r\n\trun_interval 60s\r\n + \ log_level debug\r\n\r\n\r\n#Kubernetes logs\r\n\r\n\ttype kubelogs\r\n\ttag + oms.api.KubeLogs\r\n\trun_interval 60s\r\n\r\n\r\n#Kubernetes services\r\n\r\n\ttype + kubeservices\r\n\ttag oms.api.KubeServices.CollectionTime\r\n\trun_interval 60s\r\n + \ log_level debug\r\n\r\n\r\n#Kubernetes Nodes\r\n\r\n\ttype + kubenodeinventory\r\n\ttag oms.containerinsights.KubeNodeInventory\r\n\trun_interval + 60s\r\n log_level debug\r\n\r\n\r\n#Kubernetes perf\r\n\r\n\ttype + kubeperf\r\n\ttag oms.api.KubePerf\r\n\trun_interval 60s\r\n log_level debug\r\n\r\n\r\n\r\n type out_oms\r\n log_level debug\r\n + \ num_threads 5\r\n buffer_chunk_limit 20m\r\n buffer_type file\r\n buffer_path + %STATE_DIR_WS%/out_oms_kubepods*.buffer\r\n buffer_queue_limit 20\r\n buffer_queue_full_action + drop_oldest_chunk\r\n flush_interval 20s\r\n retry_limit 10\r\n retry_wait + 30s\r\n max_retry_wait 9m\r\n\r\n\r\n\r\n\ttype + out_oms_api\r\n\tlog_level debug\r\n num_threads 5\r\n\tbuffer_chunk_limit 5m\r\n\tbuffer_type + file\r\n\tbuffer_path %STATE_DIR_WS%/out_oms_api_kubeevents*.buffer\r\n\tbuffer_queue_limit + 10\r\n buffer_queue_full_action drop_oldest_chunk\r\n\tflush_interval 20s\r\n\tretry_limit + 10\r\n\tretry_wait 30s\r\n\r\n\r\n\r\n\ttype + out_oms_api\r\n\tlog_level debug\r\n buffer_chunk_limit 10m\r\n\tbuffer_type + file\r\n\tbuffer_path %STATE_DIR_WS%/out_oms_api_kubernetes_logs*.buffer\r\n\tbuffer_queue_limit + 10\r\n\tflush_interval 20s\r\n\tretry_limit 10\r\n\tretry_wait 30s\r\n\r\n\r\n\t \r\n type out_oms_api\r\n log_level debug\r\n num_threads + 5\r\n buffer_chunk_limit 20m\r\n buffer_type file\r\n buffer_path %STATE_DIR_WS%/out_oms_kubeservices*.buffer\r\n + \ buffer_queue_limit 20\r\n buffer_queue_full_action drop_oldest_chunk\r\n flush_interval + 20s\r\n retry_limit 10\r\n retry_wait 30s\r\n max_retry_wait 9m\r\n\r\n\r\n\r\n type out_oms\r\n log_level debug\r\n + \ num_threads 5\r\n buffer_chunk_limit 20m\r\n buffer_type file\r\n buffer_path + %STATE_DIR_WS%/state/out_oms_kubenodes*.buffer\r\n buffer_queue_limit 20\r\n + \ buffer_queue_full_action drop_oldest_chunk\r\n flush_interval 20s\r\n retry_limit + 10\r\n retry_wait 30s\r\n max_retry_wait 9m\r\n\r\n\r\n\t\r\n + \ type out_oms\r\n log_level debug\r\n num_threads 5\r\n buffer_chunk_limit + 20m\r\n buffer_type file\r\n buffer_path %STATE_DIR_WS%/out_oms_kubeperf*.buffer\r\n + \ buffer_queue_limit 20\r\n buffer_queue_full_action drop_oldest_chunk\r\n flush_interval + 20s\r\n retry_limit 10\r\n retry_wait 30s\r\n max_retry_wait 9m\r\n\r\n" +metadata: + name: omsagent-rs-config + namespace: kube-system + labels: + kubernetes.io/cluster-service: "true" + addonmanager.kubernetes.io/mode: Reconcile +--- apiVersion: extensions/v1beta1 kind: DaemonSet metadata: - name: omsagent - namespace: kube-system + labels: + component: oms-agent + tier: node + kubernetes.io/cluster-service: "true" + addonmanager.kubernetes.io/mode: Reconcile + name: omsagent + namespace: kube-system spec: - updateStrategy: - type: RollingUpdate - template: - metadata: - labels: - app: omsagent - agentVersion: - dockerProviderVersion: - spec: - serviceAccountName: omsagent - containers: - - name: omsagent - image: - imagePullPolicy: IfNotPresent + selector: + matchLabels: + component: oms-agent + tier: node + template: + metadata: + annotations: + agentVersion: + dockerProviderVersion: + labels: + component: oms-agent + tier: node + spec: + serviceAccountName: omsagent + containers: + - name: omsagent + image: + imagePullPolicy: Always + resources: + requests: + cpu: + memory: + limits: + cpu: + memory: env: - - name: ACS_RESOURCE_NAME - value: "my_acs_cluster_name" - - name: DISABLE_KUBE_SYSTEM_LOG_COLLECTION - value: "true" - - name: WSID - value: - - name: KEY - value: - - name: NODE_IP - valueFrom: - fieldRef: - fieldPath: status.hostIP - securityContext: - privileged: true - ports: - - containerPort: 25225 - protocol: TCP - - containerPort: 25224 - protocol: UDP - volumeMounts: - - mountPath: /var/run/docker.sock - name: docker-sock - - mountPath: /var/log - name: host-log - - mountPath: /var/lib/docker/containers - name: containerlog-path + - name: ACS_RESOURCE_NAME + value: "my_acs_cluster_name" + - name: DISABLE_KUBE_SYSTEM_LOG_COLLECTION + value: "true" + - name: WSID + value: + - name: KEY + value: + - name: NODE_IP + valueFrom: + fieldRef: + fieldPath: status.hostIP livenessProbe: exec: command: - - /bin/bash - - -c - - ps -ef | grep omsagent | grep -v "grep" + - /bin/bash + - -c + - ps -ef | grep omsagent | grep -v "grep" initialDelaySeconds: 60 periodSeconds: 60 - resources: - requests: - cpu: - memory: - limits: - cpu: - memory: - nodeSelector: - beta.kubernetes.io/os: linux + ports: + - containerPort: 25225 + protocol: TCP + - containerPort: 25224 + protocol: UDP + securityContext: + privileged: true + volumeMounts: + - mountPath: /var/run/docker.sock + name: docker-sock + - mountPath: /var/log + name: host-log + - mountPath: /var/lib/docker/containers + name: containerlog-path + nodeSelector: + beta.kubernetes.io/os: linux # Tolerate a NoSchedule taint on master that ACS Engine sets. - tolerations: - - key: "node-role.kubernetes.io/master" - operator: "Equal" - value: "true" - effect: "NoSchedule" - volumes: - - name: docker-sock - hostPath: - path: /var/run/docker.sock - - name: container-hostname - hostPath: - path: /etc/hostname - - name: host-log - hostPath: - path: /var/log - - name: containerlog-path - hostPath: - path: /var/lib/docker/containers \ No newline at end of file + tolerations: + - key: "node-role.kubernetes.io/master" + operator: "Equal" + value: "true" + effect: "NoSchedule" + volumes: + - name: docker-sock + hostPath: + path: /var/run/docker.sock + - name: container-hostname + hostPath: + path: /etc/hostname + - name: host-log + hostPath: + path: /var/log + - name: containerlog-path + hostPath: + path: /var/lib/docker/containers + updateStrategy: + type: RollingUpdate +--- +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: omsagent-rs + namespace: kube-system + labels: + component: oms-agent + tier: node + kubernetes.io/cluster-service: "true" + addonmanager.kubernetes.io/mode: Reconcile + spec: + replicas: 1 + selector: + matchLabels: + rsName: "omsagent-rs" + strategy: + type: RollingUpdate + template: + metadata: + labels: + rsName: "omsagent-rs" + annotations: + agentVersion: + dockerProviderVersion: + spec: + serviceAccountName: omsagent + containers: + - name: omsagent + image: + imagePullPolicy: IfNotPresent + resources: + limits: + cpu: + memory: + requests: + cpu: + memory: + env: + - name: NODE_IP + valueFrom: + fieldRef: + fieldPath: status.hostIP + - name: AKS_CLUSTER_NAME + value: my_aks_cluster + - name: DISABLE_KUBE_SYSTEM_LOG_COLLECTION + value: "true" + securityContext: + privileged: true + ports: + - containerPort: 25225 + protocol: TCP + - containerPort: 25224 + protocol: UDP + volumeMounts: + - mountPath: /var/run/docker.sock + name: docker-sock + - mountPath: /var/log + name: host-log + - mountPath: /var/lib/docker/containers + name: containerlog-path + - mountPath : /etc/config + name: omsagent-rs-config + livenessProbe: + exec: + command: + - /bin/bash + - -c + - ps -ef | grep omsagent | grep -v "grep" + initialDelaySeconds: 60 + periodSeconds: 60 + nodeSelector: + beta.kubernetes.io/os: linux + kubernetes.io/role: agent + volumes: + - name: docker-sock + hostPath: + path: /var/run/docker.sock + - name: container-hostname + hostPath: + path: /etc/hostname + - name: host-log + hostPath: + path: /var/log + - name: containerlog-path + hostPath: + path: /var/lib/docker/containers + - name: omsagent-rs-config + configMap: + name: omsagent-rs-config \ No newline at end of file diff --git a/pkg/acsengine/defaults.go b/pkg/acsengine/defaults.go index 9493ccd93e..95af970a36 100644 --- a/pkg/acsengine/defaults.go +++ b/pkg/acsengine/defaults.go @@ -321,16 +321,16 @@ var ( Enabled: helpers.PointerToBool(api.DefaultContainerMonitoringAddonEnabled), Config: map[string]string{ "omsAgentVersion": "1.6.0-42", - "dockerProviderVersion": "2.0.0-2", + "dockerProviderVersion": "2.0.0-3", }, Containers: []api.KubernetesContainerSpec{ { Name: "omsagent", - Image: "dockerio.azureedge.net/microsoft/oms:ciprod05082018", + Image: "dockerio.azureedge.net/microsoft/oms:ciprod06072018", CPURequests: "50m", - MemoryRequests: "150Mi", - CPULimits: "50m", - MemoryLimits: "150Mi", + MemoryRequests: "100Mi", + CPULimits: "150m", + MemoryLimits: "500Mi", }, }, }