github.com/Azure/aad-pod-identity@v1.8.17/tutorial/scripts/3-deploy-demo/3-deploy-id-to-k8s.sh (about)

     1  #!/bin/bash
     2  
     3  cd "${0%/*}"
     4  
     5  file="../../../../deploy/demo/aadpodidentity.yaml"
     6  
     7  set -e
     8  
     9  echo "To give the Azure Id to the cluster, update the deploy/aadpodidentity.yaml spec with \
    10  your subscription, clientID, resource group, and type (0=Azure Id, 1=Service Principal). "
    11  
    12  read -p "Press enter to continue"
    13  
    14  set -x
    15  
    16  client_id=$(az identity show -n demo-aad1 -g ${MC_RG} | jq -r .clientId)
    17  resource_id=$(az identity show -n demo-aad1 -g ${MC_RG} | jq -r .id)
    18  
    19  perl -pi -e "s/CLIENT_ID/${client_id}/" ${file}
    20  perl -pi -e "s/RESOURCE_ID/${resource_id//\//\\/}/" ${file}
    21  
    22  kubectl apply -f ${file}