Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(prometheus): Use bindplane-prometheus container image #87

Merged
merged 3 commits into from
Feb 16, 2024

Conversation

jsirianni
Copy link
Member

@jsirianni jsirianni commented Feb 15, 2024

Description of Changes

This is merging into an epic branch. The epic branch already bumped the chart version. Epic branch will not merge until after 1.45 is released.

BindPlane 1.45 will be the first release that includes Prometheus container images pre configured for BindPlane. https://github.com/observIQ/bindplane-op-enterprise/pull/2084.

Changes

  • Removed Prometheus configmap
  • Replaced prom/prometheus image with observiq/bindplane-prometheus

The BindPlane Prometheus container image is pre configured with the correct configuration for the given BindPlane version, meaning we no longer need a configMap volume mount to inject the rollup rule configuration file.

Testing

New Install

We have a 1.43 BindPlane Prometheus image available, and it can be used fro testing by specifying the right image tag.

# values.yaml
image:
  tag: 1.43.0
config:
  username: bpuser
  password: bppass
  secret_key: 12D8FB6E-1532-4A4C-97AF-95A430BE5E6E
  sessions_secret: 4484766F-5016-4077-B8E0-0DE1D637854B
prometheus:
  enable: true
  enableSideCar: true
dev:
  collector:
    create: true
minikube start
helm template --values ./values.yaml charts/bindplane | kubectl apply -f -

Once deployed, you can check to see the image name and tag:

kubectl get pod release-name-bindplane-0 -o yaml | grep 'observiq/bindplane-prometheus'
image: ghcr.io/observiq/bindplane-prometheus:1.43.0

Check the UI

kubectl  port-forward pod/release-name-bindplane-0 3011:3001 --address 0.0.0.0

Sign in and configure an agent http://localhost:3011

Observe measurements in action

Screenshot from 2024-02-15 13-58-42

Upgrade

I tested upgrading from main branch with the following process

  1. Checkout main
  2. Deploy for the first time, using the values file specified above ^ ^
  3. Applied a config and waited 10 minutes (waiting for summary page to populate)
  4. Checked out this branch and de-deployed, facilitating an upgrade to this change
  5. Observed that the summary page still shows data

Please check that the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • CI passes

@@ -368,7 +368,7 @@ spec:
{{- if eq (include "bindplane.deployment_type" .) "StatefulSet" }}
{{- if and (.Values.prometheus.enable) (.Values.prometheus.enableSideCar) }}
- name: prometheus
image: prom/prometheus:v2.47.2
image: ghcr.io/observiq/bindplane-prometheus:{{ include "bindplane.tag" . }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use {{ include "bindplane.tag" . }} to determine the bindplane image tag as well. This will allow us to always deploy the correct Prometheus image for a given release.

- name: {{ include "bindplane.fullname" . }}-prometheus-data
mountPath: /var/lib/prometheus/tsdb
mountPath: /prometheus
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/prometheus is the correct path for the bindplane-prometheus image. See the bottom of this PR https://github.com/observIQ/bindplane-op-enterprise/pull/2084/files

ports:
- containerPort: 9090
name: http
args:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Args do not need to be set here anymore, they are baked into the bindplane-prometheus image. see the bottom of this pr https://github.com/observIQ/bindplane-op-enterprise/pull/2084/files

@jsirianni jsirianni changed the base branch from main to epic/always-on-prometheus February 15, 2024 19:06
@jsirianni jsirianni changed the title use bindplane prometheus image and remove configmap feat(prometheus): Use bindplane-prometheus container image Feb 15, 2024
@jsirianni jsirianni force-pushed the use-bindplane-prometheus-image branch 2 times, most recently from 374c1d6 to 4a10373 Compare February 15, 2024 19:25
@jsirianni jsirianni force-pushed the epic/always-on-prometheus branch from e8c0a7c to a1f3583 Compare February 15, 2024 21:20
@jsirianni jsirianni force-pushed the use-bindplane-prometheus-image branch from a1fad72 to dfab9c4 Compare February 15, 2024 21:21
@jsirianni jsirianni marked this pull request as ready for review February 16, 2024 14:36
@jsirianni jsirianni requested a review from a team as a code owner February 16, 2024 14:36
@jsirianni jsirianni requested review from antonblock and jmwilliams89 and removed request for a team February 16, 2024 14:36
@jsirianni jsirianni merged commit 4c2d516 into epic/always-on-prometheus Feb 16, 2024
16 checks passed
@jsirianni jsirianni deleted the use-bindplane-prometheus-image branch February 16, 2024 15:42
jsirianni added a commit that referenced this pull request Feb 19, 2024
* use bindplane prometheus image and remove configmap

* remove args, they are set in the container image already. updaste volume mount to use /prometheus, the correct path for the bindplane-prometheus image

* pin sidecar test version
jsirianni added a commit that referenced this pull request Feb 26, 2024
* use bindplane prometheus image and remove configmap

* remove args, they are set in the container image already. updaste volume mount to use /prometheus, the correct path for the bindplane-prometheus image

* pin sidecar test version
jsirianni added a commit that referenced this pull request Feb 27, 2024
* bump minor version

* run on all PRs

* feat(prometheus): Use bindplane-prometheus container image (#87)

* use bindplane prometheus image and remove configmap

* remove args, they are set in the container image already. updaste volume mount to use /prometheus, the correct path for the bindplane-prometheus image

* pin sidecar test version

* feat(prometheus): Deploy Prometheus StatefulSet by default (#89)

* remove sidecar

* rename dev prometheus config

* add prometheus statefulset

* true up securityContext

* add remote option

* regen docs

* remove prom enable from templates

* use generated service name when host is not set

* fix svc name

* re-add sideCar option

* revert size change

* use localhost when sidecar

* Regen docs

* resolve test issues by using newer image

* use ee image

* Remove all test case as it requires a license

* skip if dev prometheus is enabled

* fix condition

* add fsgroup for gke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants