README.adoc 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. = Linux Metrics Exporter for OpenShift Nodes =
  2. == Components ==
  3. . Container Image for SAR
  4. . Container Image for PSACCT
  5. . Container Image for Exporter
  6. == Deployment ==
  7. TBD
  8. == Images ==
  9. This set of images requires a valid entitlement for RHEL (and consequently
  10. either a RHEL system to build on or a RHEL system to create an entitlement
  11. secret from).
  12. NOTE: The entitled system architecture needs to match the container host!
  13. If building the images using `podman` on an entitled host, no extra steps need
  14. to be performed as host entitlements will automatically be imported into the
  15. build container.
  16. If building the images in OpenShift Container Platform, you must make sure an
  17. entitlement secret and corresponding RHSM certificate secret are mounted inside
  18. the build pod in order for packages to be found and installed.
  19. The process is as follows.
  20. .Verify access to host entitlement data.
  21. [subs=+quotes]
  22. -------------------------------
  23. $ **ls -l /etc/pki/entitlement/*.pem /etc/rhsm/ca/*.pem**
  24. -rw-r--r--. 1 root root 3272 Oct 31 06:09 /etc/pki/entitlement/_6028779042203586857_-key.pem
  25. -rw-r--r--. 1 root root 149007 Oct 31 06:09 /etc/pki/entitlement/_6028779042203586857_.pem
  26. -rw-r--r--. 1 root root 2305 Sep 2 2021 /etc/rhsm/ca/redhat-entitlement-authority.pem
  27. -rw-r--r--. 1 root root 7411 Sep 2 2021 /etc/rhsm/ca/redhat-uep.pem
  28. -------------------------------
  29. .Create corresponding secrets.
  30. [subs=+quotes]
  31. -------------------------------
  32. $ *oc create secret generic etc-pki-entitlement \*
  33. *--from-file=/etc/pki/entitlement/_6028779042203586857_-key.pem \*
  34. *--from-file=/etc/pki/entitlement/_6028779042203586857_.pem*
  35. secret/etc-pki-entitlement created
  36. $ *oc create secret generic rhsm-ca \*
  37. *--from-file=/etc/rhsm/ca/redhat-entitlement-authority.pem \*
  38. *--from-file=/etc/rhsm/ca/redhat-uep.pem*
  39. secret/rhsm-ca created
  40. -------------------------------
  41. .Make sure the BuildConfig mounts those secrets.
  42. [subs=+quotes]
  43. -------------------------------
  44. apiVersion: build.openshift.io/v1
  45. kind: BuildConfig
  46. ...
  47. strategy:
  48. type: Docker
  49. dockerStrategy:
  50. dockerfilePath: Containerfile-psacct
  51. from:
  52. kind: ImageStreamTag
  53. name: ubi-minimal:latest
  54. **volumes:
  55. - source:
  56. type: Secret
  57. secret:
  58. secretName: etc-pki-entitlement
  59. name: etc-pki-entitlement
  60. mounts:
  61. - destinationPath: /etc/pki/entitlement
  62. - source:
  63. type: Secret
  64. secret:
  65. secretName: rhsm-ca
  66. name: rhsm-ca
  67. mounts:
  68. - destinationPath: /etc/rhsm/ca**
  69. -------------------------------
  70. `Containerfile` instructions are written such that they should work without
  71. modification regardless of whether the build is running in `podman` on an
  72. entitled host or inside a correctly configured OpenShift builder pod.
  73. === SAR ===
  74. Sar image is based on `ubi-minimal` and includes just the `sysstat` package.
  75. It expects a volume to be attached at `/var/log/sa`.
  76. Entrypoint takes care of initialising the volume and rotating any old `sar` files out of the way.
  77. It *requires* to be executed under `root` UID.
  78. It also *requires* access to host's network namespace if you want to measure network statistics.
  79. === PSACCT ===
  80. Sar image is based on `ubi-minimal` and includes just the `psacct` package.
  81. It expects a volume to be attached at `/var/account`.
  82. Entrypoint takes care of initialising the volume and rotating any old `pacct` files out of the way.
  83. In addition to *requiring* execution under `root` UID, it also *requires* the `SYS_PACCT` capability.
  84. It also *requires* access to host's PID namespace (`--pid=host` podman option).
  85. === Exporter ===
  86. TBD