feat: add GitOps deployment via OpenShift GitOps (ArgoCD) #314
Conversation
fe3a1e7 to
5f519bc
Compare
r2dedios
left a comment
There was a problem hiding this comment.
Just a few observations, but looks great :)
fd4573b to
2caf03e
Compare
e2bde5a to
25c5592
Compare
25c5592 to
1ce7396
Compare
|
All fixes are implemented, tested, and committed locally on Review of #314 — GitOps deployment via OpenShift GitOps (ArgoCD)Reviewed by Claude (Anthropic) via automated code review at the requester's direction. Each comment includes a fix commit created on the PR branch — SHAs below, not yet pushed. 🔴 Critical1. PostSync deploy Job cannot start — 🟠 Important2. 3. IAM role grants silently swallow failures 4. 5. Git PAT exposure is broader than the existing warning acknowledges 6. Unused RBAC grant on the deploy Job's ServiceAccount 7. New 🟡 Suggestions8. Helm Job name has no truncation headroom for its appended suffix 9. 10. PR description's test-plan checklist references a path that doesn't exist in this repo ✅ Strengths
Verdict: Request ChangesThe Critical finding (#1) means the deploy Job as shipped cannot run at all — this alone blocks merge. #2–#7 are real correctness/security gaps worth fixing before this becomes the standard deployment path. All fixes above are implemented as separate commits on this branch, each verified ( |
|
PR summary need an update :) |
1ce7396 to
e02f82a
Compare
5242be4 to
b787439
Compare
fa8de9e to
addf255
Compare
Add ArgoCD-managed (OpenShift GitOps) deployment for two targets: - OpenShift: ArgoCD Application syncs the existing Helm chart - Google Cloud: Helm chart where PostSync hook triggers Cloud Build Includes: - Helm chart with security-hardened deploy Job (runAsNonRoot, readOnlyRootFilesystem, seccompProfile, pinned image digest) - Setup scripts (ArgoCD operator install, GCP SA creation) - Input validation for SCAN_SEVERITY and GIT_BRANCH - Git token handling via Secret Manager availableSecrets - Base GitOps documentation
Parameterize all deployment-configurable values for multi-instance: - Agent model, MCP debug/timeout, logging detail - Dashboard names with service_name substitution - Redis config (key prefix, URL secret, CA cert secret) - Database and DCR secret names - MCP timeout and SSE read timeout All values threaded consistently through cloudbuild.yaml, deploy.sh, deploy-cloudbuild.sh, service.yaml, marketplace-handler.yaml, and the GitOps Helm chart (values, ConfigMap, deploy Job).
Automate creation of Cloud SQL instance, Redis/Memorystore instance, VPC connector, and database secret population. Adds wait_for_sa() with exponential backoff to fix IAM propagation race condition.
- Multi-instance deployment guide (staging + prod on same GCP project) - GCP resource name collision table and length constraints - Shared vs separate infrastructure decision guide - Cloud Build SA roles reference table - setup.sh to values-override.yaml field mapping table - Cross-cluster deployment with credential rotation - Load balancer and DNS setup ordering
GCP Pub/Sub notifications often omit the product field. When filtering is configured, fetch it from the Procurement API via the entitlement ID. 403 responses indicate the SA lacks permission for that product (belongs to a different instance), so the event is safely skipped. Includes tests for matching, non-matching, and 403 scenarios.
- deploy-cloudbuild.sh: add forwarding for GEMINI_MODEL, AGENT_LOGGING_DETAIL, and MCP_DEBUG substitutions - setup.sh: use stdlib-only DCR key generation (no cryptography dep), add VPC_NETWORK env var for VPC connector creation - values.yaml: shorter VPC connector default (ls-redis-conn), remove unused deploy.namespace, document handler tag behavior Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Use fail-closed: skip events when product can't be determined (Pub/Sub retries handle transient API failures) - Wrap credentials.refresh() in asyncio.to_thread() to avoid blocking the event loop - Add explicit _NOT_AUTHORIZED check with clear log message - Use Settings type annotation instead of Any - Remove redundant function-level imports - Add tests for fail-closed path and _fetch_entitlement_product unit tests covering all code paths Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Thread _OTEL_SERVICE_NAME through the GitOps Helm chart to support PR RHEcosystemAppEng#328's configurable OTel service name for dashboard filtering and metrics scoping in multi-instance deployments. - GitOps: falls back to services.agent.name when otelServiceName is not explicitly set, so multi-instance deployments get unique OTel names automatically - deploy.sh: add OTEL_SERVICE_NAME env var with SERVICE_NAME fallback Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
addf255 to
db85e1a
Compare
IlonaShishov
left a comment
There was a problem hiding this comment.
Some minor comments to address (optional)
LGTM
The old default 'lightspeed-redis-conn' (23 effective chars) exceeded the documented GCP limit of <21 characters for VPC connector names. Changed to 'ls-redis-conn' (16 effective chars) across all scripts, config, and documentation to ensure compliance and leave room for environment prefixes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Add ArgoCD-managed (OpenShift GitOps) deployment for two targets: OpenShift (syncs existing Helm chart) and Google Cloud (triggers Cloud Build for Cloud Run). PR-based workflow: change image tags or config → merge → ArgoCD auto-syncs → redeployment.
Also adds comprehensive multi-instance support for deploying multiple agent instances to the same GCP project, and parameterizes dashboard names and Redis config so instances don't collide.
Google Cloud target (
deploy/gitops/google-cloud/)values.yamltocloudbuild.yamlvariablesgcloud builds submitrunAsNonRoot,seccompProfile, resource limits, optional git token for private repossecrets.yaml.exampledocuments the required secrets formatSetup scripts (
deploy/gitops/setup/)install-gitops-operator.sh— installs the OpenShift GitOps operator with health checkssetup-gcp-sa.sh— creates GCP service account, assigns roles, generates key, and uploads the key to GCP Secret ManagerMulti-instance deployment support
setup.shis one-time infra provisioning, separate from Cloud Build pipelinesetup-gcp-sa.shcommands and matchingvalues-override.yamlkeysserviceControlServiceNameloadBalancer.nameprefix (16 resources across 2 services)lightspeed-gitops) added to collisions tableDashboard parameterization (
cloudbuild.yaml)deploy-dashboardsstep now substitutes_SERVICE_NAMEinto dashboard display names and labels before creatingLightspeed (lightspeed-agent-staging) — Agent OperationsRedis / rate limiting parameterization
New configurable fields across all deployment paths (deploy.sh, deploy-cloudbuild.sh, GitOps/ArgoCD):
rateLimit.keyPrefixlightspeed:ratelimitrateLimit.redisUrlSecretrate-limit-redis-urlrateLimit.redisCaCertSecretredis-ca-certEnables separate rate limit counters and separate Redis instances per deployment. Defaults unchanged — existing single-instance deployments are unaffected.
Files modified:
service.yaml,marketplace-handler.yaml(placeholders),cloudbuild.yaml(substitutions + sed),deploy.sh(env vars + sed),deploy-cloudbuild.sh(forwarding),values.yaml,deployment-config.yaml,deploy-job.yaml(Helm chart),setup.sh(Redis instance name in instructions).Cloud Run deployment updates
cloudbuild.yamlgains_GEMINI_MODEL,_MCP_DEBUG,_AGENT_LOGGING_DETAIL,_RATE_LIMIT_KEY_PREFIX,_REDIS_URL_SECRET,_REDIS_CA_CERT_SECRETsubstitutionsdeploy.shapplies model, MCP debug, log level, and Redis config env vars to Cloud Run servicesservice.yamlandmarketplace-handler.yamluse placeholders for all configurable valuesOther changes
gcp-sa-secret.yamlto respectsecrets.create: falsein OpenShift chartvalues.yamlgainsgeminiModelfield; agent deployment template passes it throughGitOps companion repo
google-cloud/README.md(commit)Test plan
helm template test deploy/gitops/google-cloud/ --set project.id=testrateLimit.keyPrefixvalues🤖 Generated with Claude Code