-
Notifications
You must be signed in to change notification settings - Fork 499
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into FixErrorLog
- Loading branch information
Showing
62 changed files
with
7,402 additions
and
4,733 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
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
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,48 @@ | ||
# Container merge patch strategic | ||
|
||
> When users need to apply a specific configuration to containers that we do not support or do not currently exist, merge patch can be used. | ||
> This document describes how to overwrite the container configuration generated by the operator by merging patches. | ||
## How the "strategic merge patch" works | ||
|
||
The operator supports `additionalContainers` field in `TidbCluster.spec.pd`, `TidbCluster.spec.tikv`, `TidbCluster.spec.tidb`,`TidbMonitor.spec` configuration etc. | ||
This field allows injecting additional containers, and the existing configuration can be overwritten by sharing the same container name. | ||
|
||
### Merge patch example of pd pod | ||
|
||
The following manifest merge the `lifecycle` configuration into pd container. | ||
|
||
```yaml | ||
apiVersion: pingcap.com/v1alpha1 | ||
kind: TidbCluster | ||
metadata: | ||
name: basic | ||
spec: | ||
version: v5.4.1 | ||
timezone: UTC | ||
pvReclaimPolicy: Retain | ||
enableDynamicConfiguration: true | ||
configUpdateStrategy: RollingUpdate | ||
discovery: {} | ||
helper: | ||
image: busybox:1.34.1 | ||
pd: | ||
baseImage: pingcap/pd | ||
maxFailoverCount: 0 | ||
replicas: 1 | ||
# if storageClassName is not set, the default Storage Class of the Kubernetes cluster will be used | ||
# storageClassName: local-storage | ||
requests: | ||
storage: "1Gi" | ||
config: {} | ||
additionalContainers: | ||
- name: pd | ||
lifecycle: | ||
preStop: | ||
exec: | ||
command: | ||
- "sh" | ||
- "-c" | ||
- | | ||
echo "test" | ||
``` |
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,64 @@ | ||
# IT IS NOT SUITABLE FOR PRODUCTION USE. | ||
# This YAML describes a basic TiDB cluster with minimum resource requirements, | ||
# which should be able to run in any Kubernetes cluster with storage support. | ||
apiVersion: pingcap.com/v1alpha1 | ||
kind: TidbCluster | ||
metadata: | ||
name: basic | ||
spec: | ||
version: v5.4.1 | ||
timezone: UTC | ||
pvReclaimPolicy: Retain | ||
enableDynamicConfiguration: true | ||
configUpdateStrategy: RollingUpdate | ||
discovery: {} | ||
helper: | ||
image: busybox:1.34.1 | ||
pd: | ||
baseImage: pingcap/pd | ||
maxFailoverCount: 0 | ||
replicas: 1 | ||
# if storageClassName is not set, the default Storage Class of the Kubernetes cluster will be used | ||
# storageClassName: local-storage | ||
requests: | ||
storage: "1Gi" | ||
config: {} | ||
additionalContainers: | ||
- name: pd | ||
lifecycle: | ||
preStop: | ||
exec: | ||
command: | ||
- "sh" | ||
- "-c" | ||
- | | ||
echo "test" | ||
tikv: | ||
baseImage: pingcap/tikv | ||
maxFailoverCount: 0 | ||
# If only 1 TiKV is deployed, the TiKV region leader | ||
# cannot be transferred during upgrade, so we have | ||
# to configure a short timeout | ||
evictLeaderTimeout: 1m | ||
replicas: 1 | ||
# if storageClassName is not set, the default Storage Class of the Kubernetes cluster will be used | ||
# storageClassName: local-storage | ||
requests: | ||
storage: "1Gi" | ||
config: | ||
storage: | ||
# In basic examples, we set this to avoid using too much storage. | ||
reserve-space: "0MB" | ||
rocksdb: | ||
# In basic examples, we set this to avoid the following error in some Kubernetes clusters: | ||
# "the maximum number of open file descriptors is too small, got 1024, expect greater or equal to 82920" | ||
max-open-files: 256 | ||
raftdb: | ||
max-open-files: 256 | ||
tidb: | ||
baseImage: pingcap/tidb | ||
maxFailoverCount: 0 | ||
replicas: 1 | ||
service: | ||
type: ClusterIP | ||
config: {} |
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,35 @@ | ||
apiVersion: pingcap.com/v1alpha1 | ||
kind: TidbMonitor | ||
metadata: | ||
name: basic | ||
spec: | ||
replicas: 1 | ||
clusters: | ||
- name: basic | ||
prometheus: | ||
baseImage: prom/prometheus | ||
version: v2.27.1 | ||
grafana: | ||
baseImage: grafana/grafana | ||
version: 7.5.11 | ||
initializer: | ||
baseImage: pingcap/tidb-monitor-initializer | ||
version: v5.4.1 | ||
reloader: | ||
baseImage: pingcap/tidb-monitor-reloader | ||
version: v1.0.1 | ||
prometheusReloader: | ||
baseImage: quay.io/prometheus-operator/prometheus-config-reloader | ||
version: v0.49.0 | ||
imagePullPolicy: IfNotPresent | ||
additionalContainers: | ||
- name: test | ||
image: busybox:1.34.1 | ||
lifecycle: | ||
preStop: | ||
exec: | ||
command: | ||
- "sh" | ||
- "-c" | ||
- | | ||
echo "test" |
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
Oops, something went wrong.