# VOLUMES IMAGENS
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: permissao-imagens
spec:
accessModes:
- ReadWriteMany
storageClassName: local
resources:
requests:
storage: 1Gi
---
# VOLUME SESSOES
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: permissao-sessao
spec:
accessModes:
- ReadWriteMany
storageClassName: local
resources:
requests:
storage: 1Gi
---
# PODS
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: aplicacao-sistema-statefulset
spec:
serviceName: aplicacao-sistema-statefulset
selector:
matchLabels:
name: aplicacao-sistema-pod-statefulset
template:
metadata:
labels:
name: aplicacao-sistema-pod-statefulset
spec:
containers:
- name: container-aplicacao-sistema-statefulset
image: vnni/noticia-alura:v3
ports:
- containerPort: 80
volumeMounts:
- name: imagens
mountPath: /var/www/html/uploads
- name: sessoes
mountPath: /tmp
volumes:
- name: imagens
emptyDir: {}
#persistentVolumeClaim:
#claimName: permissao-imagens
- name: sessoes
emptyDir: {}
#persistentVolumeClaim:
#claimName: permissao-sessao
---
# Serviço de Cluster
apiVersion: v1
kind: Service
metadata:
name: servico-aplicacao-sistema-statefulset
spec:
type: LoadBalancer
ports:
- name: http
port: 80
nodePort: 31822
selector:
name: aplicacao-sistema-pod-statefulset
Está ai, acabei colocando o emptyDir: {} em volumes e funcionou, porem nao sei se seria uma boa pratica