|
| 1 | +--- |
| 2 | +partial_category: eks-pod-identity |
| 3 | +partial_name: eks-pod-identity-prerequisites |
| 4 | +--- |
| 5 | + |
| 6 | +- Self-hosted Palette or Palette VerteX deployed on an Amazon EKS cluster with Kubernetes version 1.24 or later. |
| 7 | + |
| 8 | + - The Palette or Palette VerteX stack must be deployed on |
| 9 | + [managed node groups](https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html), and not |
| 10 | + self-managed nodes. This is required to obtain the cluster name using Instance Metadata Service (IMDS). |
| 11 | + |
| 12 | + - The EKS Pod Identity Agent must be enabled on the Amazon EKS cluster. Refer to the |
| 13 | + [Set up the Amazon EKS Pod Identity Agent](https://docs.aws.amazon.com/eks/latest/userguide/pod-id-agent-setup.html) |
| 14 | + guide for more information. |
| 15 | + |
| 16 | +- Access to the Amazon EKS cluster's kubeconfig file. You must be able to use `kubectl` to perform validation steps on |
| 17 | + the cluster. |
| 18 | + |
| 19 | +- A Palette account with [tenant admin](/tenant-settings/) access. |
| 20 | + |
| 21 | +- Three [IAM roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user.html) must be created for |
| 22 | + Palette. This includes Palette itself and two of its services. The following table lists the IAM roles that must be |
| 23 | + created. |
| 24 | + |
| 25 | + | Service | IAM Role Name Example | |
| 26 | + | ------------------------ | -------------------------- | |
| 27 | + | Palette | `SpectroCloudRole` | |
| 28 | + | Palette Hubble service | `SpectroCloudHubbleRole` | |
| 29 | + | Palette identity service | `SpectroCloudIdentityRole` | |
| 30 | + |
| 31 | + - The following trust policy must be assigned to all of the IAM roles created for Palette and the two services. This |
| 32 | + trust policy is the same as outlined in the |
| 33 | + [Amazon EKS documentation](https://docs.aws.amazon.com/eks/latest/userguide/pod-id-association.html#pod-id-association-create). |
| 34 | + |
| 35 | + ```json |
| 36 | + { |
| 37 | + "Version": "2012-10-17", |
| 38 | + "Statement": [ |
| 39 | + { |
| 40 | + "Sid": "AllowEksAuthToAssumeRoleForPodIdentity", |
| 41 | + "Effect": "Allow", |
| 42 | + "Principal": { |
| 43 | + "Service": "pods.eks.amazonaws.com" |
| 44 | + }, |
| 45 | + "Action": ["sts:AssumeRole", "sts:TagSession"] |
| 46 | + } |
| 47 | + ] |
| 48 | + } |
| 49 | + ``` |
| 50 | + |
| 51 | + - The [required IAM policies](/clusters/public-cloud/aws/required-iam-policies/) must be assigned to the IAM role created for Palette (for |
| 52 | + example, `SpectroCloudRole`). |
| 53 | + |
| 54 | + - The following policies must be assigned to the IAM role created for the Palette Hubble service (for example, |
| 55 | + `SpectroCloudHubbleRole`). |
| 56 | + |
| 57 | + ```json |
| 58 | + { |
| 59 | + "Version": "2012-10-17", |
| 60 | + "Statement": [ |
| 61 | + { |
| 62 | + "Sid": "AllowIAMValidation", |
| 63 | + "Effect": "Allow", |
| 64 | + "Action": [ |
| 65 | + "iam:GetRole", |
| 66 | + "iam:ListAttachedRolePolicies", |
| 67 | + "iam:ListRolePolicies", |
| 68 | + "iam:GetRolePolicy", |
| 69 | + "iam:GetPolicy", |
| 70 | + "iam:GetPolicyVersion" |
| 71 | + ], |
| 72 | + "Resource": "*" |
| 73 | + }, |
| 74 | + { |
| 75 | + "Sid": "AllowEC2Describe", |
| 76 | + "Effect": "Allow", |
| 77 | + "Action": [ |
| 78 | + "ec2:DescribeRegions", |
| 79 | + "ec2:DescribeAvailabilityZones", |
| 80 | + "ec2:DescribeVpcs", |
| 81 | + "ec2:DescribeSubnets", |
| 82 | + "ec2:DescribeRouteTables", |
| 83 | + "ec2:DescribeKeyPairs" |
| 84 | + ], |
| 85 | + "Resource": "*" |
| 86 | + }, |
| 87 | + { |
| 88 | + "Sid": "AllowEKSDescribe", |
| 89 | + "Effect": "Allow", |
| 90 | + "Action": [ |
| 91 | + "eks:DescribeCluster", |
| 92 | + "eks:ListClusters", |
| 93 | + "eks:DescribeNodegroup", |
| 94 | + "eks:ListNodegroups", |
| 95 | + "eks:DescribeAddon", |
| 96 | + "eks:ListAddons" |
| 97 | + ], |
| 98 | + "Resource": "*" |
| 99 | + }, |
| 100 | + { |
| 101 | + "Sid": "AllowKMSRead", |
| 102 | + "Effect": "Allow", |
| 103 | + "Action": [ |
| 104 | + "kms:ListKeys", |
| 105 | + "kms:ListAliases", |
| 106 | + "kms:DescribeKey", |
| 107 | + "kms:GetKeyPolicy", |
| 108 | + "kms:GetKeyRotationStatus" |
| 109 | + ], |
| 110 | + "Resource": "*" |
| 111 | + } |
| 112 | + ] |
| 113 | + } |
| 114 | + ``` |
| 115 | + |
| 116 | + - The following policies must be assigned to the IAM role created for the Palette identity service (for example, |
| 117 | + `SpectroCloudIdentityRole`). |
| 118 | + |
| 119 | + - Replace `<role-name-for-palette-iam-role>` with the name of the IAM role created for Palette (for example, |
| 120 | + `SpectroCloudRole`). |
| 121 | + |
| 122 | + <br /> |
| 123 | + |
| 124 | + ```json |
| 125 | + { |
| 126 | + "Version": "2012-10-17", |
| 127 | + "Statement": [ |
| 128 | + { |
| 129 | + "Sid": "EKS Pod Identity Management", |
| 130 | + "Effect": "Allow", |
| 131 | + "Action": [ |
| 132 | + "eks:ListPodIdentityAssociations", |
| 133 | + "eks:CreatePodIdentityAssociation", |
| 134 | + "eks:DeletePodIdentityAssociation" |
| 135 | + ], |
| 136 | + "Resource": ["arn:aws:eks:*:*:cluster/*"] |
| 137 | + }, |
| 138 | + { |
| 139 | + "Sid": "IAM PassRole for Pod Identity", |
| 140 | + "Effect": "Allow", |
| 141 | + "Action": ["iam:PassRole"], |
| 142 | + "Resource": ["arn:aws:iam::*:role/<role-name-for-palette-iam-role>"], |
| 143 | + "Condition": { |
| 144 | + "StringLike": { |
| 145 | + "iam:PassedToService": "eks.amazonaws.com" |
| 146 | + } |
| 147 | + } |
| 148 | + } |
| 149 | + ] |
| 150 | + } |
| 151 | + ``` |
| 152 | + |
| 153 | +- The IAM roles created for the Palette Hubble service and Palette identity service must have pod identity associations |
| 154 | + with the following Kubernetes service accounts. |
| 155 | + |
| 156 | + | **Palette Service** | **Kubernetes Namespace** | **Kubernetes Service Account** | |
| 157 | + | ------------------- | ------------------------ | ------------------------------ | |
| 158 | + | Hubble | `hubble-system` | `spectro-hubble` | |
| 159 | + | Identity service | `palette-identity` | `palette-identity` | |
| 160 | + |
| 161 | + <details> |
| 162 | + |
| 163 | + <summary> Click to display example AWS CLI commands to create pod identity associations </summary> |
| 164 | + |
| 165 | + Use the following AWS CLI command to create a pod identity association for the Palette Hubble service. Replace |
| 166 | + `<eks-cluster-name>` with the name of your Amazon EKS cluster, `<aws-account-id>` with your AWS account ID, and |
| 167 | + `<hubble-service-iam-role>` with the name of the IAM role created for the Palette Hubble service (for example, |
| 168 | + `SpectroCloudHubbleRole`). |
| 169 | + |
| 170 | + ```bash |
| 171 | + aws eks create-pod-identity-association \ |
| 172 | + --cluster-name <eks-cluster-name> \ |
| 173 | + --namespace hubble-system \ |
| 174 | + --service-account spectro-hubble \ |
| 175 | + --role-arn arn:aws:iam::<aws-account-id>:role/<hubble-service-iam-role> |
| 176 | + ``` |
| 177 | + |
| 178 | + Similarly, use the following AWS CLI command to create a pod identity association for the Palette identity service. |
| 179 | + Replace `<eks-cluster-name>` with the name of your Amazon EKS cluster, `<aws-account-id>` with your AWS account ID, |
| 180 | + and `<identity-service-iam-role>` with the name of the IAM role created for the Palette identity service (for example, |
| 181 | + `SpectroCloudIdentityRole`). |
| 182 | + |
| 183 | + ```bash |
| 184 | + aws eks create-pod-identity-association \ |
| 185 | + --cluster-name <eks-cluster-name> \ |
| 186 | + --namespace palette-identity \ |
| 187 | + --service-account palette-identity \ |
| 188 | + --role-arn arn:aws:iam::<aws-account-id>:role/<identity-service-iam-role> |
| 189 | + ``` |
| 190 | + |
| 191 | + </details> |
| 192 | + |
| 193 | +- (Optional) If you need your Kubernetes clusters to access AWS resources in different AWS accounts to the one where |
| 194 | + Palette is deployed, you must configure role chaining for EKS Pod Identity. For more information, refer to the |
| 195 | + [Access AWS Resources using EKS Pod Identity Target IAM Roles](https://docs.aws.amazon.com/eks/latest/userguide/pod-id-assign-target-role.html) |
| 196 | + guide. |
0 commit comments