Skip to content

Instantly share code, notes, and snippets.

@emchristiansen
Created March 24, 2023 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emchristiansen/21713a6a6a77a90fe589589fa9bcaf23 to your computer and use it in GitHub Desktop.
Save emchristiansen/21713a6a6a77a90fe589589fa9bcaf23 to your computer and use it in GitHub Desktop.
apiVersion: pingcap.com/v1alpha1
kind: TidbCluster
metadata:
name: basic
namespace: tidb-cluster
spec:
version: v6.6.0
timezone: UTC
pvReclaimPolicy: Delete
enableDynamicConfiguration: true
configUpdateStrategy: RollingUpdate
discovery: {}
helper:
image: alpine:3.16.0
pd:
baseImage: pingcap/pd
maxFailoverCount: 0
replicas: 3
requests:
storage: "3Gi"
storageClassName: openebs-hostpath
config:
replication:
location-labels: ["zone"]
isolation-level: "zone"
tikv:
baseImage: pingcap/tikv
maxFailoverCount: 0
evictLeaderTimeout: 1m
replicas: 3
requests:
storage: "10Gi"
storageClassName: openebs-hostpath
config:
storage:
reserve-space: "128MB"
block-cache:
capacity: "1GB"
tidb:
baseImage: pingcap/tidb
maxFailoverCount: 0
replicas: 3
service:
type: ClusterIP
config:
tidb:
grpc-compression-type: gzip
initContainers:
- name: add-node-label
image: bitnami/kubectl:1.21.6
command:
- sh
- -c
- |
set -e
echo "Sleeping 10 to avoid race condition"
sleep 10
POD_NAME=$(cat /etc/hostname)
echo $POD_NAME
echo $NODE_NAME
echo $NAMESPACE
kubectl label pods $POD_NAME nodeName=${NODE_NAME} --overwrite -n ${NAMESPACE}
echo "Done"
securityContext:
runAsUser: 0
env:
- name: KUBECONFIG
value: /root/.kube/config
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- name: kubeconfig
mountPath: /root/.kube/config
readOnly: true
subPath: config
additionalVolumes:
- name: kubeconfig
secret:
secretName: kubeconfig
items:
- key: config
path: config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment