Sponsored links

2020年のOSS活動ふり返り

ほとんどサボってしまった Advent Calendar 2020 全部オレシリーズ ですが、最後の日は 2020 年の OSS 活動について振り返ってみる。

2月頃は Vitess を触ってみてましたね。で、helm chart におかしなところがあったから issue を上げた。あの頃は Kubernetes Operator もまだ若かったし、諸々完成度はまだまだって感じだった。planet scale のやつの方が良さそうだなと思ったけど、その後触ってないからもう良く知らない。

backup cronjob related helm chart problems · Issue #5843 · vitessio/vitess
Overview of the Issue When I tried to enable backup cron then I found 2 problems in helm chart. Reproduction Steps Steps to reproduce this issue: Problem 1 : ni...

4月頃は Amazon ES にログを入れようかなって思って、Elasticsearch の template やら ingest pipeline やら watcher Alerting 設定をどうしようかなと思ってて、mihirsoni/odfe-monitor-cli が使えるんじゃないかと調べてました。

#7 は書き出すファイルを上書きするんだけど、truncate しないから、上書きする方が元のサイズよりも小さいと後ろにゴミが残るというバグ修正。ホントは一時ファイルに書き出して rename する方が安全だけど。

Add O_TRUNC to OpenFile flags to prevent file corruption by yteraoka · Pull Request #7 · mihirsoni/odfe-monitor-cli
Hi, Thank you for publishing a useful tool. I found some issues for me. I'll make other Pull Requests later. O_TRUNC to prevent file corruption if new data is ...

#8 はなぜかデフォルトで Basic 認証のユーザー名、パスワードが指定されてて、それに気付かずハマったのでデフォルトでは無効にしない?って言ってみたけど受け入れてもらえなかったやつ。

Delete default basic authentication credentials by yteraoka · Pull Request #8 · mihirsoni/odfe-monitor-cli
Basic Authentication credentials (admin/admin) set by default confused me. I think that should be blank by default.

#9 は Alerting の Action Throttle 機能への対応。だいぶ経ってから Merge されたみたい。

Support Action Throttle by yteraoka · Pull Request #9 · mihirsoni/odfe-monitor-cli
This PR is very similar to #6, with one difference. To make omitempty work, I added a Throttle struct as a pointer. Enabled throttleEnabled: true throttle: va...

でも odfe-monitor-cli だと terraform の中で shell script を実行するのも気持ち悪いしなあと思って、terraform-provider-elasticsearch でもいいんじゃね? json 管理辛いけど、、、となりかけたところで、やっぱり Elasticsearch はやめて CloudWatch Logs にすることにしたのでした。

6月、terraform-aws-lambda module で output の変数名と実態がずれていたので直してもらった

output cloudwatch_log_arn returns name not ARN · Issue #10 · terraform-module/terraform-aws-lambda
Bug Report terraform-aws-lambda/outputs.tf Lines 21 to 24 in c777ccb output "cloudwatch_logs_arn" { description = "cloudwatch logs AWS ARN" ...

こちらも6月、Kubernetes のログをどうやってもれなく集めようか、ということで docker のログ出力先を journald にして、それを Fluent Bit で読み出そうとしてた (そうすることで、docker のログのローテーション間隔やタイミングの問題での取りこぼしを回避できるかと考えた) ら SIGTERM での停止時に読み込んだけどまだ buffer に書かれていないデータなのかな?が失われてしまう問題が見つかったので報告。

[systemd] lost logs at receive SIGTERM · Issue #2277 · fluent/fluent-bit
Bug Report Describe the bug When I use systemd input plugin, I noticed lost few records at receiving SIGTERM. To Reproduce I pushed detail and reproduce procedu...

7月、このツイート を見て kubectl-isolate っていう shell script を書いた。実際にこれを役立てたことはまだないけど。

GitHub - yteraoka/kubectl-isolate: kubectl plugin to isolate a pod from the service.
kubectl plugin to isolate a pod from the service. Contribute to yteraoka/kubectl-isolate development by creating an account on GitHub.

7月にもう一つ、と言ってもしばらく放置したので merge されたのは9月。Prometheus のメトリクスは Grafana で見ることがほとんどで、その場合は TYPE コメントの型が counter だろうが gauge だろうが問題ないのですが、たまたま sysdig monitor を使う機会があり、当時の sysdig ではその型が意味を持っていたので counter であるべきものはそうなるように修正。ただ、その後 sysdig も native な Prometheus 対応をしたのでもしかしたらもうあまり重要ではないかもしれない…

Use correct metric type by yteraoka · Pull Request #163 · fluent/fluent-plugin-prometheus
I have a problem with showing fluentd metrics chart on Sysdig monitor. Grafana do not care TYPE fiels in response, but Sysdig monitor refers that and draw the c...

7月の終わりにもう一つ。Fluentd の file buffer でレースコンディション問題があるっぽいので報告。

IOError at chunk.rollback · Issue #3089 · fluent/fluentd
Check CONTRIBUTING guideline first and here is the list to help us investigate the problem. Describe the bug IOError occured during the file buffer operation af...

9月、Kuberhealthy の helm chart で tolerations を指定する方法が無かったので追加。

Support custom tolerations by yteraoka · Pull Request #641 · kuberhealthy/kuberhealthy
Currently, this helm chart support only fixed toleration, but I want to add the custom tolerations to kuberhealty deployment. So I added the .Values.deployment....

11月は Google の Container Registry で古い image の削除を行いたいけど AWS の ECR みたいに機能が用意されていないため、ツールを作ろうかと思っていたところ、gcr-lifecycle-policy ってのを見つけたのでこれ使えるんじゃね?ということで試したらまあ、いろいろ問題があったのでした… そのうち Google さんが機能を追加してくれるだろうと信じています

まずは、Container Registry にしか対応してなかったのを Artifact Registry に対応させる

Artifact Registry support · Issue #6 · marekaf/gcr-lifecycle-policy
Hi, Google is going to migrate from GCR to Artifact Registry. I want to use gcr-lifecycle-policy with Artifact Registry too. Then, I tried that. Unfortunately, ...

次に sort 順が逆だよという指摘

feat: implement --sort-by parameter by marekaf · Pull Request #7 · marekaf/gcr-lifecycle-policy

お次はヨーロッパスタイルの日付表示は辛いよ

Date format · Issue #9 · marekaf/gcr-lifecycle-policy
Date format in internal/worker/print.go is 2006-02-01. This means YYYY-DD-MM. Is this what you intended? I prefer ISO 8601 standard YYYY-MM-DD (2006-01-02) gcr-...

このツールは Kubernetes クラスタ内で使われているイメージは削除しないという機能があるのだけれど、それが機能しないパターンがいくつかあったので修正

fix image name comparison and keep container id by yteraoka · Pull Request #10 · marekaf/gcr-lifecycle-policy
ImageName from cluster does not container repository path. But, name from container registry contains path. So, adjust these format. Add support that image spac...

Image の tag が特定のパターンにマッチするものは消さないという指定ができるように機能追加

Add `--protect-tag-regex` flag to cleanup command by yteraoka · Pull Request #13 · marekaf/gcr-lifecycle-policy
I want to protect some pattern of tag (e.g. '^release-'). So, I added new flag --protect-tag-regex to cleanup commmand.

と、こんなところでした。お疲れ様でした。みなさま良いお年を。

Copied title and URL