# 2021-11-19-15:57:50+0800 Add nodelalloc,noatime mount optionfor prestolab tikv disk

- Cause: Increase disk perf
- Operation:
1. Find the node where the tikv pod is located
```bash
kubectl get pod -o wide | grep tikv
```
2. Use jumper ssh to node
```bash
nodeName=<node-name-you-want-to-login>
cat <<EOF > jumper.yaml
apiVersion: v1
kind: Pod
metadata:
  name: jumper
spec:
  nodeSelector:
    kubernetes.io/hostname: ${nodeName}
  tolerations:
  - operator: Exists
    effect: NoSchedule
  containers:
  - name: busybox
    image: busybox
    stdin: true
    securityContext:
      privileged: true
    volumeMounts:
    - name: host-root-volume
      mountPath: /host
      readOnly: true
  volumes:
  - name: host-root-volume
    hostPath:
      path: /
  hostNetwork: true
  hostPID: true
  restartPolicy: Never
  EOF
kubectl apply -f jumper.yaml
kubectl exec -it jumper sh
chroot /host
```
3. Use `df` or `cat /proc/mounts` show mount info, tikv disk size should 1Ti

4. Remount tikv disk by `mount -o remount,nodelalloc,noatime <device-path> <tikv-path>`

```bash
mount -o remount,nodelalloc,noatime /dev/nvme1n1 /var/lib/kubelet/plugins/kubernetes.io/csi/pv/pv-shoot--staging--c970acae-150a0b07-0fb2-45f0-8fff-c1663240d187/globalmount
```

show result, will have `nodelalloc,noatime` option in mount info
```bash
findmnt |grep /dev/nvme1n1
```
5. Edit storageclass to add mount options
```yaml
allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: tikv-gp3
mountOptions:
- nodelalloc
- noatime
parameters:
  csi.storage.k8s.io/fstype: ext4
  encrypted: "true"
  iops: "4000"
  throughput: "400"
  type: gp3
provisioner: ebs.csi.aws.com
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
```

- Impact:
tikv disk wll add nodelalloc,noatime mount option
- Recovery operation: NONE
- Time window: 2021-11-19 16:30 ~ 17:00 CST
