forked from OpenAtomFoundation/pika
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
convert pika kubeblocks helm chart to new component definition api
- Loading branch information
Showing
8 changed files
with
481 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
81 changes: 81 additions & 0 deletions
81
tools/kubeblocks_helm/pika/templates/componentdefinition-codis-dashboard.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
apiVersion: apps.kubeblocks.io/v1alpha1 | ||
kind: ComponentDefinition | ||
metadata: | ||
name: pika-codis-dashboard | ||
labels: | ||
{{- include "pika.labels" . | nindent 4 }} | ||
spec: | ||
provider: pika | ||
description: A pika codis dashboard component definition | ||
serviceKind: pika-codis-dashboard | ||
serviceVersion: 3.5.1 | ||
services: | ||
- name: dashboard | ||
serviceName: dashboard | ||
spec: | ||
ports: | ||
- name: dashboard | ||
targetPort: dashboard | ||
port: 18080 | ||
updateStrategy: Serial | ||
configs: | ||
- name: codis-dashboard-config | ||
templateRef: pika-conf-template | ||
namespace: {{ .Release.Namespace }} | ||
volumeName: config | ||
runtime: | ||
initContainers: | ||
- name: wait-etcd | ||
env: | ||
- name: ETCD_ADDR | ||
value: "{{ include "etcd.clusterDomain" .}}" | ||
image: busybox:1.28 | ||
command: | ||
- 'sh' | ||
- '-c' | ||
- "until nc -z ${ETCD_ADDR} 2379; do echo waiting for etcd; sleep 2; done;" | ||
containers: | ||
- name: codis-dashboard | ||
image: {{ include "codis.image" . }} | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- containerPort: 18080 | ||
name: dashboard | ||
volumeMounts: | ||
- name: config | ||
mountPath: /etc/codis | ||
env: | ||
- name: POD_IP | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: status.podIP | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: ETCD_ADDR | ||
value: "{{ include "etcd.clusterDomain" .}}:2379" | ||
- name: PRODUCT_NAME | ||
value: "$(KB_CLUSTER_NAME)" | ||
command: | ||
- "/codis/bin/codis-dashboard" | ||
args: | ||
- "-c" | ||
- "/etc/codis/dashboard.toml" | ||
- "--host-admin" | ||
- "$(POD_IP):18080" | ||
- "--etcd" | ||
- "$(ETCD_ADDR)" | ||
- "--product_name" | ||
- "$(PRODUCT_NAME)" | ||
- "--pidfile" | ||
- "log/dashboard.pid" | ||
- "--remove-lock" | ||
- "--log-level=DEBUG" | ||
lifecycle: | ||
postStart: | ||
exec: | ||
command: [ "/bin/bash", "-c", "/codis/bin/codis-admin --dashboard-list --etcd=${ETCD_ADDR}" ] | ||
preStop: | ||
exec: | ||
command: [ "/bin/sh", "-c", "PID=$(cat log/dashboard.pid) && kill $PID && while ps -p 1 > /dev/null; do sleep 1; done" ] |
60 changes: 60 additions & 0 deletions
60
tools/kubeblocks_helm/pika/templates/componentdefinition-codis-fe.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
apiVersion: apps.kubeblocks.io/v1alpha1 | ||
kind: ComponentDefinition | ||
metadata: | ||
name: pika-codis-fe | ||
labels: | ||
{{- include "pika.labels" . | nindent 4 }} | ||
spec: | ||
provider: pika | ||
description: A pika codis frontend component definition | ||
serviceKind: pika-codis-fe | ||
serviceVersion: 3.5.1 | ||
services: | ||
- name: fe | ||
serviceName: fe | ||
spec: | ||
ports: | ||
- name: fe | ||
targetPort: fe | ||
port: 8080 | ||
updateStrategy: Parallel | ||
runtime: | ||
initContainers: | ||
- name: wait-etcd | ||
env: | ||
- name: ETCD_ADDR | ||
value: "{{ include "etcd.clusterDomain" .}}" | ||
- name: DASHBOARD_ADDR | ||
value: "$(KB_CLUSTER_NAME)-codis-dashboard" | ||
image: busybox:1.28 | ||
command: | ||
- 'sh' | ||
- '-c' | ||
- "until nc -z ${ETCD_ADDR} 2379; do echo waiting for etcd; sleep 2; done;" | ||
- "until nc -z ${DASHBOARD_ADDR} 18080; do echo waiting for etcd; sleep 2; done;" | ||
containers: | ||
- name: codis-fe | ||
image: {{ include "codis.image" . }} | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- containerPort: 8080 | ||
name: fe | ||
env: | ||
- name: POD_IP | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: status.podIP | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: ETCD_ADDR | ||
value: "{{ include "etcd.clusterDomain" .}}:2379" | ||
command: | ||
- "/codis/bin/codis-fe" | ||
args: | ||
- "--etcd" | ||
- "$(ETCD_ADDR)" | ||
- "--listen=0.0.0.0:8080" | ||
- "--assets=/codis/bin/assets" | ||
- "--log-level=DEBUG" |
92 changes: 92 additions & 0 deletions
92
tools/kubeblocks_helm/pika/templates/componentdefinition-codis-proxy.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
apiVersion: apps.kubeblocks.io/v1alpha1 | ||
kind: ComponentDefinition | ||
metadata: | ||
name: pika-codis-proxy | ||
labels: | ||
{{- include "pika.labels" . | nindent 4 }} | ||
spec: | ||
provider: pika | ||
description: A pika codis proxy component definition | ||
serviceKind: pika-codis-proxy | ||
serviceVersion: 3.5.1 | ||
services: | ||
- name: proxy | ||
serviceName: proxy | ||
spec: | ||
ports: | ||
- name: proxy | ||
targetPort: proxy | ||
port: 11080 | ||
- name: admin | ||
targetPort: admin | ||
port: 19000 | ||
updateStrategy: Serial | ||
configs: | ||
- name: codis-proxy-config | ||
templateRef: pika-conf-template | ||
namespace: {{ .Release.Namespace }} | ||
volumeName: config | ||
runtime: | ||
initContainers: | ||
- name: wait-etcd | ||
env: | ||
- name: ETCD_ADDR | ||
value: "{{ include "etcd.clusterDomain" .}}" | ||
- name: DASHBOARD_ADDR | ||
value: "$(KB_CLUSTER_NAME)-codis-dashboard" | ||
image: busybox:1.28 | ||
command: | ||
- 'sh' | ||
- '-c' | ||
- "until nc -z ${ETCD_ADDR} 2379; do echo waiting for etcd; sleep 2; done;" | ||
- "until nc -z ${DASHBOARD_ADDR} 18080; do echo waiting for etcd; sleep 2; done;" | ||
containers: | ||
- name: codis-proxy | ||
image: {{ include "codis.image" . }} | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- containerPort: 11080 | ||
name: proxy | ||
- containerPort: 19000 | ||
name: admin | ||
volumeMounts: | ||
- name: config | ||
mountPath: /etc/codis | ||
env: | ||
- name: POD_IP | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: status.podIP | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: ETCD_ADDR | ||
value: "{{ include "etcd.clusterDomain" .}}:2379" | ||
- name: DASHBOARD_ADDR | ||
value: "$(KB_CLUSTER_NAME)-codis-dashboard:18080" | ||
- name: PRODUCT_NAME | ||
value: "$(KB_CLUSTER_NAME)" | ||
command: | ||
- "/codis/bin/codis-proxy" | ||
args: | ||
- "-c" | ||
- "/etc/codis/proxy.toml" | ||
- "--host-admin" | ||
- "$(POD_IP):11080" | ||
- "--host-proxy" | ||
- "$(POD_IP):19000" | ||
- "--etcd" | ||
- "$(ETCD_ADDR)" | ||
- "--product_name" | ||
- "$(PRODUCT_NAME)" | ||
- "--pidfile" | ||
- "log/proxy.pid" | ||
- "--log-level=DEBUG" | ||
lifecycle: | ||
preStop: | ||
exec: | ||
command: | ||
- "/bin/sh" | ||
- "-c" | ||
- "/codis/bin/codis-admin --dashboard=${DASHBOARD_ADDR} --remove-proxy --addr=${POD_IP}:11080 1>/dev/null 2>&1" |
Oops, something went wrong.