Boa tarde,
No exemplo da aula, o professor utilizou o GC platform para criar o cluster, o disco, pv, pvc e pod-pv.
Gostaria de saber se existe uma forma de fazer o mesmo lab localmente tuilizando o minikube node.
Eu tentei reproduzir localmente porém recebo o seguinte erro quando tento criar o pod:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 19s default-scheduler Successfully assigned default/pod-pv to minikube
Warning FailedMount 3s (x6 over 19s) kubelet MountVolume.SetUp failed for volume "pv-1" : mount failed: exit status 32
Mounting command: mount
Mounting arguments: -t nfs -o hard,nfsvers=4.1 192.168.99.119:/home/primeiro-volume /var/lib/kubelet/pods/50540a60-fcfe-494a-aba7-6f7a206c97fb/volumes/kubernetes.io~nfs/pv-1
Output: mount.nfs: access denied by server while mounting 192.168.99.119:/home/primeiro-volume
Seguem as definições do pv, pvc e pod-pv respectivamente:
pv.yml
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-1
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
storageClassName: standard
mountOptions:
- hard
- nfsvers=4.1
nfs:
path: /home/primeiro-volume
server: 192.168.99.119
pvc.yml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-1
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
storageClassName: standard
pod-pv.yml
apiVersion: v1
kind: Pod
metadata:
name: pod-pv
labels:
name: pod-pv
spec:
containers:
- name: nginx-container
image: nginx:latest
volumeMounts:
- mountPath: /volume-dentro-do-container
name: primeiro-pv
volumes:
- name: primeiro-pv
persistentVolumeClaim:
claimName: pvc-1
Att, Edvaldo