feat (operator): add support for IRSA (aws resources access) - #3128
Conversation
|
can you move syncPodServiceAccount into the sync.go file for now so we have it all in one place? In general, it's a good idea to split the code into single files per K8s resource type, but lets do that in a separate PR. |
sure, I moved it to the existing sync.go file in d150b92 |
|
The new option still needs to be documented: https://github.com/zalando/postgres-operator/blob/master/docs/reference/operator_parameters.md#aws-or-gcp-interaction And added to the values.yaml file of the helm chart. And the example config CRD as well as https://github.com/zalando/postgres-operator/blob/master/manifests/configmap.yaml |
…lisms or acronyms
…perator into option-irsa-aws
|
I addressed all the feedback and I updated all the markdown files (even the administrator.md), so please check again @mikkeloscar @FxKu |
|
@tcondeixa build is failing |
sorry, it was a network issues with vendor the module. After a retry in the pipeline the build is working. |
|
👍 |
1 similar comment
|
👍 |
Changes
Add
irsa_role_arnconfig field to enable IRSA (IAM Roles for Service Accounts) as an alternative to kube2iam.Setting
irsa_role_arnto a full IAM role ARN annotates the pod ServiceAccount witheks.amazonaws.com/role-arn, which causes the EKS mutating webhook to inject an OIDC web identity token volume into new pods. The AWS SDK credential chain prefers this token over the EC2 metadata endpoint (kube2iam), so IRSA takes effect immediately on the next pod rotation.Zero-downtime migration: running pods are not patched in-place — the kube2iam annotation (
iam.amazonaws.com/role) drains naturally as pods rotate. Bothkube_iam_roleandirsa_role_arncan be set simultaneously during migration. Once all pods have rotated,kube_iam_rolecan be removed. The operator logs migration progress on every reconcile.Fix
dateto use POSIX format and auto-detectgsedwhen available, somakeworks on macOS.Test
irsa_role_arnset — existing DBs unaffected, no SA annotation changesirsa_role_arnset andkube_iam_rolekept — SA annotated immediately, new pods get IRSA token volume, existing pods keep kube2iam until rotatedirsa_role_arn(single deploy, nokube_iam_role) — one rotation produces clean pod with IRSA onlyirsa_role_arnset — pod starts with IRSA from day one