Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions addons/falkordb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ When the cluster is running, each POD should have a sidecar container, named `me
You can retrieve the `scrapePath` and `scrapePort` from pod's exporter container.

```bash
get po falkordb-replication-falkordb-0 -oyaml | yq '.spec.containers[] | select(.name=="metrics") | .ports'
kubectl get po falkordb-replication-falkordb-0 -oyaml | yq '.spec.containers[] | select(.name=="metrics") | .ports'
```

And the expected output is like:
Expand Down Expand Up @@ -1154,7 +1154,6 @@ spec:
- demo
selector:
matchLabels:
app.kubernetes.io/instance: falkordb-replication
apps.kubeblocks.io/component-name: falkordb
```

Expand All @@ -1166,7 +1165,7 @@ kubectl apply -f examples/falkordb/pod-monitor.yaml

Login to the Grafana dashboard and import the dashboard.

There is a pre-configured dashboard for PostgreSQL under the `FalkorDB` folder in the Grafana dashboard. And more dashboards can be found in the Grafana dashboard store[^5].
The `redis_exporter` used here is provided by [redis_exporter](https://github.com/oliver006/redis_exporter)[^3], and more dashboards can be found in the Grafana dashboard store[^2].

> [!NOTE]
> Make sure the labels are set correctly in the `PodMonitor` file to match the dashboard.
Expand Down Expand Up @@ -1490,4 +1489,5 @@ spec:
## Reference

[^1]: Sentinel: <https://redis.io/docs/latest/operate/oss_and_stack/management/sentinel/>
[^5]: Grafana Dashboard Store: <https://grafana.com/grafana/dashboards/>
[^2]: Grafana Dashboard Store: <https://grafana.com/grafana/dashboards/>
[^3]: Redis Exporter Metrics: <https://github.com/oliver006/redis_exporter>
7 changes: 0 additions & 7 deletions addons/falkordb/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,6 @@ Define falkordb cluster component script template name
falkordb-cluster-scripts-template-{{ .Chart.Version }}
{{- end -}}

{{/*
Define falkordb metrics config name
*/}}
{{- define "falkordb.metricsConfiguration" -}}
falkordb-metrics-config
{{- end -}}

{{- define "falkordb4.image" -}}
{{ .Values.image.registry | default "docker.io" }}/{{ .Values.image.repository }}:{{ .Values.image.tag.major4.minor12 }}
{{- end }}
Expand Down
43 changes: 8 additions & 35 deletions addons/falkordb/templates/cmpd-falkordb-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ spec:
namespace: {{ $.Release.Namespace }}
volumeName: falkordb-cluster-config
externalManaged: true
- name: falkordb-metrics-config
template: {{ include "falkordb.metricsConfiguration" $ }}
namespace: {{ $.Release.Namespace }}
volumeName: falkordb-metrics-config
defaultMode: 0444
scripts:
- name: falkordb-cluster-scripts
template: {{ include "falkordbCluster.scriptsTemplate" $ }}
Expand All @@ -106,7 +101,6 @@ spec:
- container: metrics
ports:
- http-metrics
- server-metrics
{{- end }}
vars:
## the name of current cluster instance
Expand Down Expand Up @@ -356,19 +350,6 @@ spec:
- name: REDIS_METRICS_HTTP_PORT
value: "9121"
expression: {{ `{{if ne (index . "REDIS_METRICS_HOST_NETWORK_PORT") ""}}{{.REDIS_METRICS_HOST_NETWORK_PORT}}{{else}}{{.REDIS_METRICS_HTTP_PORT}}{{end}}` | toYaml }}
## the falkordb server metrics container host network server port when using host network mode, the port will be allocated automatically by KubeBlocks
- name: REDIS_METRICS_HOST_NETWORK_SERVER_PORT
valueFrom:
hostNetworkVarRef:
optional: true
container:
name: metrics
port:
name: server-metrics
option: Required
- name: REDIS_METRICS_SERVER_PORT
value: "8888"
expression: {{ `{{if ne (index . "REDIS_METRICS_HOST_NETWORK_SERVER_PORT") ""}}{{.REDIS_METRICS_HOST_NETWORK_SERVER_PORT}}{{else}}{{.REDIS_METRICS_SERVER_PORT}}{{end}}` | toYaml }}
## the falkordb cluster host network port list for all shard pods, the all pods in same shard has the same host network port allocated automatically by KubeBlocks.
## the value format is like "shard-chg:1057,shard-khh:1056,shard-mpg:1053"
- name: REDIS_CLUSTER_ALL_SHARDS_HOST_NETWORK_PORT
Expand Down Expand Up @@ -566,29 +547,21 @@ spec:
- name: metrics
imagePullPolicy: {{ $.Values.metrics.image.pullPolicy | quote }}
securityContext:
runAsNonRoot: true
runAsUser: 1001
runAsUser: 59000
runAsGroup: 59000
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
env:
- name: ENDPOINT
- name: REDIS_ADDR
value: "localhost:$(SERVICE_PORT)"
- name: METRICS_HTTP_PORT
value: $(REDIS_METRICS_HTTP_PORT)
- name: METRICS_SERVER_PORT
value: $(REDIS_METRICS_SERVER_PORT)
- name: REDIS_USER
value: $(REDIS_DEFAULT_USER)
- name: REDIS_PASSWORD
value: $(REDIS_DEFAULT_PASSWORD)
command:
- "/bin/agamotto"
- "--config=/opt/conf/metrics-config.yaml"
ports:
- name: http-metrics
containerPort: {{ $.Values.metrics.service.port }}
- name: server-metrics
containerPort: {{ $.Values.metrics.service.serverPort }}
volumeMounts:
- name: falkordb-metrics-config
mountPath: /opt/conf
containerPort: 9121
{{- end }}
{{- end }}
43 changes: 8 additions & 35 deletions addons/falkordb/templates/cmpd-falkordb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ spec:
namespace: {{ $.Release.Namespace }}
volumeName: falkordb-config
externalManaged: true
- name: falkordb-metrics-config
template: {{ include "falkordb.metricsConfiguration" $ }}
namespace: {{ $.Release.Namespace }}
volumeName: falkordb-metrics-config
defaultMode: 0444
scripts:
- name: falkordb-scripts
template: {{ include "falkordb.scriptsTemplate" $ }}
Expand All @@ -104,7 +99,6 @@ spec:
- container: metrics
ports:
- http-metrics
- server-metrics
{{- end }}
vars:
## the name of current cluster instance
Expand Down Expand Up @@ -224,19 +218,6 @@ spec:
- name: REDIS_METRICS_HTTP_PORT
value: "9121"
expression: {{ `{{if ne (index . "REDIS_METRICS_HOST_NETWORK_PORT") ""}}{{.REDIS_METRICS_HOST_NETWORK_PORT}}{{else}}{{.REDIS_METRICS_HTTP_PORT}}{{end}}` | toYaml }}
## the falkordb server metrics container host network server port when using host network mode, the port will be allocated automatically by KubeBlocks, if not set, the default value is 8888
- name: REDIS_METRICS_HOST_NETWORK_SERVER_PORT
valueFrom:
hostNetworkVarRef:
optional: true
container:
name: metrics
port:
name: server-metrics
option: Required
- name: REDIS_METRICS_SERVER_PORT
value: "8888"
expression: {{ `{{if ne (index . "REDIS_METRICS_HOST_NETWORK_SERVER_PORT") ""}}{{.REDIS_METRICS_HOST_NETWORK_SERVER_PORT}}{{else}}{{.REDIS_METRICS_SERVER_PORT}}{{end}}` | toYaml }}
{{- end }}
## the component name of falkordb sentinel when falkordb sentinel is enabled, it's the fullname of falkordb-sent component
- name: SENTINEL_COMPONENT_NAME
Expand Down Expand Up @@ -440,29 +421,21 @@ spec:
- name: metrics
imagePullPolicy: {{ $.Values.metrics.image.pullPolicy | quote }}
securityContext:
runAsNonRoot: true
runAsUser: 1001
runAsUser: 59000
runAsGroup: 59000
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
env:
- name: ENDPOINT
- name: REDIS_ADDR
value: "localhost:$(SERVICE_PORT)"
- name: METRICS_HTTP_PORT
value: $(REDIS_METRICS_HTTP_PORT)
- name: METRICS_SERVER_PORT
value: $(REDIS_METRICS_SERVER_PORT)
- name: REDIS_USER
value: $(REDIS_DEFAULT_USER)
- name: REDIS_PASSWORD
value: $(REDIS_DEFAULT_PASSWORD)
command:
- "/bin/agamotto"
- "--config=/opt/conf/metrics-config.yaml"
ports:
- name: http-metrics
containerPort: {{ $.Values.metrics.service.port }}
- name: server-metrics
containerPort: {{ $.Values.metrics.service.serverPort }}
volumeMounts:
- name: falkordb-metrics-config
mountPath: /opt/conf
containerPort: 9121
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion addons/falkordb/templates/cmpv-falkordb-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
switchover: {{ $falkordbRepository }}:{{ .imageTag }}
preTerminate: {{ $falkordbRepository }}:{{ .imageTag }}
memberLeave: {{ $falkordbRepository }}:{{ .imageTag }}
metrics: {{ include "metrics.repository" $ }}:0.1.2-beta.1
metrics: {{ include "metrics.repository" $ }}:{{ $.Values.metrics.image.tag }}
init-dbctl: {{ $.Values.dbctlImage.registry | default ( $.Values.image.registry | default "docker.io" ) }}/{{ $.Values.dbctlImage.repository }}:{{ $.Values.dbctlImage.tag }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion addons/falkordb/templates/cmpv-falkordb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
serviceVersion: {{ .version }}
images:
falkordb: {{ $falkordbRepository }}:{{ .imageTag }}
metrics: {{ include "metrics.repository" $ }}:0.1.2-beta.1
metrics: {{ include "metrics.repository" $ }}:{{ $.Values.metrics.image.tag }}
init-dbctl: {{ $.Values.dbctlImage.registry | default ( $.Values.image.registry | default "docker.io" ) }}/{{ $.Values.dbctlImage.repository }}:{{ $.Values.dbctlImage.tag }}
postProvision: {{ $falkordbRepository }}:{{ .imageTag }}
accountProvision: {{ $falkordbRepository }}:{{ .imageTag }}
Expand Down
51 changes: 0 additions & 51 deletions addons/falkordb/templates/metrics-configmap.yaml

This file was deleted.

8 changes: 4 additions & 4 deletions addons/falkordb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ busyboxImage:
metrics:
image:
# if the value of metrics.image.registry is not specified using `--set`, it will be set to the value of 'image.registry' by default
registry: ""
repository: apecloud/agamotto
tag: 0.1.2-beta.1
registry: docker.io
repository: oliver006/redis_exporter
tag: v1.80.0
pullPolicy: IfNotPresent
service:
port: 9121
Expand All @@ -78,4 +78,4 @@ logConfigs:
# cluster domain without . prefix
clusterDomain: "cluster.local"

enableMetrics: false
enableMetrics: true
7 changes: 4 additions & 3 deletions examples/falkordb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ When the cluster is running, each POD should have a sidecar container, named `me
You can retrieve the `scrapePath` and `scrapePort` from pod's exporter container.

```bash
get po falkordb-replication-falkordb-0 -oyaml | yq '.spec.containers[] | select(.name=="metrics") | .ports'
kubectl get po falkordb-replication-falkordb-0 -oyaml | yq '.spec.containers[] | select(.name=="metrics") | .ports'
```

And the expected output is like:
Expand Down Expand Up @@ -619,7 +619,7 @@ kubectl apply -f examples/falkordb/pod-monitor.yaml

Login to the Grafana dashboard and import the dashboard.

There is a pre-configured dashboard for PostgreSQL under the `FalkorDB` folder in the Grafana dashboard. And more dashboards can be found in the Grafana dashboard store[^5].
The `redis_exporter` used here is provided by [redis_exporter](https://github.com/oliver006/redis_exporter)[^3], and more dashboards can be found in the Grafana dashboard store[^2].

> [!NOTE]
> Make sure the labels are set correctly in the `PodMonitor` file to match the dashboard.
Expand Down Expand Up @@ -777,4 +777,5 @@ spec:
## Reference

[^1]: Sentinel: <https://redis.io/docs/latest/operate/oss_and_stack/management/sentinel/>
[^5]: Grafana Dashboard Store: <https://grafana.com/grafana/dashboards/>
[^2]: Grafana Dashboard Store: <https://grafana.com/grafana/dashboards/>
[^3]: Redis Exporter Metrics: <https://github.com/oliver006/redis_exporter>
1 change: 0 additions & 1 deletion examples/falkordb/pod-monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ spec:
- demo
selector:
matchLabels:
app.kubernetes.io/instance: falkordb-replication
apps.kubeblocks.io/component-name: falkordb
Loading