Skip to content

Commit 2765be6

Browse files
committed
fix: update Argo CD installation to use dedicated Octopus service account
Create a dedicated "octopus" service account with API key capability and necessary permissions for Octopus Deploy. This change ensures that the admin account retains login-only access, allowing the bootstrap script to generate the octopus token without interactive login requirements.
1 parent 6ee1d94 commit 2765be6

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

src/pages/docs/argo-cd/instances/terraform-bootstrap.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,9 @@ resource "kubernetes_namespace" "argocd" {
178178
}
179179

180180
# Install Argo CD via the official Helm chart.
181-
# The accounts.admin config enables API key generation for the admin account,
182-
# which is required for the token generation step in argocd-token.tf.
181+
# Creates a dedicated "octopus" service account with apiKey capability and the
182+
# permissions required by Octopus Deploy (applications, clusters, logs).
183+
# Admin retains login-only access so the bootstrap script can generate the octopus token.
183184
resource "helm_release" "argocd" {
184185
name = "argocd"
185186
repository = null
@@ -191,12 +192,18 @@ resource "helm_release" "argocd" {
191192
yamlencode({
192193
configs = {
193194
cm = {
194-
# Allow the admin account to generate API keys and log in interactively.
195-
"accounts.admin" = "apiKey,login"
195+
# Dedicated service account for Octopus Deploy — API key only, no interactive login.
196+
"accounts.octopus" = "apiKey"
196197
}
197198
rbac = {
198199
"policy.default" = "role:readonly"
199-
"policy.csv" = "g, admin, role:admin"
200+
"policy.csv" = <<-EOT
201+
g, admin, role:admin
202+
p, octopus, applications, get, *, allow
203+
p, octopus, applications, sync, *, allow
204+
p, octopus, clusters, get, *, allow
205+
p, octopus, logs, get, */*, allow
206+
EOT
200207
}
201208
}
202209
})
@@ -229,7 +236,7 @@ locals {
229236
# 1. Wait for the Argo CD server deployment to be fully ready.
230237
# 2. Port-forward the Argo CD server locally.
231238
# 3. Log in with the argocd CLI using the auto-generated admin password.
232-
# 4. Generate an API key for the admin account.
239+
# 4. Generate an API key for the octopus account.
233240
# 5. Store that key in a Kubernetes secret in the gateway namespace.
234241
#
235242
# Prerequisites (must be available on the machine running `terraform apply`):
@@ -288,9 +295,9 @@ resource "null_resource" "argocd_token" {
288295
--insecure \
289296
--grpc-web
290297

291-
echo ">>> Generating API token for the admin account..."
298+
echo ">>> Generating API token for the octopus account..."
292299
ARGOCD_TOKEN=$(argocd account generate-token \
293-
--account admin \
300+
--account octopus \
294301
--insecure \
295302
--grpc-web)
296303

0 commit comments

Comments
 (0)