Obtaining kubeconfig on AWS

Follow the guidelines for obtaining kubeconfig on AWS.

You need the user's Amazon Resource Name (ARN) to obtain the kubeconfig file. You can get the ARN from the user or look up a user's ARN in your AWS account. To obtain a user's ARN from the AWS account, complete the following steps:

  1. Obtain the Amazon Resource Name (ARN) .
    1. Using AWS UI, go to your organization's AWS Account > Identity and Access Management (IAM) > Users and look up the user. The ARN is available on the Summary page.
    2. Using AWS CLI, run the following command to get the ARN:
      $ aws sts get-caller-identity

      Consider the following example:

      # Sample output
      {
      "UserId": "ABCDE12345FGHIJKLMNO6789",
      "Account": "888888888888",
      "Arn": "arn:aws:iam::888888888888:user/joesmith"
      }
      
  2. Obtain your Cloudera AI Inference service CRN, run the following command:
    $ cdp ml list-ml-serving-apps
  3. Grant access to the Cloudera AI Inference service AWS cluster, run the following command:
    $ cdp ml grant-ml-serving-app-access \
      --resource-crn [***APPLICATION-CRN***] \
      --identifier [***AWS_ARN***]
  4. Obtain the kubeconfig used to access the above cluster by running:
    $ cdp ml get-ml-serving-app-kubeconfig \
      --app-crn [***APPLICATION-CRN***] \
      | jq '.kubeconfig' | yq > myconfig.yaml
  5. Send the downloaded Kubernetes configuration file to the user who has been granted access. To connect to the Amazon EKS cluster, you must have aws-iam-authenticator installed.
  6. Optional: Get the logs of the Cloudera AI Inference service API server:
    $ KUBECONFIG=myconfig.yaml kubectl get logs deployment/api -n cml-serving