Help us understand the problem. What is going on with this article?

SignalFxで、kubernetesのモニタリングをやってみた

SignalFxでk8sのモニタリングをしてみよう

前回は、awsのモニタリングをやってみたので、今回はk8sのmonitoringをやってみます。
事前に、k8sの環境は構築済みです。

ドキュメントは下記にあります。

https://docs.signalfx.com/en/latest/integrations/kubernetes/k8s-quick-install.html

なおSignalFxをk8sで使う場合には、helmを使ってインストールを行うので、事前にhelmのインストールが必要です。

repo の追加 と update

[sokayama@sokayama-mbp-58037]# helm repo add signalfx https://dl.signalfx.com/helm-repo
"signalfx" has been added to your repositories
[sokayama@sokayama-mbp-58037]#
[sokayama@sokayama-mbp-58037] # helm repo update
Hang tight while we grab the latest from your chart repositories...
...Skip local chart repository
...Successfully got an update from the "signalfx" chart repository
...Successfully got an update from the "stable" chart repository
Update Complete.
[sokayama@sokayama-mbp-58037] #

SignalFxへの設定

  • AccessTokenはSignalFxのAccessToken(MyProfileから確認)
  • clusterNameはk8sのcluster
  • signalFxRealmは、SignalFxのRealmを入力

下記を実行すると、podやら各種もろもろが作成される。

[sokayama@sokayama-mbp-58037] # helm install --set signalFxAccessToken=XXXXXXXXXXXXX --set clusterName=sokayama3.cluster.k8s.local --set agentVersion=4.13.0 --set signalFxRealm=XXX signalfx/signalfx-agent
NAME:   iced-cat
LAST DEPLOYED: Tue Nov  5 23:39:39 2019
NAMESPACE: default
STATUS: DEPLOYED

RESOURCES:
==> v1/ConfigMap
NAME                     DATA  AGE
iced-cat-signalfx-agent  1     0s

==> v1/DaemonSet
NAME                     DESIRED  CURRENT  READY  UP-TO-DATE  AVAILABLE  NODE SELECTOR  AGE
iced-cat-signalfx-agent  3        3        0      3           0          <none>         0s

==> v1/Pod(related)
NAME                           READY  STATUS             RESTARTS  AGE
iced-cat-signalfx-agent-8fsfj  0/1    ContainerCreating  0         0s
iced-cat-signalfx-agent-b8q6s  0/1    ContainerCreating  0         0s
iced-cat-signalfx-agent-sss4c  0/1    ContainerCreating  0         0s

==> v1/Secret
NAME                     TYPE    DATA  AGE
iced-cat-signalfx-agent  Opaque  1     0s

==> v1/ServiceAccount
NAME                     SECRETS  AGE
iced-cat-signalfx-agent  1        0s

==> v1beta1/ClusterRole
NAME                     AGE
iced-cat-signalfx-agent  0s

==> v1beta1/ClusterRoleBinding
NAME                     AGE
iced-cat-signalfx-agent  0s


NOTES:
The SignalFx agent is being deployed in your Kubernetes cluster.  You should
see metrics flowing once the agent image is downloaded and started (this may
take a few minutes since it has to download the agent container image).

Assuming you are logged into SignalFx in your browser, visit

https://app.ap0.signalfx.com/#/navigator/kubernetes%20pods/kubernetes%20pods

to see all of the pods in your cluster.

[sokayama@sokayama-mbp-58037] #

Podを確認

iced-cat-singalfxのpodが作成されていることを確認

[sokayama@sokayama-mbp-58037] # kubectl get pods
NAME                                        READY   STATUS    RESTARTS   AGE
iced-cat-signalfx-agent-8fsfj               1/1     Running   0          3m54s
iced-cat-signalfx-agent-b8q6s               1/1     Running   0          3m54s
iced-cat-signalfx-agent-sss4c               1/1     Running   0          3m54s
nuanced-anaconda-mongodb-596b458774-mjvgk   1/1     Running   0          15m
[sokayama@sokayama-mbp-58037] #

Dashboardを確認してみる。

手順的には以上で、しばらくするとSignalFxのDashboardにk8sの画面が下記のようにでてくる。

Screen Shot 2019-11-05 at 11.48.16 PM.jpg

いくつか抜粋してみてみると、

k8s overviewはこんな感じ

Screen Shot 2019-11-05 at 11.54.08 PM.jpg

k8sのNodeはこんな感じ

Screen Shot 2019-11-05 at 11.49.43 PM.jpg

containerはこんな感じ

10s単位でモニタリングしてる。

Screen Shot 2019-11-05 at 11.50.17 PM.jpg

おわりに

helmで1stepで構築できるので、これはめっちゃ便利かな。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away