Kubernetes (EKS)

Kubernetes (EKS)

  1. Install helm (mac)
    1. https://github.com/helm/helm/releases download desired version
    2. brew install helm
  1. Unzip tar.gz by double click
  1. Open the terminal to authorize the downloaded file
    1. notion image
    2. move this file to /usr/local/bin
    3. mv helm /usr/local/bin/helm
  1. Check if desired helm version was installed (mine was 3.8.2)
    1. The reason I installed 3.8.2 is that the new version 3.10 didn’t match my k8s version.
    2. helm version
  1. Add Datadog repo
    1. helm repo add datadog https://helm.datadoghq.com
  1. Update
    1. If updated successfully, the console prints Update Complete. ⎈Happy Helming!⎈
    2. helm repo update
  1. Add a default YAML file (example below)
    1. YAML
      # Datadog Agent with Logs, APM, Processes, and System Probe enabled targetSystem: "linux" datadog: apiKey: <YOUR_API_KEY> # appKey: <DATADOG_APP_KEY> # If not using secrets, then use apiKey and appKey instead #apiKeyExistingSecret: <DATADOG_API_KEY_SECRET> #appKeyExistingSecret: <DATADOG_APP_KEY_SECRET> # clusterName: <CLUSTER_NAME> clusterName: <YOUR_CLUSTER_NAME> tags: [] # datadog.kubelet.tlsVerify should be `false` on kind and minikube # to establish communication with the kubelet # kubelet: # tlsVerify: "false" logs: enabled: true containerCollectAll: false containerCollectUsingFiles: true apm: portEnabled: true socketPath: /var/run/datadog/apm.socket hostSocketPath: /var/run/datadog/ processAgent: enabled: true processCollection: false systemProbe: enableTCPQueueLength: false enableOOMKill: true collectDNSStats: false
  1. Apply to k8s (suppose yaml filename is datadog-values.yaml)
    1. helm install datadog-agent -f datadog-values.yaml --set datadog.site='datadoghq.com' datadog/datadog
  1. If you changed some settings, upgrade helm.
    1. helm upgrade -f datadog-values.yaml datadog-agent datadog/datadog
    2. This command gives these errors
      1. * set `clusterAgent.replicas` value to `2` replicas . * set `clusterAgent.createPodDisruptionBudget` to `true`.
    3. To fix this, add clusterAgent settings inside the YAML file.
      1. YAML
        targetSystem: "linux" datadog: apiKey: <YOUR_API_KEY> # appKey: <DATADOG_APP_KEY> # If not using secrets, then use apiKey and appKey instead #apiKeyExistingSecret: <DATADOG_API_KEY_SECRET> #appKeyExistingSecret: <DATADOG_APP_KEY_SECRET> # clusterName: <CLUSTER_NAME> clusterName: <YOUR_CLUSTER_NAME> tags: [] # datadog.kubelet.tlsVerify should be `false` on kind and minikube # to establish communication with the kubelet # kubelet: # tlsVerify: "false" logs: enabled: true containerCollectAll: false containerCollectUsingFiles: true apm: portEnabled: true socketPath: /var/run/datadog/apm.socket hostSocketPath: /var/run/datadog/ processAgent: enabled: true processCollection: false systemProbe: enableTCPQueueLength: false enableOOMKill: true collectDNSStats: false clusterAgent: replicas: 2 createPodDisruptionBudget: true
    4. When successfully installed, it prints that it is listening on port 8126 for APM service.
      1. notion image
  1. Check the Datadog agent running in k8
    1. Helm → Releases
    2. notion image
  1. Finally, Check in the Datadog dashboard
    1. Kubernetes - Overview (recommended dashboard for k8s)
    2. notion image
 
 

Logs

Simply change logs.containerCollectAll settings to true.
YAML
targetSystem: "linux" datadog: apiKey: <YOUR_API_KEY> # appKey: <DATADOG_APP_KEY> # If not using secrets, then use apiKey and appKey instead #apiKeyExistingSecret: <DATADOG_API_KEY_SECRET> #appKeyExistingSecret: <DATADOG_APP_KEY_SECRET> # clusterName: <CLUSTER_NAME> clusterName: <YOUR_CLUSTER_NAME> tags: [] # datadog.kubelet.tlsVerify should be `false` on kind and minikube # to establish communication with the kubelet # kubelet: # tlsVerify: "false" logs: enabled: true containerCollectAll: true containerCollectUsingFiles: true apm: portEnabled: true socketPath: /var/run/datadog/apm.socket hostSocketPath: /var/run/datadog/ processAgent: enabled: true processCollection: false systemProbe: enableTCPQueueLength: false enableOOMKill: true collectDNSStats: false clusterAgent: replicas: 2 createPodDisruptionBudget: true
 
After logging enabled, you can view logs by k8s services!
notion image
 
 

Default Kubernetes dashboards

Kubernetes - Overview

notion image
 

Kubernetes Pods Overview

notion image
 
 

Kubernetes Deployments Overview

notion image
 
This dashboard provides you with the most CPU-intensive, memory-intensive, disk-intensive, and network-intensive deployments. My conclusion with these results is DON’T USE PYTHON.
notion image
notion image