-
Notifications
You must be signed in to change notification settings - Fork 305
Monitor Github/Gitlab availability #7990
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
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: HozifaWasfy The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Code Review by Gemini## Code Review
### `components/mintmaker/staging/base/kustomization.yaml`
**Issue:** Typo in resource path.
The path `../blackcox` appears to be a typo and should likely be `../blackbox` to correctly reference the new blackbox component.
**Suggested Change:**
```diff
--- a/components/mintmaker/staging/base/kustomization.yaml
+++ b/components/mintmaker/staging/base/kustomization.yaml
@@ -1,7 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
- ../../base/external-secrets
-- ../blackcox
+- ../blackbox
- https://github.com/konflux-ci/mintmaker/config/default?ref=d9daa8e361dc4714b598bd9443ae32b0e8384f79
- https://github.com/konflux-ci/mintmaker/config/renovate?ref=d9daa8e361dc4714b598bd9443ae32b0e8384f79
|
af7f10d
to
b2a41ea
Compare
Code Review by Gemini## Code Review
### `components/mintmaker/staging/base/kustomization.yaml`
No issues found.
### `components/mintmaker/staging/blackbox/blackbox-deployment.yaml`
**Issue 1: Image tag `:latest`**
Using the `:latest` tag for container images is generally discouraged in production environments as it can lead to unpredictable deployments when the image updates. It's best practice to pin to a specific, immutable version tag.
```diff
--- a/components/mintmaker/staging/blackbox/blackbox-deployment.yaml
+++ b/components/mintmaker/staging/blackbox/blackbox-deployment.yaml
@@ -33,7 +33,7 @@
spec:
containers:
- name: blackbox-exporter
- image: quay.io/prometheus/blackbox-exporter:latest
+ image: quay.io/prometheus/blackbox-exporter:v0.23.0 # Or a specific stable version
args:
- "--config.file=/etc/blackbox/blackbox.yml"
ports: Issue 2: Missing newline at end of file --- a/components/mintmaker/staging/blackbox/blackbox-deployment.yaml
+++ b/components/mintmaker/staging/blackbox/blackbox-deployment.yaml
@@ -57,4 +57,5 @@
volumes:
- name: config-volume
configMap:
name: blackbox-config
+\ No newline at end of file Suggested change: Add a newline at the end of the file.
|
b2a41ea
to
2f08a5a
Compare
Code Review by Gemini--- a/components/mintmaker/staging/blackbox/git-platforms.yaml
+++ b/components/mintmaker/staging/blackbox/git-platforms.yaml
@@ -10,7 +10,7 @@
app.kubernetes.io/managed-by: kustomize
spec:
jobName: "github-probe"
prober:
- url: git-platforms-exporter:9115
+ url: git-platforms-exporter:9115/probe
scheme: http
pod:
namespace: mintmaker
@@ -34,7 +34,7 @@
app.kubernetes.io/managed-by: kustomize
spec:
jobName: "gitlab-probe"
prober:
- url: git-platforms-exporter:9115
+ url: git-platforms-exporter:9115/probe
scheme: http
pod:
namespace: mintmaker
@@ -58,7 +58,7 @@
app.kubernetes.io/managed-by: kustomize
spec:
jobName: "gitlab-cee-probe"
prober:
- url: git-platforms-exporter:9115
+ url: git-platforms-exporter:9115/probe
scheme: http
pod:
namespace: mintmaker
|
2f08a5a
to
2e34ef5
Compare
Code Review by GeminiThe changes introduce a Blackbox Exporter to monitor the availability of GitHub and GitLab platforms. The implementation is well-structured, follows standard practices for deploying Prometheus Blackbox Exporter with the Prometheus Operator, and includes appropriate Kubernetes resources (ConfigMap, Deployment, Service, and Probes).
No critical bugs or issues were found.
### Suggestions for Improvement:
1. **Resource Labels Consistency (Minor):**
While not a functional issue, the `app.kubernetes.io/name` label is set to `mintmaker` for the Blackbox Exporter's ConfigMap, Deployment, and Service. Typically, this label identifies the specific application. For the Blackbox Exporter components, `app.kubernetes.io/name: blackbox-exporter` might be more semantically accurate, with an additional label like `app.kubernetes.io/part-of: mintmaker` if it's considered a sub-component of the `mintmaker` project. However, the current approach is consistent across all new resources in this PR and does not cause any functional problems. Given the instruction "Do not suggest descriptive variable name", I will not suggest changing this.
2. **Unused ICMP Prober (Minor):**
The `blackbox-config` ConfigMap defines an `icmp` prober module. However, none of the `Probe` resources (`github-probe`, `gitlab-probe`, `gitlab-cee-probe`) currently utilize this `icmp` module; they all use `http_2xx`. While it's not an issue to have unused configuration, you might consider removing it if there are no immediate plans to use ICMP probes, to keep the configuration cleaner. This is a minor point and not a bug.
Overall, the changes are good and achieve the stated goal of monitoring GitHub/GitLab availability. |
app.kubernetes.io/name: mintmaker | ||
app.kubernetes.io/managed-by: kustomize | ||
name: git-platforms-exporter | ||
namespace: mintmaker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you deploy it in the mintmaker namespace? I think the o11y team is going to deploy a Blackbox exporter as well cc @mftb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to monitor the availability of git platforms from mintmaker cluster
apiVersion: monitoring.coreos.com/v1 | ||
kind: Probe | ||
metadata: | ||
name: gitlab-cee-probe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only work in the internal clusters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- What are you going to do with the metrics?
- Don't you need to also setup rbac ?
- Don't you need to also setup a service monitor to scrape the exporter?
targets: | ||
staticConfig: | ||
static: | ||
- https://github.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the times when there is an outage in github this endpoint is available. Is there better way to check for availability? Same question about gitlab.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1- I will set up alerts to monitor if mintmaker can access git platforms, because it is essential for mintmaker operations.
2- I do not need rbac for blackbox exporter because it does not communicate with k8s api, it only probe external endpoints.
3- I do not, because the probe will configure prometheus to scrape the exporter for the endpoint defined in the probe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the times when there is an outage in github this endpoint is available. Is there better way to check for availability? Same question about gitlab.
this is a good point, let me see what I can improve.
@gcpsoares @kubasikus Please take a look at this |
jira: CWFHEALTH-4346