2019年5月1日水曜日

datadog研究 for kubernetes


1)公式に合わせて、以下を実行する。

kubectl create -f "https://raw.githubusercontent.com/DataDog/datadog-agent/master/Dockerfiles/manifests/rbac/clusterrole.yaml"
kubectl create -f "https://raw.githubusercontent.com/DataDog/datadog-agent/master/Dockerfiles/manifests/rbac/serviceaccount.yaml"
kubectl create -f "https://raw.githubusercontent.com/DataDog/datadog-agent/master/Dockerfiles/manifests/rbac/clusterrolebinding.yaml"
kubectl create secret generic datadog-secret --from-literal api-key="24f274ee18f81be45383e51774771f59"


2)以下を作成する。
◻️作成の中身も公式に合わせているので割愛。

①daemonset.yaml
②datadog-agent.yaml 


3)kubectl create実行後、podの詳細を見るとコケている。

root@rasp-master:~/datadog# kubectl describe pod datadog-agent-hnb2q
=====================================================================================
Name:           datadog-agent-hnb2q
Namespace:      default
Node:           rasp-node1/192.168.13.3
Start Time:     Wed, 01 May 2019 10:07:11 +0900
Labels:         app=datadog-agent
                controller-revision-hash=2831439401
                pod-template-generation=1
Annotations:    kubernetes.io/created-by={"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"DaemonSet","namespace":"default","name":"datadog-agent","uid":"73243b0b-6bad-11e9-b23a-b827eb4350be","apiV...
Status:         Running
IP:             10.244.1.86
Created By:     DaemonSet/datadog-agent
Controlled By:  DaemonSet/datadog-agent
Containers:
  datadog-agent:
    Container ID:   docker://38070588051b163c2f5bb54f8c158e009927ca20d6095b69b9bb7e93a532527a
    Image:          datadog/agent:latest
    Image ID:       docker-pullable://datadog/agent@sha256:5fbe2c87d4c4c2d9fc2d4bf45e39b0572f7f3f8ff906e3a77515a3308ab0c2cf
    Ports:          8125/UDP, 8126/TCP
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    1
      Started:      Wed, 01 May 2019 10:10:49 +0900
      Finished:     Wed, 01 May 2019 10:10:49 +0900
    Ready:          False
    Restart Count:  5
    Limits:
      cpu:     200m
      memory:  256Mi
    Requests:
      cpu:     200m
      memory:  256Mi
    Liveness:  exec [./probe.sh] delay=15s timeout=1s period=5s #success=1 #failure=3
    Environment:
      DD_API_KEY:                    <set to the key 'api-key' in secret 'datadog-secret'>  Optional: false
      DD_COLLECT_KUBERNETES_EVENTS:  true
      DD_LEADER_ELECTION:            true
      KUBERNETES:                    true
      DD_KUBERNETES_KUBELET_HOST:     (v1:status.hostIP)
      DD_APM_ENABLED:                true
    Mounts:
      /host/proc from procdir (ro)
      /host/sys/fs/cgroup from cgroups (ro)
      /var/run/docker.sock from dockersocket (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from datadog-agent-token-v9vzr (ro)
Conditions:
  Type           Status
  Initialized    True 
  Ready          False 
  PodScheduled   True 
Volumes:
  dockersocket:
    Type:  HostPath (bare host directory volume)
    Path:  /var/run/docker.sock
  procdir:
    Type:  HostPath (bare host directory volume)
    Path:  /proc
  cgroups:
    Type:  HostPath (bare host directory volume)
    Path:  /sys/fs/cgroup
  datadog-agent-token-v9vzr:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  datadog-agent-token-v9vzr
    Optional:    false
QoS Class:       Guaranteed
Node-Selectors:  <none>
Tolerations:     node.alpha.kubernetes.io/notReady:NoExecute
                 node.alpha.kubernetes.io/unreachable:NoExecute
                 node.kubernetes.io/disk-pressure:NoSchedule
                 node.kubernetes.io/memory-pressure:NoSchedule
Events:
  Type     Reason                 Age              From                 Message
  ----     ------                 ----             ----                 -------
  Normal   SuccessfulMountVolume  4m               kubelet, rasp-node1  MountVolume.SetUp succeeded for volume "procdir"
  Normal   SuccessfulMountVolume  4m               kubelet, rasp-node1  MountVolume.SetUp succeeded for volume "dockersocket"
  Normal   SuccessfulMountVolume  4m               kubelet, rasp-node1  MountVolume.SetUp succeeded for volume "cgroups"
  Normal   SuccessfulMountVolume  4m               kubelet, rasp-node1  MountVolume.SetUp succeeded for volume "datadog-agent-token-v9vzr"
  Normal   Pulling                3m (x3 over 3m)  kubelet, rasp-node1  pulling image "datadog/agent:latest"
  Normal   Pulled                 3m (x3 over 3m)  kubelet, rasp-node1  Successfully pulled image "datadog/agent:latest"
  Normal   Created                3m (x3 over 3m)  kubelet, rasp-node1  Created container
  Normal   Started                3m (x3 over 3m)  kubelet, rasp-node1  Started container
  Warning  FailedSync             3m (x4 over 3m)  kubelet, rasp-node1  Error syncing pod

  Warning  BackOff                3m (x5 over 3m)  kubelet, rasp-node1  Back-off restarting failed container
==================================================================================================



<結論>
上記のことから、継続し研究が必要だ。


0 件のコメント:

コメントを投稿

php log(ECS ログ出力)

# PHPエラーログの設定 ENV PHP_INI_DIR /usr/local/etc/php RUN { \ echo 'log_errors = On' ; \ echo 'error_log = /proc/self/...