---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    io.kompose.service: db
  name: db
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: db
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        io.kompose.service: db
    spec:
      containers:
        - image: mysql
          name: db
          volumeMounts:
            - mountPath: /var/lib/mysql
              name: db-data
      restartPolicy: Always
      volumes:
        - name: db-data
          persistentVolumeClaim:
            claimName: db-data

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  labels:
    io.kompose.service: db-data
  name: db-data
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 100Mi

---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    io.kompose.service: web
  name: web
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: web
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        io.kompose.service: web
    spec:
      containers:
        - image: nginx
          name: web
          volumeMounts:
            - mountPath: /etc/tls
              name: web-cm0
            - mountPath: /etc/test-a-key.key
              name: web-cm1
              subPath: test-a-key.key
      restartPolicy: Always
      volumes:
        - configMap:
            name: web-cm0
          name: web-cm0
        - configMap:
            items:
              - key: a.key
                path: test-a-key.key
            name: web-cm1
          name: web-cm1

---
apiVersion: v1
data:
  a.crt: test-crt-data...
  a.key: test-key-data....
kind: ConfigMap
metadata:
  labels:
    io.kompose.service: web
  name: web-cm0

---
apiVersion: v1
data:
  a.key: test-key-data....
kind: ConfigMap
metadata:
  annotations:
    use-subpath: "true"
  labels:
    io.kompose.service: web
  name: web-cm1

