# Copyright 2021 The SODA Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: soda-multi-cloud
  labels:
    io.soda.service: tidb
  name: tidb
spec:
  replicas: 1
  selector:
    matchLabels:
      io.soda.service: tidb
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        io.soda.service: tidb
    spec:
      containers:
        - image: pingcap/tidb:v2.1.16
          name: tidb
          ports:
            - containerPort: 4000
            - containerPort: 10080
          resources: {}
          volumeMounts:
            - mountPath: /etc/config
              name: config-volume
            - mountPath: /tmp/tidb/
              name: tidb-data
          command: ["./tidb-server"]
          args: ["--store=mocktikv","--config=/etc/config/tidb.toml", "-L=info"]
      restartPolicy: Always
      volumes:
        - name: config-volume
          configMap:
            name: tidb-config
        - hostPath:
            path: /root/multi-cloud/tidb_data
            type: DirectoryOrCreate
          name: tidb-data

