增加 Pod 磁盘大小

时间:2021-04-26 13:05:45

标签: kubernetes amazon-eks

我有一个 k8s 部署,需要大型 ssd 本地存储来实现高性能文件读/写。连接到集群的所有节点都有大 ssd 卷 (350GB)。这是

apiVersion: apps/v1
kind: Deployment
metadata:
  annotations: {}
  labels:
    name: main
  name: main
  namespace: fileaccessor
spec:
  minReadySeconds: 30
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      name: main
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      annotations: {}
      labels:
        name: main
    spec:
      containers:
        - args: []
          command:
            - /app/fileaccessor
          env: []
          image: ----:fileaccessor
          imagePullPolicy: IfNotPresent
          name: main
          ports: []
          resources:
            requests:
              cpu: "2"
          stdin: false
          tty: false
          volumeMounts: []
      imagePullSecrets: []
      initContainers: []
      serviceAccountName: fileaccessor
      terminationGracePeriodSeconds: 30
      volumes: []

Pod 启动后,我登录并检查磁盘。它只有 20GB 的磁盘大小。

bash-5.0# df -h
Filesystem                Size      Used Available Use% Mounted on
overlay                  20.0G     17.7G      2.3G  88% /
tmpfs                    64.0M         0     64.0M   0% /dev
tmpfs                    15.5G         0     15.5G   0% /sys/fs/cgroup
/dev/nvme0n1p1           20.0G     17.7G      2.3G  88% /dev/termination-log
/dev/nvme0n1p1           20.0G     17.7G      2.3G  88% /etc/resolv.conf
/dev/nvme0n1p1           20.0G     17.7G      2.3G  88% /etc/hostname
/dev/nvme0n1p1           20.0G     17.7G      2.3G  88% /etc/hosts
shm                      64.0M         0     64.0M   0% /dev/shm
tmpfs                    15.5G     12.0K     15.5G   0% /run/secrets/kubernetes.io/serviceaccount
tmpfs                    15.5G      4.0K     15.5G   0% /run/secrets/eks.amazonaws.com/serviceaccount
tmpfs                    15.5G         0     15.5G   0% /proc/acpi
tmpfs                    64.0M         0     64.0M   0% /proc/kcore
tmpfs                    64.0M         0     64.0M   0% /proc/keys
tmpfs                    64.0M         0     64.0M   0% /proc/latency_stats
tmpfs                    64.0M         0     64.0M   0% /proc/timer_list
tmpfs                    64.0M         0     64.0M   0% /proc/sched_debug
tmpfs                    15.5G         0     15.5G   0% /sys/firmware

我在 Internet 上进行了一些搜索,但没有找到任何不指定卷来增加 pod 磁盘大小的方法。我是否必须指定本地卷才能获得更大的尺寸? 同样用于部署,是否可以使用卷挂载?似乎大多数示例都是针对 Pod 的。

0 个答案:

没有答案