// Aula 14 - Trabalhando com volumes persistentes https://kubernetes.io/docs/concepts/storage/volumes/ https://kubernetes.io/docs/concepts/storage/volumes/#hostpath https://kubernetes.io/docs/concepts/storage/persistent-volumes/ # vim kuard-volume.pod.yaml # Definindo o volume chamado de kuard-data, # montando no path /data # kuard-volume.pod.yaml apiVersion: v1 kind: Pod metadata: name: kuard spec: volumes: - name: "kuard-data" hostPath: path: "/var/lib/kuard" containers: - image: gcr.io/kuar-demo/kuard-amd64:1 name: kuard volumeMounts: - mountPath: "/data" name: "kuard-data" ports: - containerPort: 8080 name: http protocol: TCP # vim pod-kuard-completo.yaml # Arquivo completo do nosso # pod apiVersion: v1 kind: Pod metadata: name: kuard spec: volumes: - name: "kuard-data" nfs: server: my.nfs.server.local path: "/exports" containers: - image: gcr.io/kuar-demo/kuard-amd64:1 name: kuard ports: - containerPort: 8080 name: http protocol: TCP resources: requests: cpu: "500m" memory: "128Mi" limits: cpu: "1000m" memory: "256Mi" volumeMounts: - mountPath: "/data" name: "kuard-data" livenessProbe: httpGet: path: /healthy port: 8080 initialDelaySeconds: 5 timeoutSeconds: 1 periodSeconds: 10 failureThreshold: 3 readinessProbe: httpGet: path: /ready port: 8080 initialDelaySeconds: 30 timeoutSeconds: 1 periodSeconds: 10 failureThreshold: 3 # kubectl apply -f pod-kuard-completo.yaml # kubectl get pods # kubectl delete pods/kuard # kubectl describe pods kuard