Skip to content

Commit 6624d0b

Browse files
authored
removed GitBook styling and moved cloud-integration.json secret creat… (#1191)
1 parent ac7d55f commit 6624d0b

1 file changed

Lines changed: 31 additions & 43 deletions

File tree

install-and-configure/install/cloud-integration/aws-cloud-integrations/aws-cloud-integration-using-irsa.md

Lines changed: 31 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ There are many ways to integrate your AWS Cost and Usage Report (CUR) with Kubec
88

99
If this is not an accurate description of your environment, see our [AWS Cloud Integration](aws-cloud-integrations.md) doc for more options.
1010

11-
{% hint style="info" %}
12-
Kubecost also supports [EKS Pod Identity](https://aws.amazon.com/about-aws/whats-new/2023/11/amazon-eks-pod-identity/) as an alternative to IRSA. To set up EKS Pod Identities, complete steps 1-4 of the below tutorial fully, then follow Step 5 until you are prompted to move to the [optional Step 6](aws-cloud-integration-using-irsa.md#step-6-optional-setting-up-eks-pod-identity) below.
13-
{% endhint %}
11+
> [!NOTE]
12+
>Kubecost also supports [EKS Pod Identity](https://aws.amazon.com/about-aws/whats-new/2023/11/amazon-eks-pod-identity/) as an alternative to IRSA. To set up EKS Pod Identities, complete steps 1-4 of the below tutorial fully, then follow Step 5 until you are prompted to move to the [optional Step 6](aws-cloud-integration-using-irsa.md#step-6-optional-setting-up-eks-pod-identity) below.
13+
1414

1515
## Overview of Kubecost CUR integration
1616

@@ -80,9 +80,9 @@ Follow the [AWS documentation](https://docs.aws.amazon.com/cur/latest/userguide/
8080
![delivery-options](/images/aws-cur/4-delivery-options.png)
8181
</details>
8282

83-
{% hint style="info" %}
84-
If this CUR data is only used by Kubecost, it is safe to expire or delete the objects after seven days of retention.
85-
{% endhint %}
83+
> [!NOTE]
84+
>If this CUR data is only used by Kubecost, it is safe to expire or delete the objects after seven days of retention.
85+
8686

8787
AWS may take up to 24 hours to publish data. Wait until this is complete before continuing to the next step.
8888

@@ -97,9 +97,9 @@ As part of the CUR creation process, Amazon creates a CloudFormation template th
9797

9898
![athena-output-bucket](/images/aws-cur/8-upload-cfn-template.png)
9999

100-
{% hint style="info" %}
101-
Your S3 path prefix can be found by going to your AWS Cost and Usage Reports dashboard and selecting your bucket's report. In the Report details tab, you will find the S3 path prefix.
102-
{% endhint %}
100+
> [!NOTE]
101+
>Your S3 path prefix can be found by going to your AWS Cost and Usage Reports dashboard and selecting your bucket's report. In the Report details tab, you will find the S3 path prefix.
102+
103103

104104
Once Athena is set up with the CUR, you will need to create a *new* S3 bucket for Athena query results. The bucket used for the CUR cannot be used for the Athena output.
105105

@@ -120,9 +120,9 @@ Navigate to Athena in the AWS Console. Be sure the region matches the one used i
120120
* `athenaRegion`: the AWS region value where your Athena query is configured
121121
* `athenaTable`: the partitioned value found in the Table list
122122

123-
{% hint style="info" %}
124-
For Athena query results written to an S3 bucket only accessed by Kubecost, it is safe to expire or delete the objects after one day of retention.
125-
{% endhint %}
123+
> [!NOTE]
124+
>For Athena query results written to an S3 bucket only accessed by Kubecost, it is safe to expire or delete the objects after one day of retention.
125+
126126

127127
### Step 4: Setting up payer account IAM permissions
128128

@@ -134,7 +134,6 @@ In *iam-payer-account-trust-primary-account.json*, replace `SUB_ACCOUNT_22222222
134134

135135
In the same location as your downloaded configuration files, run the following command to create the appropriate policy (`jq` is not required):
136136

137-
{% code overflow="wrap" %}
138137

139138
```bash
140139
aws iam create-role --role-name kubecost-cur-access \
@@ -156,25 +155,24 @@ aws iam put-role-policy --role-name kubecost-cur-access \
156155
--policy-document file://iam-payer-account-cur-athena-glue-s3-access.json
157156
```
158157

159-
Then allow Kubecost to read account tags:
158+
Optional: allow Kubecost to read account tags:
160159

161160
```bash
162161
aws iam put-role-policy --role-name kubecost-cur-access \
163162
--policy-name kubecost-payer-account-list-tags-policy \
164-
--policy-document file://iam-payer-account-list-tags-policy.json
163+
--policy-document file://iam-listAccounts-tags.json
165164
```
166165

167-
{% endcode %}
168166

169167
Now we can obtain the last value `masterPayerARN` for *cloud-integration.json* as the ARN associated with the newly-created IAM role, as seen below in the AWS console:
170168

171169
![ARN](/images/masterPayerARN.png)
172170

173171
### Step 5: Setting up IAM permissions for the primary cluster
174172

175-
{% hint style="warning" %}
176-
By arriving at this step, you should have been able to provide all values to your *cloud-integration.json* file. If any values are missing, reread the tutorial and follow any steps needed to obtain those values.
177-
{% endhint %}
173+
> [!NOTE]
174+
>By arriving at this step, you should have been able to provide all values to your *cloud-integration.json* file. If any values are missing, reread the tutorial and follow any steps needed to obtain those values.
175+
178176

179177
**From the AWS Account where the Kubecost primary cluster will run**
180178

@@ -200,9 +198,14 @@ export CLUSTER_NAME=YOUR_CLUSTER
200198
export AWS_REGION=YOUR_REGION
201199
```
202200

203-
{% hint style="warning" %}
204-
If you are using EKS Pod Identity, skip the rest of Step 5 and continue to [Step 6](aws-cloud-integration-using-irsa.md#step-6-optional-setting-up-eks-pod-identity).
205-
{% endhint %}
201+
Create the secret (in this setup, there are no actual secrets in this file):
202+
203+
```bash
204+
kubectl create secret generic cloud-integration -n kubecost --from-file=cloud-integration.json
205+
```
206+
207+
> [!IMPORTANT]
208+
>If you are using EKS Pod Identity, skip the rest of Step 5 and continue to [Step 6](aws-cloud-integration-using-irsa.md#step-6-optional-setting-up-eks-pod-identity).
206209
207210
Enable the OIDC-Provider:
208211

@@ -229,13 +232,11 @@ Go to the IAM Role and attach the proper IAM trust policy. [Use the sample trust
229232
230233
**Alternative method: Create a new dedicated service account for Kubecost using `eksctl`**
231234

232-
{% hint style="info" %}
233-
This method creates a new service account via eksctl command line tools, instead of using the default service account. Eksctl automatically creates the trust policy and IAM Role that are linked to the new dedicated Kubernetes service account.
234-
{% endhint %}
235+
> [!NOTE]
236+
>This method creates a new service account via eksctl command line tools, instead of using the default service account. Eksctl automatically creates the trust policy and IAM Role that are linked to the new dedicated Kubernetes service account.
235237

236238
Replace `SUB_ACCOUNT_222222222` with the AWS account number where the primary Kubecost cluster will run.
237239

238-
{% code overflow="wrap" %}
239240

240241
```bash
241242
eksctl create iamserviceaccount \
@@ -247,21 +248,8 @@ eksctl create iamserviceaccount \
247248
--approve
248249
```
249250

250-
{% endcode %}
251-
252-
Create the secret (in this setup, there are no actual secrets in this file):
253-
254-
{% code overflow="wrap" %}
255-
256-
```bash
257-
kubectl create secret generic cloud-integration -n kubecost --from-file=cloud-integration.json
258-
```
259-
260-
{% endcode %}
261-
262251
Install Kubecost using the service account and cloud-integration secret:
263252

264-
{% code overflow="wrap" %}
265253

266254
```bash
267255
helm install kubecost \
@@ -272,7 +260,6 @@ helm install kubecost \
272260
--set kubecostProductConfigs.cloudIntegrationSecret=cloud-integration
273261
```
274262

275-
{% endcode %}
276263

277264
Add the following section to your Helm values. This will tell Kubecost to use your newly created service account, instead of creating one.
278265

@@ -284,9 +271,9 @@ serviceAccount:
284271

285272
### Step 6 (optional): Setting up EKS Pod Identity
286273

287-
{% hint style="warning" %}
288-
Your cluster must support [EKS Pod Identities](https://docs.aws.amazon.com/eks/latest/userguide/pod-id-agent-setup.html) to use the method below.
289-
{% endhint %}
274+
> [!IMPORTANT]
275+
>Your cluster must support [EKS Pod Identities](https://docs.aws.amazon.com/eks/latest/userguide/pod-id-agent-setup.html) to use the method below.
276+
290277

291278
Create your pod identity association:
292279

@@ -335,3 +322,4 @@ Defaulted container "cost-model" out of: cost-model, cost-analyzer-frontend
335322
## Troubleshooting
336323

337324
For help with troubleshooting, see the section in our original [AWS integration guide](/install-and-configure/install/cloud-integration/aws-cloud-integrations/aws-cloud-integrations.md#troubleshooting).
325+

0 commit comments

Comments
 (0)