apiVersion: apps/v1
kind: Deployment
metadata:
  name: mydeploy-1
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      annotations:
        vault.hashicorp.com/agent-inject: "true"
      labels:
        app: myapp
    spec:
      containers:
      - image: vault:1.5.4
        imagePullPolicy: IfNotPresent
        name: vault-agent
        volumeMounts:
        - mountPath: /vault/secrets
          name: vault-secret
      - image: nginx:latest
        name: nginx
      initContainers:
      - image: vault:1.5.4
        imagePullPolicy: IfNotPresent
        name: vault-agent-init
        volumeMounts:
        - mountPath: /vault/secrets
          name: vault-secret
      volumes:
      - emptyDir:
          medium: Memory
        name: vault-secret
