apiVersion: apps/v1
kind: Deployment
metadata:
  name: secretvolumes
  labels:
    app: secretvolumes
spec:
  replicas: 3
  selector:
    matchLabels:
      app: secretvolumes
  template:
    metadata:
      labels:
        app: secretvolumes
    spec:
      containers:
      - name: nginx
        image: nginx
        ports:
        - containerPort: 80
        volumeMounts:
        - name: data
          mountPath: /etc/mount-secret
      volumes:
        - name: data
          secret:
            secretName: sample
            defaultMode: 0400