![]() |
VOOZH | about |
We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.
Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.
Follow TNS on your favorite social media networks.
Become a TNS follower on LinkedIn.
Check out the latest featured and trending stories while you wait for your first TNS newsletter.
$ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 |bash
Once installed, download the values.yaml file here.
You can also grab the raw file and download it directly to the master node with a `wget`.
`$ wget https://raw.githubusercontent.com/xe-nvdk/awesome-helm-charts/main/telegraf-ds-k3s/values.yaml`
Now, we have to modify this file a bit. We need to open it and modify the Output section. By default the file looks like this:
... ## Exposed telegraf configuration ## ref: https://docs.influxdata.com/telegraf/v1.13/administration/configuration/ config: # global_tags: # cluster: "mycluster" agent: interval: "10s" round_interval: true metric_batch_size: 1000 metric_buffer_limit: 10000 collection_jitter: "0s" flush_interval: "10s" flush_jitter: "0s" precision: "" debug: false quiet: false logfile: "" hostname: "$HOSTNAME" omit_hostname: false outputs: - influxdb: urls: - "http://influxdb.monitoring.svc:8086" database: "telegraf" retention_policy: "" timeout: "5s" username: "" password: "" user_agent: "telegraf" insecure_skip_verify: false monitor_self: false
... ## Exposed telegraf configuration ## ref: https://docs.influxdata.com/telegraf/v1.13/administration/configuration/ config: # global_tags: # cluster: "mycluster" agent: interval: "1m" round_interval: true metric_batch_size: 1000 metric_buffer_limit: 10000 collection_jitter: "0s" flush_interval: "10s" flush_jitter: "0s" precision: "" debug: false quiet: false logfile: "" hostname: "$HOSTNAME" omit_hostname: false outputs: - influxdb_v2: urls: - "https://us-west-2-1.aws.cloud2.influxdata.com" bucket: "kubernetes" organization: "miemail@midominio.com" token: "WIX6Fy-v10zUIag_dslfjasfljadsflasdfjasdlñjfasdlkñfj==" timeout: "5s" insecure_skip_verify: false monitor_self: false
$ exportKUBECONFIG=/etc/rancher/k3s/k3s.yaml
Once that’s done, we’re going to add the Awesome-Helm-Charts repo.
$ helm repo add awesome-helm-charts https://xe-nvdk.github.io/awesome-helm-charts/
Then we update the content of the repos that we configured.
$ helm repo update
Finally, we’ll install the repo, passing it the configuration we just modified in the `values.yaml` file.
$ helm upgrade --install telegraf-ds-k3s -f values.yaml awesome-helm-charts/telegraf-ds-k3s
The terminal should return something similar to this:
Release "telegraf-ds-k3s" does not exist. Installing it now.
NAME: telegraf-ds-k3s
LAST DEPLOYED: Fri Jun 25 22:47:22 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
To open a shell session in the container running Telegraf run the following:
- kubectl exec -i -t --namespace default $(kubectl get pods --namespace default -l app.kubernetes.io/name=telegraf-ds -o jsonpath='{.items[0].metadata.name}') /bin/sh
To tail the logs for a Telegraf pod in the Daemonset run the following:
- kubectl logs -f --namespace default $(kubectl get pods --namespace default -l app.kubernetes.io/name=telegraf-ds -o jsonpath='{ .items[0].metadata.name }')
To list the running Telegraf instances run the following:
- kubectl get pods --namespace default -l app.kubernetes.io/name=telegraf-ds -w
$ kubectl get pods
We see that our pod is alive and kicking.
AME READY STATUS RESTARTS AGE telegraf-ds-k3s-w8qhc 1/1 Running 0 2m29s
$ kubectl logs -f telegraf-ds-k3s-w8qhc
The terminal should output something like this:
2021-06-26T02:55:22Z I! Starting Telegraf 1.18.3 2021-06-26T02:55:22Z I! Using config file: /etc/telegraf/telegraf.conf 2021-06-26T02:55:22Z I! Loaded inputs: cpu disk diskio kernel kubernetes mem net processes swap system 2021-06-26T02:55:22Z I! Loaded aggregators: 2021-06-26T02:55:22Z I! Loaded processors: 2021-06-26T02:55:22Z I! Loaded outputs: influxdb_v2 2021-06-26T02:55:22Z I! Tags enabled: host=k3s-master 2021-06-26T02:55:22Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"k3s-master", Flush Interval:10s