apiVersion: v1
kind: Service
metadata:
  name: webhook-service
  namespace: tidb-operator-stability
  labels:
    app: webhook-service
spec:
  ports:
  - port: 443
    targetPort: 443
  selector:
    app: webhook
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: tidb-operator-stability
subjects:
- kind: ServiceAccount
  namespace: tidb-operator-stability
  name: tidb-operator-stability
roleRef:
  kind: ClusterRole
  name: cluster-admin
  apiGroup: rbac.authorization.k8s.io
---
kind: ServiceAccount
apiVersion: v1
metadata:
  namespace: tidb-operator-stability
  name: tidb-operator-stability
---
apiVersion: v1
kind: Pod
metadata:
  namespace: tidb-operator-stability
  name: tidb-operator-stability
  labels:
    app: webhook
spec:
  serviceAccount: tidb-operator-stability
  containers:
  - name: tidb-operator-stability
    image: ""
    imagePullPolicy: Always
    command:
    - /usr/local/bin/stability-test
    - --config=/etc/tidb-operator-stability/config.yaml
    - --operator-image=pingcap/tidb-operator:v1.1.0-rc.2
    - --operator-tag=v1.1.0-rc.2
    - --slack-webhook-url=""
    volumeMounts:
    - mountPath: /logDir
      name: logdir
    - name: config
      readOnly: true
      mountPath: /etc/tidb-operator-stability
    env:
    - name: MY_NODE_NAME
      valueFrom:
        fieldRef:
          fieldPath: spec.nodeName
    - name: NAMESPACE
      valueFrom:
        fieldRef:
          fieldPath: metadata.namespace
  volumes:
  - name: logdir
    hostPath:
      path: /var/log
      type: Directory
  - name: config
    configMap:
      name: tidb-operator-stability-config
      items:
      - key: config
        path: config.yaml
  restartPolicy: Never
