0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

PodがNFSマウント中に接続を切ったらどうなるか?

Posted at

PodがNFSの領域をマウントできないとPodは起動できない。ではPodがマウント中にNFSの接続を切ったらPodはどうなるのか?

結論

Podはrunningし続ける。Pod内に入りマウントポイントをlsしても応答が返って来ない。

事前準備

  • EFSのファイルシステムを作成
  • EKSにEFS CSI ドライバーをインストール
  • SC、PVC、PVも作成
  • PodでPVをマウント
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: efs-sc
provisioner: efs.csi.aws.com
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: efs-pv
spec:
  capacity:
    storage: 5Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteOnce
  storageClassName: efs-sc
  persistentVolumeReclaimPolicy: Retain
  csi:
    driver: efs.csi.aws.com
    volumeHandle: fs-045001d08d85dd703
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: efs-claim
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: efs-sc
  resources:
    requests:
      storage: 5Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: nginx
  name: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - image: nginx
        name: nginx
        volumeMounts:
        - name: persistent-storage
          mountPath: /data
      volumes:
      - name: persistent-storage
        persistentVolumeClaim:
          claimName: efs-claim

検証

マウント中にEFSのSGからインバウンド許可を消したら?

PodはRunningし続ける。Pod内に入りマウントポイントをlsしても応答が返って来ない。

マウント中にEFSファイルシステムを削除したら?

PodはRunningし続ける。Pod内に入りマウントポイントをlsしても応答が返って来ない。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?