

Once connected, we can collect the endpoint details.
#Aws qwiki labs iam roles how to#
In the documentation we will find how to connect to the cluster using oc CLI in more detail. We will now use the oc CLI to connect to the ROSA cluster and get the existing OIDC endpoint details. $ export APP_SERVICE_ACCOUNT_NAME=iam-app-$SERVICE-sa Step 2. $ export AWS_ACCOUNT_ID=$(aws sts get-caller-identity -query Account -output text) To do this, we are going to create a set of variables for items that will be reused later, then connect to the OpenShift cluster using the oc CLI. We are going to reuse the existing OIDC endpoint created during the ROSA STS cluster deployment. For more detail on how to provision a ROSA cluster using STS, see the documentation. The guide will not walk through the creation of a ROSA cluster with STS enabled. In the following section, we demonstrate how ROSA with STS enabled can use IAM roles for service accounts to provide access for a Kubernetes pod to an Amazon Simple Storage Service (Amazon S3) bucket. We can also get better auditing, having access and event logging available through AWS CloudTrail.

Using IRSA has the benefit of using the least privileged recommendation and credential isolations, meaning that the container within the pod can only retrieve credentials for the IAM role associated with the service account to which the pod belongs. IRSA allows us to associate an IAM role with a Kubernetes service account, which can then be used by pods for authentication and fine-grained permissions. In this blog post, we will discuss how to use the OIDC identity provider created during cluster installation and use it with IAM roles for service accounts (IRSA). The operator IAM roles and endpoint are mapped to OpenShift resources within the ROSA cluster and use the OIDC to authenticate. During cluster creation, the operator IAM roles and the OpenID Connect (OIDC) identity provider are created. This will be discussed in greater detail later. PODs can request and pass this token to the AWS STS AssumeRoleWithWebIdentityAPI operation and receive temporary IAM role credentials.Ĭurrently, you can create a ROSA cluster using the AWS STS service, using the rosa create cluster -sts option. This feature allows customers to authenticate AWS API calls with supported identity providers and receive a valid OIDC JSON web token (JWT). IAM supports federated identities using an OpenID Connect (OIDC) identity provider. When the temporary credentials expire, the user can simply request new ones. The temporary security credentials work exactly like regular long-term security access key credentials allocated to IAM users, except the lifecycle of the access credentials is shorter. Additionally, the temporary credentials are not stored with the user and instead are generated dynamically and provided to the user on demand. ROSA users can allocate administrative permissions on demand. ROSA has recently been integrated with the AWS Security Token Service (AWS STS). AWS STS is an AWS service that allows AWS users, authenticated via AWS Identity and Access Management (IAM) or Federation, to request temporary security credentials for your AWS resources. This relieves customers of cluster lifecycle management, allowing them to focus on building applications rather than maintaining the OpenShift clusters. Red Hat OpenShift Service on AWS (ROSA) is a fully managed OpenShift service, jointly supported by both Red Hat and Amazon Web Services (AWS) and managed by the Red Hat SRE team.
