Fix/metrics server not used#2
Merged
prashanthjos merged 3 commits intoApr 22, 2026
Merged
Conversation
…g the manager config
…o fix/metrics-server-not-used
Contributor
Author
|
I've done some tests and can confirm the metrics server starts properly. Port forwarding the metrics server endpoint and executing curl against it# Port forward metrics server to be able to send a request against it
kubectl port-forward -n kflashback-system kflashback-controller-5c59f59ffb-t2kh2 8080:8080
# Sending a request to the forwarded metrics-server where output is clearly visible
curl http://localhost:8080/metrics
# HELP certwatcher_read_certificate_errors_total Total number of certificate read errors
# TYPE certwatcher_read_certificate_errors_total counter
certwatcher_read_certificate_errors_total 0
# HELP certwatcher_read_certificate_total Total number of certificate reads
# TYPE certwatcher_read_certificate_total counter
certwatcher_read_certificate_total 0
# HELP controller_runtime_active_workers Number of currently used workers per controller
# TYPE controller_runtime_active_workers gauge
controller_runtime_active_workers{controller="flashbackpolicy"} 0
# HELP controller_runtime_max_concurrent_reconciles Maximum number of concurrent reconciles per controller
# TYPE controller_runtime_max_concurrent_reconciles gauge
controller_runtime_max_concurrent_reconciles{controller="flashbackpolicy"} 1
# HELP controller_runtime_reconcile_errors_total Total number of reconciliation errors per controller
# TYPE controller_runtime_reconcile_errors_total counter
controller_runtime_reconcile_errors_total{controller="flashbackpolicy"} 0
# HELP controller_runtime_reconcile_total Total number of reconciliations per controller
# TYPE controller_runtime_reconcile_total counter
controller_runtime_reconcile_total{controller="flashbackpolicy",result="error"} 0
controller_runtime_reconcile_total{controller="flashbackpolicy",result="requeue"} 0
controller_runtime_reconcile_total{controller="flashbackpolicy",result="requeue_after"} 0
controller_runtime_reconcile_total{controller="flashbackpolicy",result="success"} 0Modifying the bind address to make sure its picked up by the configI've modified the address to bind to to port 8082 and the test above succeeded aswell so the config change is picked up by the code properly apiVersion: apps/v1
kind: Deployment
metadata:
name: kflashback-controller
namespace: kflashback-system
labels:
app.kubernetes.io/name: kflashback
app.kubernetes.io/component: controller
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: kflashback
app.kubernetes.io/component: controller
template:
metadata:
labels:
app.kubernetes.io/name: kflashback
app.kubernetes.io/component: controller
spec:
serviceAccountName: kflashback-controller
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
containers:
- name: controller
image: ghcr.io/kflashback/kflashback:latest
args:
- --config-name=kflashback
- --storage-backend=sqlite
- --storage-dsn=/data/kflashback.db
- --api-bind-address=:9090
- --metrics-bind-address=:8082
- --health-probe-bind-address=:8081
- --ui-dir=/ui
- --leader-elect
...pod logs indicating the metrics server starting at the right changed port: 2026-04-12T10:50:26Z INFO controller-runtime.metrics Serving metrics server {"bindAddress": ":8082", "secure": false}
2026-04-12T10:50:26Z INFO starting server {"kind": "health probe", "addr": "[::]:8081"} |
Owner
|
@Fixer38 thank you for the PR, can you please add some unit tests too? |
Owner
|
This looks good to me, can you please take care of formatting also? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request aiming to fix issue #1 by:
make fmthas been included.