Skip to content

Commit

Permalink
Merge branch 'graceful-stop-tidb' of https://github.com/weekface/tidb…
Browse files Browse the repository at this point in the history
…-operator into graceful-stop-tidb
  • Loading branch information
weekface committed Jul 1, 2020
2 parents 89c0a37 + 71452e7 commit 65fc736
Show file tree
Hide file tree
Showing 51 changed files with 2,305 additions and 308 deletions.
2 changes: 1 addition & 1 deletion charts/tidb-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ tidb:
# the start argument to specify the folder containing
directory: /plugins
# the start argument to specify the plugin id (name "-" version) that needs to be loaded, e.g. 'conn_limit-1'.
list: ["whitelist-1"]
list: ["allowlist-1"]

# Whether enable TLS connection between TiDB server and MySQL client.
# https://pingcap.com/docs/stable/how-to/secure/enable-tls-clients/
Expand Down
2 changes: 1 addition & 1 deletion cmd/controller-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func main() {
tidbInitController := tidbinitializer.NewController(kubeCli, cli, genericCli, informerFactory, kubeInformerFactory)
tidbMonitorController := tidbmonitor.NewController(kubeCli, genericCli, cli, informerFactory, kubeInformerFactory)
tidbGroupController := tidbgroup.NewController(kubeCli, cli, informerFactory, kubeInformerFactory)
tikvGroupController := tikvgroup.NewController(kubeCli, cli, informerFactory, kubeInformerFactory)
tikvGroupController := tikvgroup.NewController(kubeCli, cli, genericCli, informerFactory, kubeInformerFactory)

var periodicityController *periodicity.Controller
if controller.PodWebhookEnabled {
Expand Down
2 changes: 1 addition & 1 deletion docs/api-references/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"TmpPath",
"DisplayName",
"DefaultProfile",
"Path",
"FlashDataPath",
"ListenHost",
"TCPPort",
"HTTPPort",
Expand Down
167 changes: 163 additions & 4 deletions docs/api-references/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1933,6 +1933,19 @@ string
default to current tidb cluster version, for example: v3.0.15</p>
</td>
</tr>
<tr>
<td>
<code>additionalContainers</code></br>
<em>
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/#container-v1-core">
[]Kubernetes core/v1.Container
</a>
</em>
</td>
<td>
<em>(Optional)</em>
</td>
</tr>
</table>
</td>
</tr>
Expand Down Expand Up @@ -3704,6 +3717,19 @@ bool
<em>(Optional)</em>
</td>
</tr>
<tr>
<td>
<code>disable-telemetry</code></br>
<em>
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>When not disabled, usage data will be sent to PingCAP for improving user experience.
Optional: Defaults to false</p>
</td>
</tr>
</tbody>
</table>
<h3 id="discoveryspec">DiscoverySpec</h3>
Expand Down Expand Up @@ -3824,6 +3850,17 @@ int32
</tr>
<tr>
<td>
<code>path</code></br>
<em>
string
</em>
</td>
<td>
<p>Path indicates the external service&rsquo;s path</p>
</td>
</tr>
<tr>
<td>
<code>tlsSecret</code></br>
<em>
<a href="#secretref">
Expand Down Expand Up @@ -4066,6 +4103,18 @@ string
</tr>
<tr>
<td>
<code>path</code></br>
<em>
string
</em>
</td>
<td>
<p>Path is the full path where the backup is saved.
The format of the path must be: &ldquo;<bucket-name>/<path-to-backup-file>&rdquo;</p>
</td>
</tr>
<tr>
<td>
<code>bucket</code></br>
<em>
string
Expand Down Expand Up @@ -4232,6 +4281,38 @@ IngressSpec
</tr>
</tbody>
</table>
<h3 id="groupref">GroupRef</h3>
<p>
(<em>Appears on:</em>
<a href="#tidbclusterstatus">TidbClusterStatus</a>)
</p>
<p>
</p>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>Reference</code></br>
<em>
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/#localobjectreference-v1-core">
Kubernetes core/v1.LocalObjectReference
</a>
</em>
</td>
<td>
<p>
(Members of <code>Reference</code> are embedded into this type.)
</p>
</td>
</tr>
</tbody>
</table>
<h3 id="helperspec">HelperSpec</h3>
<p>
(<em>Appears on:</em>
Expand Down Expand Up @@ -4739,6 +4820,17 @@ Optional: Default to plaintext
optional</p>
</td>
</tr>
<tr>
<td>
<code>path</code></br>
<em>
string
</em>
</td>
<td>
<p>Text file containing the key in hex form, end with &lsquo;\n&rsquo;</p>
</td>
</tr>
</tbody>
</table>
<h3 id="masterkeykmsconfig">MasterKeyKMSConfig</h3>
Expand Down Expand Up @@ -8158,6 +8250,18 @@ string
</tr>
<tr>
<td>
<code>path</code></br>
<em>
string
</em>
</td>
<td>
<p>Path is the full path where the backup is saved.
The format of the path must be: &ldquo;<bucket-name>/<path-to-backup-file>&rdquo;</p>
</td>
</tr>
<tr>
<td>
<code>bucket</code></br>
<em>
string
Expand Down Expand Up @@ -9680,8 +9784,8 @@ bool
</em>
</td>
<td>
<p>imported from v3.1.0
optional</p>
<em>(Optional)</em>
<p>imported from v3.1.0</p>
</td>
</tr>
<tr>
Expand All @@ -9692,8 +9796,24 @@ uint64
</em>
</td>
<td>
<p>imported from v3.1.0
optional</p>
<em>(Optional)</em>
<p>imported from v3.1.0</p>
</td>
</tr>
<tr>
<td>
<code>enable-telemetry</code></br>
<em>
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>When enabled, usage data (for example, instance versions) will be reported to PingCAP periodically for user experience analytics.
If this config is set to <code>false</code> on all TiDB servers, telemetry will be always disabled regardless of the value of the global variable <code>tidb_enable_telemetry</code>.
See PingCAP privacy policy for details: <a href="https://pingcap.com/en/privacy-policy/">https://pingcap.com/en/privacy-policy/</a>.
Imported from v4.0.2.
Optional: Defaults to true</p>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -15936,6 +16056,32 @@ TidbClusterAutoScalerRef
<p>Represents the latest available observations of a tidb cluster&rsquo;s state.</p>
</td>
</tr>
<tr>
<td>
<code>tikv-groups</code></br>
<em>
<a href="#groupref">
[]GroupRef
</a>
</em>
</td>
<td>
<em>(Optional)</em>
</td>
</tr>
<tr>
<td>
<code>tidb-groups</code></br>
<em>
<a href="#groupref">
[]GroupRef
</a>
</em>
</td>
<td>
<em>(Optional)</em>
</td>
</tr>
</tbody>
</table>
<h3 id="tidbinitializerspec">TidbInitializerSpec</h3>
Expand Down Expand Up @@ -16413,6 +16559,19 @@ string
default to current tidb cluster version, for example: v3.0.15</p>
</td>
</tr>
<tr>
<td>
<code>additionalContainers</code></br>
<em>
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/#container-v1-core">
[]Kubernetes core/v1.Container
</a>
</em>
</td>
<td>
<em>(Optional)</em>
</td>
</tr>
</tbody>
</table>
<h3 id="tidbmonitorstatus">TidbMonitorStatus</h3>
Expand Down
37 changes: 37 additions & 0 deletions examples/monitor-with-thanos/tidb-monitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: pingcap.com/v1alpha1
kind: TidbMonitor
metadata:
name: basic
spec:
clusters:
- name: basic
prometheus:
baseImage: prom/prometheus
version: v2.11.1
grafana:
baseImage: grafana/grafana
version: 6.0.1
initializer:
baseImage: pingcap/tidb-monitor-initializer
version: v3.0.13
reloader:
baseImage: pingcap/tidb-monitor-reloader
version: v1.0.1
imagePullPolicy: IfNotPresent
additionalContainers:
- name: thanos
image: quay.io/thanos/thanos:v0.8.1
args:
- sidecar
- --prometheus.url=http://localhost:9090/
- --tsdb.path=/data/prometheus
- --grpc-address=[$(POD_IP)]:10901
- --http-address=[$(POD_IP)]:10902
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath:status.podIP
volumeMounts:
- name: monitor-data
mountPath: /data
2 changes: 1 addition & 1 deletion hack/kind-cluster-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ NOTE: In kind, nodes run docker network and cannot access host network.
If you configured local HTTP proxy in your docker, images may cannot be pulled
because http proxy is inaccessible.
If you cannot remove http proxy settings, you can either whitelist image
If you cannot remove http proxy settings, you can either allowlist image
domains in NO_PROXY environment or use 'docker pull <image> && $KIND_BIN load
docker-image <image>' command to load images into nodes.
EOF
3 changes: 2 additions & 1 deletion images/tidb-backup-manager/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ RUN \
wget -nv https://download.pingcap.org/tidb-toolkit-${TOOLKIT_V40}-linux-amd64.tar.gz \
&& tar -xzf tidb-toolkit-${TOOLKIT_V40}-linux-amd64.tar.gz \
&& mv tidb-toolkit-${TOOLKIT_V40}-linux-amd64/bin/br /usr/local/bin/br40 \
&& chmod 755 /usr/local/bin/br40 \
&& mv tidb-toolkit-${TOOLKIT_V40}-linux-amd64/bin/mydumper /mydumper \
&& chmod 755 /usr/local/bin/br40 /mydumper \
&& rm -rf tidb-toolkit-${TOOLKIT_V40}-linux-amd64.tar.gz \
&& rm -rf tidb-toolkit-${TOOLKIT_V40}-linux-amd64

Expand Down
Loading

0 comments on commit 65fc736

Please sign in to comment.