-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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:Expoter$$sentinel #2925
feat:Expoter$$sentinel #2925
Changes from all commits
e80e535
9e1480d
c2f580b
d10baee
b33d62b
66b0374
7118cea
0550199
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{- $files := .Files.Glob "dashboards/*.json" }} | ||
{{- if $files }} | ||
apiVersion: v1 | ||
kind: ConfigMapList | ||
items: | ||
{{- range $path, $fileContents := $files }} | ||
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }} | ||
- apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ printf "%s-grafana-%s" (include "pika.name" $) $dashboardName | trunc 63 | trimSuffix "-" }} | ||
labels: | ||
grafana_dashboard: "1" | ||
app: {{ template "pika.name" $ }}-grafana | ||
{{ include "pika.labels" $ | indent 6 }} | ||
data: | ||
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }} | ||
{{- end }} | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{- $files := .Files.Glob "dashboards/*.json" }} | ||
{{- if $files }} | ||
apiVersion: v1 | ||
kind: ConfigMapList | ||
items: | ||
{{- range $path, $fileContents := $files }} | ||
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }} | ||
- apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ printf "%s-grafana-%s" (include "pika.name" $) $dashboardName | trunc 63 | trimSuffix "-" }} | ||
labels: | ||
grafana_dashboard: "1" | ||
app: {{ template "pika.name" $ }}-grafana | ||
{{ include "pika.labels" $ | indent 6 }} | ||
data: | ||
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }} | ||
{{- end }} | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
server = true | ||
data = true | ||
clients = true | ||
stats = true | ||
cpu = true | ||
replication = true | ||
keyspace = true | ||
cache = true | ||
|
||
execcount = false | ||
commandstats = false | ||
rocksdb = false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
apiVersion: apps.kubeblocks.io/v1alpha1 | ||
kind: ComponentDefinition | ||
metadata: | ||
name: pika-exporter | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "pika.labels" . | nindent 4 }} | ||
spec: | ||
provider: pika | ||
description: A pika exporter component definition | ||
serviceKind: pika-exporter | ||
serviceVersion: {{ .Chart.AppVersion }} | ||
services: | ||
- name: expoter | ||
spec: | ||
ports: | ||
- name: expoter | ||
port: 9121 | ||
targetPort: expoter | ||
updateStrategy: Serial | ||
configs: | ||
- name: pika-config | ||
templateRef: pika-conf-template | ||
namespace: {{ .Release.Namespace }} | ||
volumeName: config | ||
vars: | ||
## reference to the pika-codis-dashboard service | ||
- name: DASHBOARD_ADDR | ||
valueFrom: | ||
serviceVarRef: | ||
compDef: pika-codis-dashboard | ||
name: dashboard | ||
optional: true | ||
host: Optional | ||
runtime: | ||
initContainers: | ||
- name: wait-codis-dashboard | ||
env: | ||
- name: DASHBOARD_ADDR | ||
value: "$(KB_CLUSTER_NAME)-codis-dashboard" | ||
image: busybox:1.28 | ||
command: | ||
- 'sh' | ||
- '-c' | ||
- "until nc -z ${DASHBOARD_ADDR} 18080; do echo waiting for codis dashboard; sleep 2; done;" | ||
containers: | ||
- name: pika-exporter | ||
image: {{ include "pikaExporter.image" . }} | ||
imagePullPolicy: {{ include "pikaExporter.imagePullPolicy" . }} | ||
ports: | ||
- name: expoter | ||
containerPort: 9121 | ||
volumeMounts: | ||
- name: config | ||
mountPath: /etc/pika | ||
env: | ||
- name: DASHBOARD_ADDR | ||
value: "$(KB_CLUSTER_NAME)-codis-dashboard" | ||
command: | ||
- "/pika/bin/pika_exporter" | ||
args: | ||
- "-config" | ||
- "/etc/pika/info.toml" | ||
- "-codis.addr" | ||
- "http://$(DASHBOARD_ADDR):18080/topom" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
apiVersion: apps.kubeblocks.io/v1alpha1 | ||
kind: ComponentDefinition | ||
metadata: | ||
name: redis-sentinel | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "pika.labels" . | nindent 4 }} | ||
Comment on lines
+1
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix YAML syntax error in labels section There's a YAML syntax error in the labels section. The indentation seems to be correct, but the linter is reporting an issue. To resolve this, try adjusting the Helm template function call. Replace: labels:
{{- include "pika.labels" . | nindent 4 }} with: labels: {{- include "pika.labels" . | nindent 4 }} This change puts the template function on the same line as 🧰 Tools🪛 yamllint
|
||
spec: | ||
clusterSize: 3 | ||
podSecurityContext: | ||
runAsUser: 1000 | ||
fsGroup: 1000 | ||
redisSentinelConfig: | ||
redisReplicationName: redis-replication | ||
kubernetesConfig: | ||
image: 'quay.io/opstree/redis-sentinel:v7.0.7' | ||
imagePullPolicy: IfNotPresent | ||
resources: | ||
requests: | ||
cpu: 101m | ||
memory: 128Mi | ||
limits: | ||
cpu: 101m | ||
memory: 128Mi | ||
updateStrategy: Serial | ||
Comment on lines
+15
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consider adjusting resource management and update strategy The Kubernetes configuration is generally well-structured, but there are a few points to consider:
Consider the following adjustments:
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 101m
memory: 128Mi
updateStrategy: RollingUpdate These changes could improve resource utilization and update efficiency while maintaining stability. |
||
configs: | ||
- name: pika-config | ||
templateRef: pika-conf-template | ||
namespace: {{ .Release.Namespace }} | ||
volumeName: config | ||
containers: | ||
- name: redis-sentinel | ||
image: {{ include "pikaExporter.image" . }} | ||
imagePullPolicy: {{ include "pikaExporter.imagePullPolicy" . }} | ||
ports: | ||
- name: expoter | ||
containerPort: 9121 | ||
volumeMounts: | ||
- name: config | ||
mountPath: /etc/pika | ||
env: | ||
- name: DASHBOARD_ADDR | ||
value: "$(KB_CLUSTER_NAME)-codis-dashboard" | ||
command: | ||
- "/pika/bin/pika_exporter" | ||
args: | ||
- "-config" | ||
- "/etc/pika/info.toml" | ||
- "-codis.addr" | ||
- "http://$(DASHBOARD_ADDR):18080/topom" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: apps.kubeblocks.io/v1alpha1 | ||
kind: ComponentVersion | ||
metadata: | ||
name: pika-exporter | ||
labels: | ||
{{- include "pika.labels" . | nindent 4 }} | ||
Comment on lines
+3
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix YAML syntax error in labels section. There's a YAML syntax error in the labels section. The indentation for the include statement is incorrect. Please apply the following fix: metadata:
name: pika-exporter
labels:
- {{- include "pika.labels" . | nindent 4 }}
+ {{- include "pika.labels" . | nindent 4 }} Ensure that the
🧰 Tools🪛 yamllint
|
||
spec: | ||
compatibilityRules: | ||
- compDefs: | ||
- pika-exporter | ||
releases: | ||
- {{ .Chart.AppVersion }} | ||
releases: | ||
- name: {{ .Chart.AppVersion }} | ||
changes: | ||
serviceVersion: {{ .Chart.AppVersion }} | ||
images: | ||
codis-dashboard: {{ include "pikaExporter.image" . }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: redis.redis.opstreelabs.in/v1beta1 | ||
kind: RedisSentinel | ||
metadata: | ||
name: redis-sentinel | ||
spec: | ||
clusterSize: 3 | ||
podSecurityContext: | ||
runAsUser: 1000 | ||
fsGroup: 1000 | ||
redisSentinelConfig: | ||
redisReplicationName: redis-replication | ||
kubernetesConfig: | ||
image: 'quay.io/opstree/redis-sentinel:v7.0.7' | ||
imagePullPolicy: IfNotPresent | ||
resources: | ||
requests: | ||
cpu: 101m | ||
memory: 128Mi | ||
limits: | ||
cpu: 101m | ||
memory: 128Mi |
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.
Fix typo in service name
The spec and services section is well-defined, but there's a typo in the service name:
Please correct this typo to ensure consistency and avoid potential issues.
The rest of the section, including the use of Helm templating for
serviceVersion
and the "Serial"updateStrategy
, looks good.