apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: demo
    aadpodidbinding: demo
  name: demo
  namespace: default
spec:
  selector:
    matchLabels:
      app: demo
  template:
    metadata:
      labels:
        app: demo
        aadpodidbinding: demo
    spec:
      containers:
      - name: demo
        image: "mcr.microsoft.com/oss/azure/aad-pod-identity/demo:v1.7.3"
        imagePullPolicy: Always
        args:
          - "--subscriptionid=SUBSCRIPTION_ID"
          - "--clientid=CLIENT_ID"
          - "--resourcegroup=RESOURCE_GROUP"
          # TO SPECIFY NAME OF RESOURCE TO GRANT TOKEN ADD --aad-resourcename
          # this demo defaults aad-resourcename to https://management.azure.com/
          # e.g. - "--aad-resourcename=https://vault.azure.net"
        env:
        - name: MY_POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: MY_POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: MY_POD_IP
          valueFrom:
            fieldRef:
              fieldPath: status.podIP
      nodeSelector:
        kubernetes.io/os: linux
