[K8S] How add AWS permission to a K8S service

Tags
k8s
Engineering
Created
Nov 16, 2023 03:43 AM
Edited
Nov 15, 2023
Description

Associate IAM role with K8S service

EKS

EC2 or other kinds of instances/VM/Machines

Update annotations in deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  replicas: 3
  template:
    metadata:
      annotations:
        iam.amazonaws.com/role: role-arn
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.9.1
        ports:
        - containerPort: 80

Source