apiVersion: apps/v1
kind: Deployment
metadata:
  name: deploy-db2
  namespace: sample
spec:
  replicas: 1
  selector:
    matchLabels:
      app: sample
  template:
    metadata:
      labels:
        app: sample
    spec:
      volumes:
      - name: db2-volume
        emptyDir: {}
      containers:
        - name: db
          image: ibmcom/db2
          ports:
            - containerPort: 50000
          env:
            - name: "LICENSE"
              value: "accept"
            - name: "DB2INST1_PASSWORD"
              value: "admin123"
            - name: "DBNAME"
              value: "testdb"
          securityContext:
            privileged: true
          volumeMounts:
            - mountPath: /database
              name: db2-volume
