1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

DynatraceAdvent Calendar 2023

Day 6

Kubernetes:Dynatrace Operator YAMLマニフェストを分解してみる

Posted at

こんばんわ。Dynatrace井上です。

K8S を監視観測する場合、多くの場合Dynatrace Operatorを使います。

マニフェストYAMLファイルへのリンクは例えば以下のドキュメントページに出てきます。

このYAMLファイルは実際は複数YAMLの結合です。

その境界は「---(ハイフン3つ)」で仕切ります

通常は必要ないですが例えばバージョン間の差分を知りたいなどの場合分解して比較してみたくなることもあるかと思います。そこで試したのが以下の分解方法です。

$ mkdir Dynatrace_k8s
$ curl --silent --location \
 https://github.com/Dynatrace/dynatrace-operator/releases/download/v0.14.0/kubernetes.yaml |
 csplit --silent --elide-empty-files --prefix Dynatrace_k8s/Operator140_ - '/^---$/' {*}
$ ls -l Dynatrace_k8s
total 320
-rwxrwxrwx 1 kinoue kinoue    332 Dec  4 00:06 Operator140_00
-rwxrwxrwx 1 kinoue kinoue    905 Dec  4 00:06 Operator140_01
-rwxrwxrwx 1 kinoue kinoue    904 Dec  4 00:06 Operator140_02
-rwxrwxrwx 1 kinoue kinoue    938 Dec  4 00:06 Operator140_03
-rwxrwxrwx 1 kinoue kinoue    942 Dec  4 00:06 Operator140_04
-rwxrwxrwx 1 kinoue kinoue    897 Dec  4 00:06 Operator140_05
-rwxrwxrwx 1 kinoue kinoue    893 Dec  4 00:06 Operator140_06
-rwxrwxrwx 1 kinoue kinoue 217416 Dec  4 00:06 Operator140_07
-rwxrwxrwx 1 kinoue kinoue  33502 Dec  4 00:06 Operator140_08
-rwxrwxrwx 1 kinoue kinoue   1896 Dec  4 00:06 Operator140_09
-rwxrwxrwx 1 kinoue kinoue   2129 Dec  4 00:06 Operator140_10
-rwxrwxrwx 1 kinoue kinoue   1896 Dec  4 00:06 Operator140_11
-rwxrwxrwx 1 kinoue kinoue    577 Dec  4 00:06 Operator140_12
-rwxrwxrwx 1 kinoue kinoue    510 Dec  4 00:06 Operator140_13
-rwxrwxrwx 1 kinoue kinoue    504 Dec  4 00:06 Operator140_14
-rwxrwxrwx 1 kinoue kinoue   3076 Dec  4 00:06 Operator140_15
-rwxrwxrwx 1 kinoue kinoue   1624 Dec  4 00:06 Operator140_16
-rwxrwxrwx 1 kinoue kinoue    487 Dec  4 00:06 Operator140_17
-rwxrwxrwx 1 kinoue kinoue    506 Dec  4 00:06 Operator140_18
-rwxrwxrwx 1 kinoue kinoue   1092 Dec  4 00:06 Operator140_19
-rwxrwxrwx 1 kinoue kinoue   3872 Dec  4 00:06 Operator140_20
-rwxrwxrwx 1 kinoue kinoue   4711 Dec  4 00:06 Operator140_21
-rwxrwxrwx 1 kinoue kinoue   1992 Dec  4 00:06 Operator140_22
-rwxrwxrwx 1 kinoue kinoue   1889 Dec  4 00:06 Operator140_23

これだけだとファイル名が連番になるだけなので、ファイル名を意味あるものに一括変更する方法を探してみます。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?