Skip to content

Commit

Permalink
Merge branch 'master' into FixErrorLog
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielZhangQD authored Aug 2, 2022
2 parents 31e3ffd + af0fda7 commit 9b906a5
Show file tree
Hide file tree
Showing 62 changed files with 7,402 additions and 4,733 deletions.
2 changes: 1 addition & 1 deletion charts/tidb-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ services:
type: ClusterIP

discovery:
image: pingcap/tidb-operator:v1.3.6
image: pingcap/tidb-operator:v1.3.7
imagePullPolicy: IfNotPresent
resources:
limits:
Expand Down
4 changes: 2 additions & 2 deletions charts/tidb-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ rbac:
timezone: UTC

# operatorImage is TiDB Operator image
operatorImage: pingcap/tidb-operator:v1.3.6
operatorImage: pingcap/tidb-operator:v1.3.7
imagePullPolicy: IfNotPresent
# imagePullSecrets: []

# tidbBackupManagerImage is tidb backup manager image
tidbBackupManagerImage: pingcap/tidb-backup-manager:v1.3.6
tidbBackupManagerImage: pingcap/tidb-backup-manager:v1.3.7

#
# Enable or disable tidb-operator features:
Expand Down
2 changes: 1 addition & 1 deletion deploy/aliyun/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ variable "bastion_cpu_core_count" {

variable "operator_version" {
type = string
default = "v1.3.6"
default = "v1.3.7"
}

variable "operator_helm_values" {
Expand Down
2 changes: 1 addition & 1 deletion deploy/aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ variable "eks_version" {

variable "operator_version" {
description = "TiDB operator version"
default = "v1.3.6"
default = "v1.3.7"
}

variable "operator_values" {
Expand Down
2 changes: 1 addition & 1 deletion deploy/gcp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ variable "tidb_version" {
}

variable "tidb_operator_version" {
default = "v1.3.6"
default = "v1.3.7"
}

variable "tidb_operator_chart_version" {
Expand Down
111 changes: 110 additions & 1 deletion docs/api-references/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,20 @@ This field is is only honored by clusters that enables the EvenPodsSpread featur
All topologySpreadConstraints are ANDed.</p>
</td>
</tr>
<tr>
<td>
<code>suspendAction</code></br>
<em>
<a href="#suspendaction">
SuspendAction
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>SuspendAction defines the suspend actions for all component.</p>
</td>
</tr>
</table>
</td>
</tr>
Expand Down Expand Up @@ -1889,6 +1903,20 @@ This field is is only honored by clusters that enables the EvenPodsSpread featur
All topologySpreadConstraints are ANDed.</p>
</td>
</tr>
<tr>
<td>
<code>suspendAction</code></br>
<em>
<a href="#suspendaction">
SuspendAction
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>SuspendAction defines the suspend actions for all component.</p>
</td>
</tr>
</table>
</td>
</tr>
Expand Down Expand Up @@ -4191,6 +4219,9 @@ BatchDeleteOption
<p>
<p>CleanPolicyType represents the clean policy of backup data in remote storage</p>
</p>
<h3 id="cluster">Cluster</h3>
<p>
</p>
<h3 id="clusterref">ClusterRef</h3>
<p>
(<em>Appears on:</em>
Expand Down Expand Up @@ -4638,7 +4669,13 @@ Note that the following env names cannot be used and will be overridden by TiDB
</td>
<td>
<em>(Optional)</em>
<p>Additional containers of the component.</p>
<p>Additional containers of the component.
If the container names in this field match with the ones generated by
TiDB Operator, the container configurations will be merged into the
containers generated by TiDB Operator via strategic merge patch.
If the container names in this field do not match with the ones
generated by TiDB Operator, the container configurations will be
appended to the Pod container spec directly.</p>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -4761,6 +4798,20 @@ This field is is only honored by clusters that enables the EvenPodsSpread featur
All topologySpreadConstraints are ANDed.</p>
</td>
</tr>
<tr>
<td>
<code>suspendAction</code></br>
<em>
<a href="#suspendaction">
SuspendAction
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>SuspendAction defines the suspend actions for all component.</p>
</td>
</tr>
</tbody>
</table>
<h3 id="componentstatus">ComponentStatus</h3>
Expand Down Expand Up @@ -5570,6 +5621,20 @@ This field is is only honored by clusters that enables the EvenPodsSpread featur
All topologySpreadConstraints are ANDed.</p>
</td>
</tr>
<tr>
<td>
<code>suspendAction</code></br>
<em>
<a href="#suspendaction">
SuspendAction
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>SuspendAction defines the suspend actions for all component.</p>
</td>
</tr>
</tbody>
</table>
<h3 id="dmclusterstatus">DMClusterStatus</h3>
Expand Down Expand Up @@ -13874,6 +13939,36 @@ StorageVolumeName
</tr>
</tbody>
</table>
<h3 id="suspendaction">SuspendAction</h3>
<p>
(<em>Appears on:</em>
<a href="#componentspec">ComponentSpec</a>,
<a href="#dmclusterspec">DMClusterSpec</a>,
<a href="#tidbclusterspec">TidbClusterSpec</a>)
</p>
<p>
<p>SuspendAction defines the suspend actions for a component.</p>
</p>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>suspendStatefulSet</code></br>
<em>
bool
</em>
</td>
<td>
</td>
</tr>
</tbody>
</table>
<h3 id="tlscluster">TLSCluster</h3>
<p>
(<em>Appears on:</em>
Expand Down Expand Up @@ -22070,6 +22165,20 @@ This field is is only honored by clusters that enables the EvenPodsSpread featur
All topologySpreadConstraints are ANDed.</p>
</td>
</tr>
<tr>
<td>
<code>suspendAction</code></br>
<em>
<a href="#suspendaction">
SuspendAction
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>SuspendAction defines the suspend actions for all component.</p>
</td>
</tr>
</tbody>
</table>
<h3 id="tidbclusterstatus">TidbClusterStatus</h3>
Expand Down
48 changes: 48 additions & 0 deletions examples/podpatch/README.md
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"
```
64 changes: 64 additions & 0 deletions examples/podpatch/tidb-cluster.yaml
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: {}
35 changes: 35 additions & 0 deletions examples/podpatch/tidb-monitor.yaml
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"
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ require (
github.com/pingcap/errors v0.11.0
github.com/pingcap/kvproto v0.0.0-20200927054727-1290113160f0
github.com/pingcap/tidb v2.1.0-beta+incompatible
github.com/pingcap/tidb-operator/pkg/apis v1.3.6
github.com/pingcap/tidb-operator/pkg/client v1.3.6
github.com/pingcap/tidb-operator/pkg/apis v1.3.7
github.com/pingcap/tidb-operator/pkg/client v1.3.7
github.com/prometheus/client_golang v1.7.1
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.26.0
Expand Down
4 changes: 2 additions & 2 deletions hack/bump-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
fi

# parameters
OPERATOR_OLD="v1\.3\.5"
OPERATOR_NEW="v1\.3\.6"
OPERATOR_OLD="v1\.3\.6"
OPERATOR_NEW="v1\.3\.7"
TIDB_OLD="v5\.4\.0"
TIDB_NEW="v5\.4\.1"
DM_OLD="v5.4.0"
Expand Down
Loading

0 comments on commit 9b906a5

Please sign in to comment.