3.创建从EKS提取指标的role
使用以下内容创建名为 createIRSA-AMPIngest.sh 的文件。将 替换为您集群的名称,并将 替换为您的 Prometheus 命名空间
[code]#!/bin/bash -eCLUSTER_NAME=SERVICE_ACCOUNT_NAMESPACE=AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query "Account" --output text)OIDC_PROVIDER=$(aws eks describe-cluster --name $CLUSTER_NAME --query "cluster.identity.oidc.issuer" --output text | sed -e "s/^https:\/\///")SERVICE_ACCOUNT_AMP_INGEST_NAME=amp-iamproxy-ingest-service-accountSERVICE_ACCOUNT_IAM_AMP_INGEST_ROLE=amp-iamproxy-ingest-roleSERVICE_ACCOUNT_IAM_AMP_INGEST_POLICY=AMPIngestPolicy## Set up a trust policy designed for a specific combination of K8s service account and namespace to sign in from a Kubernetes cluster which hosts the OIDC Idp.#cat