fetch-rcadmin.sh.j2 700 B

123456789101112131415161718192021
  1. #!/bin/bash
  2. set -e
  3. get_cluster_cmd='{{K3S_CMDLINE_PREFIX}} kubectl get oc -n onecloud default'
  4. endpoint=$($get_cluster_cmd -o jsonpath='{.spec.loadBalancerEndpoint}')
  5. keystone_port=$($get_cluster_cmd -o jsonpath='{.spec.keystone.adminService.nodePort}')
  6. admin_password=$($get_cluster_cmd -o jsonpath='{.spec.keystone.bootstrapPassword}')
  7. region=$($get_cluster_cmd -o jsonpath='{.spec.region}')
  8. auth_url="https://$endpoint:$keystone_port/v3"
  9. echo "export OS_AUTH_URL=$auth_url
  10. export OS_USERNAME=sysadmin
  11. export OS_PASSWORD=$admin_password
  12. export OS_PROJECT_DOMAIN=default
  13. export OS_PROJECT_NAME=system
  14. export YUNION_INSECURE=true
  15. export OS_REGION_NAME=$region
  16. export OS_ENDPOINT_TYPE=publicURL"