-
Notifications
You must be signed in to change notification settings - Fork 0
feat: implement opt-in cloud workload identity for Azure AKS and AWS … #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,21 @@ | ||
| {{- if .Values.workloadIdentity.enabled }} | ||
| {{- if not .Values.serviceAccount.create }} | ||
| {{- fail "workloadIdentity.enabled requires serviceAccount.create to be true so the required cloud identity annotations can be attached" }} | ||
| {{- end }} | ||
| {{- if not (has .Values.workloadIdentity.provider (list "azure" "aws")) }} | ||
| {{- fail (printf "workloadIdentity.provider must be either 'azure' or 'aws', got '%s'" .Values.workloadIdentity.provider) }} | ||
| {{- end }} | ||
| {{- if eq .Values.workloadIdentity.provider "azure" }} | ||
| {{- if or (not .Values.workloadIdentity.azureClientId) (not .Values.workloadIdentity.azureTenantId) }} | ||
| {{- fail "workloadIdentity.azureClientId and workloadIdentity.azureTenantId must be non-empty when provider is 'azure'" }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- if eq .Values.workloadIdentity.provider "aws" }} | ||
| {{- if not .Values.workloadIdentity.awsRoleArn }} | ||
| {{- fail "workloadIdentity.awsRoleArn must be non-empty when provider is 'aws'" }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
Comment on lines
+1
to
+18
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
fd -t f . charts/agentrax/templates/tests 2>/dev/null || true
rg -n -C 6 'helm\.sh/hook: test|kind: TenantQuota|kind: AgentDeployment' \
charts/agentrax/templates/tests charts/agentrax/templates 2>/dev/null || trueRepository: gitcommitankit/agentrax Length of output: 209 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- test-smoke.yaml ---'
cat -n charts/agentrax/templates/tests/test-smoke.yaml
printf '%s\n' '--- chart test and workload-identity references ---'
rg -n -C 8 \
'helm\.sh/hook|TenantQuota|AgentDeployment|workloadIdentity|serviceAccount' \
charts/agentrax/templates charts/agentrax/values.yaml 2>/dev/null || true
printf '%s\n' '--- chart files ---'
git ls-files charts/agentrax | sed -n '1,160p'Repository: gitcommitankit/agentrax Length of output: 13514 Add 🧰 Tools🪛 YAMLlint (1.37.1)[error] 1-1: syntax error: expected the node content, but found '-' (syntax) 🤖 Prompt for AI AgentsSource: Path instructions |
||
| {{- if .Values.serviceAccount.create -}} | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
|
|
@@ -6,8 +24,15 @@ metadata: | |
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| {{- include "agentrax.labels" . | nindent 4 }} | ||
| {{- with .Values.serviceAccount.annotations }} | ||
| annotations: | ||
| {{- with .Values.serviceAccount.annotations }} | ||
| {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- if and .Values.workloadIdentity.enabled (eq .Values.workloadIdentity.provider "azure") }} | ||
| azure.workload.identity/client-id: {{ .Values.workloadIdentity.azureClientId | quote }} | ||
| azure.workload.identity/tenant-id: {{ .Values.workloadIdentity.azureTenantId | quote }} | ||
| {{- end }} | ||
| {{- if and .Values.workloadIdentity.enabled (eq .Values.workloadIdentity.provider "aws") }} | ||
| eks.amazonaws.com/role-arn: {{ .Values.workloadIdentity.awsRoleArn | quote }} | ||
| {{- end }} | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,6 +104,21 @@ mcp: | |
| # -- Periodic health check interval for registered agents (e.g. "30s") | ||
| healthInterval: "30s" | ||
|
|
||
| # -- Cloud Workload Identity — secretless pod-level IAM. | ||
| # Supported providers: azure (AKS Workload Identity), aws (EKS IRSA). | ||
| # When disabled (the default), no annotations or labels are injected. | ||
| workloadIdentity: | ||
| # -- Set to true to enable workload identity for the controller-manager pod. | ||
| enabled: false | ||
| # -- Cloud provider. Accepted values: "azure" | "aws". | ||
| provider: azure | ||
| # -- Azure only: Application (client) ID of the managed identity. | ||
| azureClientId: "" | ||
| # -- Azure only: Azure AD tenant ID. | ||
| azureTenantId: "" | ||
| # -- AWS only: Full ARN of the IAM role to assume via IRSA. | ||
| awsRoleArn: "" | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
|
Comment on lines
+107
to
+121
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: rg -n -C 4 'helm\.sh/hook:.*test|TenantQuota|AgentDeployment' charts/agentrax
fd -a -t f . charts/agentrax config/crd | sortRepository: gitcommitankit/agentrax Length of output: 11512 🏁 Script executed: #!/bin/bash
set -e
printf '%s\n' '--- smoke test ---'
cat -n charts/agentrax/templates/tests/test-smoke.yaml
printf '%s\n' '--- chart values and templates using workloadIdentity ---'
rg -n -C 5 'workloadIdentity|AGENTRAX_' charts/agentrax
printf '%s\n' '--- CRD hashes ---'
sha256sum charts/agentrax/crds/agentrax.io_agentdeployments.yaml \
config/crd/bases/agentrax.io_agentdeployments.yaml \
charts/agentrax/crds/agentrax.io_tenantquotas.yaml \
config/crd/bases/agentrax.io_tenantquotas.yaml
printf '%s\n' '--- CRD diffs ---'
diff -u config/crd/bases/agentrax.io_agentdeployments.yaml charts/agentrax/crds/agentrax.io_agentdeployments.yaml || true
diff -u config/crd/bases/agentrax.io_tenantquotas.yaml charts/agentrax/crds/agentrax.io_tenantquotas.yaml || trueRepository: gitcommitankit/agentrax Length of output: 5465 Extend the 🤖 Prompt for AI AgentsSource: Path instructions |
||
| # -- Environment variables injected into the manager container. | ||
| # These values are automatically populated from registry.ttl and mcp.healthInterval above. | ||
| env: {} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Kustomize strategic-merge patch for AWS IRSA (IAM Roles for Service Accounts). | ||
| # Apply this patch in your cluster-specific overlay to bind the controller-manager | ||
| # ServiceAccount to an IAM role without static AWS credentials. | ||
| # | ||
| # Usage — in your overlay kustomization.yaml: | ||
| # | ||
| # resources: | ||
| # - ../../config/default | ||
| # patches: | ||
| # - path: ../../config/workload-identity/irsa-serviceaccount.yaml | ||
| # replacements: | ||
| # - source: | ||
| # kind: ConfigMap # or any source carrying your role ARN | ||
| # name: cluster-metadata | ||
| # fieldPath: data.roleArn | ||
| # targets: | ||
| # - select: | ||
| # kind: ServiceAccount | ||
| # name: agentrax-controller-manager | ||
| # fieldPaths: | ||
| # - metadata.annotations.[eks.amazonaws.com/role-arn] | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| # | ||
| # The role must have a trust policy allowing the OIDC provider of your EKS cluster | ||
| # to assume it on behalf of the agentrax-system/agentrax-controller-manager subject. | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: agentrax-controller-manager # Kustomize ServiceAccount name (Helm chart uses "agentrax" by default via workloadIdentity.awsRoleArn) | ||
| namespace: agentrax-system | ||
| annotations: | ||
| # Replace this placeholder with the actual IAM role ARN before applying. | ||
| eks.amazonaws.com/role-arn: "arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: gitcommitankit/agentrax
Length of output: 16811
🏁 Script executed:
Repository: gitcommitankit/agentrax
Length of output: 378
Restrict the API egress destinations.
The TCP 443 and 6443 rule has no
toselector, so it permits those ports to any destination. Add selectors for the Kubernetes API server, or update the documented isolation guarantee.🤖 Prompt for AI Agents
Source: MCP tools