Giriş
Network-Attached Storage(NAS) kavramına bakmak lazım. Açıklaması şöyle. Yani NAS kendi işlemcisi, işletim sistemi olan müstakil bir bilgisayar gibi.Have you ever wondered how businesses shared files and data across computers within a network in the 1980s? They relied on network-attached storage(NAS) - a reliable and efficient way to deliver unstructured data to the network-connected devices using an ethernet connection.
With time, different technologies have become prominent, including cloud storage offering cheap online storage. However, NAS still solves the critical business pain point of intuitively sharing files within an organization.
Kullanılan protokoller şöyle
NAS box supports various protocols for file formatting transferred across the network. These include:
- Network File System(NFS)
- Server Message Blocks(SMB)
- Apple Filing Protocol(AFP)
- Internetwork Packet Exchange
- Common Internet File System(CIFS)
- NetBIOS Extended User Interface
Kullanım
1. Podda kullanmak için volumes ile direkt yüklenebilir. Bu durumda nfs sunucusunun IP adresini belirtmek gerekir.
2. Podda kullanmak için PersistentVolumeClaim ile isim belirtilir
1. Volume Olarak Direkt Kullanma
Örnek
Şöyle yaparız
#Pod definiton with nfs share directory apiVersion: v1 kind: Pod metadata: name: webserver spec: containers: - image: nginx:latest name: nginx-container volumeMounts: - mountPath: /usr/share/nginx/html name: test-vol volumes: - name: test-vol nfs: server: 10.3.97.250 # nfs server ip or dns path: /var/local/nfs-share # nfs share directory
2. NFS'i PersistentVolume Olarak Yaratma
Örnek
Şöyle yaparız
#PV using NFS-Share directory apiVersion: v1 kind: PersistentVolume metadata: name: pv-nfs spec: capacity: storage: 20Gi accessModes: - ReadWriteOnce nfs: path: /var/nfs_server/kubernetes_data server: 10.25.96.6 #IP or DNS of nfs server
Örnek
PersistentVolume yaratılır. Şöyle yaparız
apiVersion: v1kind: PersistentVolumemetadata:name: my-pvspec:capacity:storage: 10GivolumeMode: FilesystemaccessModes:- ReadWriteOncepersistentVolumeReclaimPolicy: RecyclestorageClassName: any-namenfs:path: /testserver: 10.0.0.0
PersistentVolumeClaim yaratılır. Şöyle yaparız
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: my-pvc spec: accessModes: - ReadWriteOnce volumeMode: Filesystem resources: requests: storage: 10Gi storageClassName: any-name
Pod'da kullanmak için şöyle yaparız
apiVersion: v1 kind: Pod metadata: name: pod-with-volume spec: containers: - image: nginx name: pod-with-volume volumeMounts: - mountPath: /data name: my-volume volumes: - name: my-volume persistentVolumeClaim: claimName: my-pvc
Hiç yorum yok:
Yorum Gönder