-
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:pika-master-slave-cluster in kb #2903
base: unstable
Are you sure you want to change the base?
Changes from all commits
b5ddc4a
ae3411c
94cd643
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,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: v2 | ||
name: pika-master-slave | ||
description: A Pika Master-Slave Group Helm chart for KubeBlocks. | ||
|
||
type: application | ||
|
||
version: 0.9.0 | ||
|
||
appVersion: "3.5.3" | ||
|
||
home: https://github.com/OpenAtomFoundation/pika | ||
keywords: | ||
- pika | ||
- redis | ||
- database | ||
- nosql | ||
- replication | ||
- codis | ||
|
||
maintainers: | ||
- name: pika | ||
url: https://github.com/OpenAtomFoundation/pika/tools/kubeblocks_helm |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "pika-cluster.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "pika-cluster.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "pika-cluster.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "pika-cluster.labels" -}} | ||
helm.sh/chart: {{ include "pika-cluster.chart" . }} | ||
{{ include "pika-cluster.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "pika-cluster.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "pika-cluster.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{- define "clustername" -}} | ||
{{ include "pika-cluster.fullname" .}} | ||
{{- end}} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "pika-cluster.serviceAccountName" -}} | ||
{{- default (printf "kb-%s" (include "clustername" .)) .Values.serviceAccount.name }} | ||
{{- end }} |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,43 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
apiVersion: apps.kubeblocks.io/v1alpha1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
kind: Cluster | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
metadata: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
name: {{ include "clustername" . }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
namespace: {{ .Release.Namespace }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
labels: {{ include "pika-cluster.labels" . | nindent 4 }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
spec: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
terminationPolicy: {{ .Values.terminationPolicy }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
affinity: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{{- with .Values.topologyKeys }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
topologyKeys: {{ . | toYaml | nindent 6 }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{{- end }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+10
to
+12
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 syntax error and incorrect indentation in the There is a syntax error and incorrect indentation in the Apply the following diff to correct the indentation and fix the syntax error: affinity:
- {{- with .Values.topologyKeys }}
- topologyKeys: {{ . | toYaml | nindent 6 }}
- {{- end }}
+ {{- with .Values.topologyKeys }}
+ topologyKeys: {{ . | toYaml | nindent 8 }}
+ {{- end }} Committable suggestion
Suggested change
Toolsyamllint
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
{{- with $.Values.tolerations }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
tolerations: {{ . | toYaml | nindent 4 }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{{- end }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+13
to
+15
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 indentation issue in the The Apply the following diff to correct the indentation: - {{- with $.Values.tolerations }}
- tolerations: {{ . | toYaml | nindent 4 }}
- {{- end }}
+{{- with $.Values.tolerations }}
+ tolerations: {{ . | toYaml | nindent 4 }}
+{{- end }} Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
componentSpecs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
- name: pika | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
componentDef: pika # Ref componentdefinition.name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
enabledLogs: {{ $.Values.enabledLogs | toJson | indent 4 }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
replicas: {{ add (int $.Values.slaveCount) 1 | default 2 }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. Ensure default value for At line 20, the expression for Consider updating the expression to apply the default to - replicas: {{ add (int $.Values.slaveCount) 1 | default 2 }}
+ replicas: {{ add (int (default 1 $.Values.slaveCount)) 1 }} This ensures that if Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
serviceAccountName: {{ include "pika-cluster.serviceAccountName" $ }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{{- with $.Values.resources.pikaGroup }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
resources: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
limits: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
cpu: {{ .limits.cpu | quote }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
memory: {{ .limits.memory | quote }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
requests: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
cpu: {{ .requests.cpu | quote }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
memory: {{ .requests.memory | quote }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{{- end }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{{- if $.Values.persistence.enabled }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
volumeClaimTemplates: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{{- with $.Values.persistence.pikaData }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
- name: data # ref componentDefinition.containers.volumeMounts.name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
spec: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
storageClassName: {{ .storageClassName }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
accessModes: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
- ReadWriteOnce | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
resources: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
requests: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
storage: {{ .size }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{{- end }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{{- end }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+31
to
+43
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. Correct indentation in the The Apply the following diff to correct the indentation: {{- if $.Values.persistence.enabled }}
- volumeClaimTemplates:
+ volumeClaimTemplates:
{{- with $.Values.persistence.pikaData }}
- - name: data # ref componentDefinition.containers.volumeMounts.name
+ - name: data # ref componentDefinition.containers.volumeMounts.name
spec:
storageClassName: {{ .storageClassName }}
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .size }}
{{- end }}
{{- end }} Committable suggestion
Suggested change
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: kb-{{ include "clustername" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{ include "pika-cluster.labels" . | nindent 4 }} | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- events | ||
verbs: | ||
- create |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: kb-{{ include "clustername" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{ include "pika-cluster.labels" . | nindent 4 }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: kb-{{ include "clustername" . }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "pika-cluster.serviceAccountName" . }} | ||
namespace: {{ .Release.Namespace }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "pika-cluster.serviceAccountName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{ include "pika-cluster.labels" . | nindent 4 }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Default values for pika. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
|
||
nameOverride: "" | ||
fullnameOverride: "" | ||
|
||
slaveCount: 1 | ||
|
||
terminationPolicy: Delete | ||
|
||
clusterVersionOverride: "" | ||
|
||
monitor: | ||
enabled: false | ||
|
||
switchPolicy: | ||
type: Noop | ||
|
||
resources: | ||
# We usually recommend not to specify default resources and to leave this as a conscious | ||
# choice for the user. This also increases chances charts run on environments with little | ||
# resources, such as Minikube. If you do want to specify resources, uncomment the following | ||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'. | ||
pikaGroup: | ||
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. 命名问题 |
||
limits: | ||
cpu: 500m | ||
memory: 3Gi | ||
requests: | ||
cpu: 500m | ||
memory: 1Gi | ||
|
||
persistence: | ||
enabled: true | ||
pikaData: | ||
storageClassName: | ||
size: 10Gi | ||
|
||
topologyKeys: | ||
- kubernetes.io/hostname | ||
|
||
## @param tolerations | ||
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ | ||
## | ||
tolerations: [ ] | ||
|
||
#enabledLogs: | ||
# - running | ||
|
||
# The RBAC permission used by cluster component pod, now include event.create | ||
serviceAccount: | ||
name: "" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: v2 | ||
name: pika | ||
description: A Pika Master Slave Group definition Helm chart for Kubernetes | ||
|
||
type: application | ||
|
||
version: 0.9.0 | ||
|
||
appVersion: "3.5.3" | ||
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. 用3.5.5吧 |
||
|
||
home: https://github.com/OpenAtomFoundation/pika | ||
keywords: | ||
- pika | ||
- redis | ||
- database | ||
- nosql | ||
- replication | ||
|
||
maintainers: | ||
- name: pika | ||
url: https://github.com/OpenAtomFoundation/pika/tools/kubeblocks_helm |
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.
api version 应该有 beta1 了,可以用新的