apiVersion: apps/v1
kind: Deployment
metadata:
  name: test-app-approle
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      com.ovai.application: test
      com.ovai.service: test-app-svc
  template:
    metadata:
      annotations:
        ovai.asaintsever.org/inject: "true"
        ovai.asaintsever.org/auth: "approle"
      labels:
        com.ovai.application: test
        com.ovai.service: test-app-svc
    spec:
      serviceAccountName: default
      initContainers:
        - name: test-app-approle-init
          image: busybox:1.28
          command:
            - "sh"
            - "-c"
            - |
              echo "d65ef3ef-4cb3-74f1-2e9c-b069b6d21e21" > /opt/ovai/secrets/approle_roleid
              echo "840e8694-e7dc-282c-eef8-523e828eacfc" > /opt/ovai/secrets/approle_secretid
      containers:
        - name: test-app-approle
          image: busybox:1.28
          command:
            - "sh"
            - "-c"
            - >
              while true;do echo "My secrets are: $(cat /opt/ovai/secrets/secrets.properties)"; sleep 5; done
