Skip to content

Commit 44f06b0

Browse files
committed
chore(kvrocks): add 2.10 version
1 parent fe2aede commit 44f06b0

60 files changed

Lines changed: 7154 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

addons/index.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ entries:
6363
kvrocks:
6464
- version: 2.8
6565
description: "Apache Kvrocks is a distributed key value NoSQL database that uses RocksDB as storage engine and is compatible with Redis protocol."
66+
- version: "2.10"
67+
description: "Apache Kvrocks is a distributed key value NoSQL database that uses RocksDB as storage engine and is compatible with Redis protocol."
6668
yugabytedb:
6769
- version: 2024
6870
description: "YugabyteDB is a high-performance distributed SQL database for powering global, internet-scale applications. "
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
annotations:
2+
category: Database
3+
apiVersion: v2
4+
appVersion: "2"
5+
dependencies:
6+
- name: common
7+
repository: oci://registry.drycc.cc/charts
8+
version: ~1.1.3
9+
description: Apache Kvrocks is a distributed key value NoSQL database that uses RocksDB as storage engine and is compatible with Redis protocol. Kvrocks intends to decrease the cost of memory and increase the capacity while compared to Redis. The design of replication and storage was inspired by rocksplicator and blackwidow.
10+
engine: gotpl
11+
home: https://github.com/apache/kvrocks
12+
icon: https://camo.githubusercontent.com/afe4ab77c3cf0ef991e1dd7aa9f25b9ff96651a6b1cc0b055eda16567dc9d8be/68747470733a2f2f6b76726f636b732e6170616368652e6f72672f696d672f6b76726f636b732d66656174757265642e706e67
13+
keywords:
14+
- kvrocks
15+
- keyvalue
16+
- database
17+
maintainers:
18+
- email: drycc@drycc.cc
19+
name: drycc
20+
name: kvrocks
21+
sources:
22+
- https://github.com/apache/kvrocks
23+
version: "2.10"

addons/kvrocks/2.10/chart/kvrocks-2.10/README.md

Lines changed: 557 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
master:
2+
extraFlags:
3+
- --maxmemory-policy allkeys-lru
4+
persistence:
5+
enabled: false
6+
replica:
7+
extraFlags:
8+
- --maxmemory-policy allkeys-lru
9+
persistence:
10+
enabled: false
11+
auth:
12+
enabled: false
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
sentinel:
2+
enabled: true
3+
metrics:
4+
enabled: true
5+
sentinel:
6+
enabled: true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
architecture: standalone
11.2 KB
Loading
9.48 KB
Loading
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
CHART NAME: {{ .Chart.Name }}
2+
CHART VERSION: {{ .Chart.Version }}
3+
APP VERSION: {{ .Chart.AppVersion }}
4+
5+
** Please be patient while the chart is being deployed **
6+
7+
{{- if .Values.diagnosticMode.enabled }}
8+
The chart has been deployed in diagnostic mode. All probes have been disabled and the command has been overwritten with:
9+
10+
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 4 }}
11+
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 4 }}
12+
13+
Get the list of pods by executing:
14+
15+
kubectl get pods --namespace {{ .Release.Namespace }} -l app.kubernetes.io/instance={{ .Release.Name }}
16+
17+
Access the pod you want to debug by executing
18+
19+
kubectl exec --namespace {{ .Release.Namespace }} -ti <NAME OF THE POD> -- bash
20+
21+
In order to replicate the container startup scripts execute this command:
22+
23+
For Kvrocks:
24+
25+
/opt/drycc/scripts/kvrocks/entrypoint.sh /opt/drycc/scripts/kvrocks/run.sh
26+
27+
{{- if .Values.sentinel.enabled }}
28+
29+
For Sentinel:
30+
31+
/opt/drycc/scripts/sentinel/entrypoint.sh /opt/drycc/scripts/sentinel/run.sh
32+
33+
{{- end }}
34+
{{- else }}
35+
36+
{{- if contains .Values.master.service.type "LoadBalancer" }}
37+
{{- if not .Values.auth.enabled }}
38+
{{ if and (not .Values.networkPolicy.enabled) (.Values.networkPolicy.allowExternal) }}
39+
40+
-------------------------------------------------------------------------------
41+
WARNING
42+
43+
By specifying "master.service.type=LoadBalancer" and "auth.enabled=false" you have
44+
most likely exposed the Kvrocks; service externally without any authentication
45+
mechanism.
46+
47+
For security reasons, we strongly suggest that you switch to "ClusterIP" or
48+
"NodePort". As alternative, you can also switch to "auth.enabled=true"
49+
providing a valid password on "password" parameter.
50+
51+
-------------------------------------------------------------------------------
52+
{{- end }}
53+
{{- end }}
54+
{{- end }}
55+
56+
{{- if eq .Values.architecture "replication" }}
57+
{{- if .Values.sentinel.enabled }}
58+
59+
Kvrocks; can be accessed via port {{ .Values.sentinel.service.ports.kvrocks }} on the following DNS name from within your cluster:
60+
61+
{{ template "common.names.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }} for read only operations
62+
63+
For read/write operations, first access the Kvrocks; Sentinel cluster, which is available in port {{ .Values.sentinel.service.ports.sentinel }} using the same domain name above.
64+
65+
{{- else }}
66+
67+
Kvrocks; can be accessed on the following DNS names from within your cluster:
68+
69+
{{ printf "%s-master.%s.svc.%s" (include "common.names.fullname" .) .Release.Namespace .Values.clusterDomain }} for read/write operations (port {{ .Values.master.service.ports.kvrocks }})
70+
{{ printf "%s-replicas.%s.svc.%s" (include "common.names.fullname" .) .Release.Namespace .Values.clusterDomain }} for read-only operations (port {{ .Values.replica.service.ports.kvrocks }})
71+
72+
{{- end }}
73+
{{- else }}
74+
75+
Kvrocks; can be accessed via port {{ .Values.master.service.ports.kvrocks }} on the following DNS name from within your cluster:
76+
77+
{{ template "common.names.fullname" . }}-master.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
78+
79+
{{- end }}
80+
81+
{{ if .Values.auth.enabled }}
82+
83+
To get your password run:
84+
85+
export KVROCKS_REQUIREPASS=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "kvrocks.secretName" . }} -o jsonpath="{.data.kvrocks-password}" | base64 --decode)
86+
87+
{{- end }}
88+
89+
To connect to your Kvrocks; server:
90+
91+
1. Run a Kvrocks; pod that you can use as a client:
92+
93+
kubectl run --namespace {{ .Release.Namespace }} redis-client --restart='Never' {{ if .Values.auth.enabled }} --env KVROCKS_REQUIREPASS=$KVROCKS_REQUIREPASS {{ end }} --image {{ template "kvrocks.image" . }} --command -- sleep infinity
94+
95+
Use the following command to attach to the pod:
96+
97+
kubectl exec --tty -i redis-client \
98+
{{- if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }}--labels="{{ template "common.names.fullname" . }}-client=true" \{{- end }}
99+
--namespace {{ .Release.Namespace }} -- bash
100+
101+
2. Connect using the Kvrocks; CLI:
102+
103+
{{- if eq .Values.architecture "replication" }}
104+
{{- if .Values.sentinel.enabled }}
105+
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h {{ template "common.names.fullname" . }} -p {{ .Values.sentinel.service.ports.kvrocks }} # Read only operations
106+
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h {{ template "common.names.fullname" . }} -p {{ .Values.sentinel.service.ports.sentinel }} # Sentinel access
107+
{{- else }}
108+
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h {{ printf "%s-master" (include "common.names.fullname" .) }}
109+
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h {{ printf "%s-replicas" (include "common.names.fullname" .) }}
110+
{{- end }}
111+
{{- else }}
112+
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h {{ template "common.names.fullname" . }}-master
113+
{{- end }}
114+
115+
{{- if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }}
116+
117+
Note: Since NetworkPolicy is enabled, only pods with label {{ template "common.names.fullname" . }}-client=true" will be able to connect to kvrocks.
118+
119+
{{- else }}
120+
121+
To connect to your database from outside the cluster execute the following commands:
122+
123+
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled }}
124+
{{- if contains "NodePort" .Values.sentinel.service.type }}
125+
126+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
127+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "common.names.fullname" . }})
128+
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h $NODE_IP -p $NODE_PORT
129+
130+
{{- else if contains "LoadBalancer" .Values.sentinel.service.type }}
131+
132+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
133+
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "common.names.fullname" . }}'
134+
135+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "common.names.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}")
136+
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h $SERVICE_IP -p {{ .Values.sentinel.service.ports.kvrocks }}
137+
138+
{{- else if contains "ClusterIP" .Values.sentinel.service.type }}
139+
140+
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "common.names.fullname" . }} {{ .Values.sentinel.service.ports.kvrocks }}:{{ .Values.sentinel.service.ports.kvrocks }} &
141+
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h 127.0.0.1 -p {{ .Values.sentinel.service.ports.kvrocks }}
142+
143+
{{- end }}
144+
{{- else }}
145+
{{- if contains "NodePort" .Values.master.service.type }}
146+
147+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
148+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ printf "%s-master" (include "common.names.fullname" .) }})
149+
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h $NODE_IP -p $NODE_PORT
150+
151+
{{- else if contains "LoadBalancer" .Values.master.service.type }}
152+
153+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
154+
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "common.names.fullname" . }}'
155+
156+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ printf "%s-master" (include "common.names.fullname" .) }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}")
157+
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h $SERVICE_IP -p {{ .Values.master.service.port }}
158+
159+
{{- else if contains "ClusterIP" .Values.master.service.type }}
160+
161+
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ printf "%s-master" (include "common.names.fullname" .) }} {{ .Values.master.service.port }}:{{ .Values.master.service.port }} &
162+
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h 127.0.0.1 -p {{ .Values.master.service.port }}
163+
164+
{{- end }}
165+
{{- end }}
166+
167+
{{- end }}
168+
{{- end }}
169+
{{- include "kvrocks.checkRollingTags" . }}
170+
{{- include "common.warnings.rollingTag" .Values.volumePermissions.image }}
171+
{{- include "common.warnings.rollingTag" .Values.sysctl.image }}
172+
173+
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled (eq .Values.sentinel.service.type "NodePort") (not .Release.IsUpgrade ) }}
174+
{{- if $.Values.sentinel.service.nodePorts.sentinel }}
175+
No need to upgrade, ports and nodeports have been set from values
176+
{{- else }}
177+
#!#!#!#!#!#!#!# IMPORTANT #!#!#!#!#!#!#!#
178+
YOU NEED TO PERFORM AN UPGRADE FOR THE SERVICES AND WORKLOAD TO BE CREATED
179+
{{- end }}
180+
{{- end }}

0 commit comments

Comments
 (0)