-
Notifications
You must be signed in to change notification settings - Fork 0
Add External Secrets Operator for centralized secret management #2
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
Conversation
Integrates External Secrets Operator (ESO) across all three environments to enable syncing secrets from external backends (AWS Secrets Manager, GCP Secret Manager, HashiCorp Vault, Kubernetes) into Kubernetes Secrets. This provides a secure, scalable approach to managing sensitive credentials and eliminates hardcoded secrets. Features: - ESO Helm chart (v0.11.0) deployed to mop-central, mop-cloud, and mop-edge - Shared library (tanka/lib/eso.libsonnet) with helpers for all major backends - Pre-built patterns for database credentials, API tokens, and TLS certificates - Comprehensive examples including Backstage secret migration guide - Prometheus ServiceMonitor integration for observability - Complete documentation in CLAUDE.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Pull Request Review: External Secrets Operator IntegrationSummaryThis is a comprehensive and well-executed PR that successfully integrates External Secrets Operator (ESO) across all three mop-core environments. The implementation demonstrates strong architectural decisions, excellent documentation, and follows infrastructure-as-code best practices. ✅ Strengths1. Architecture & Design
2. Code Quality
3. Documentation
4. Observability Integration
🔍 Areas for Improvement1. Security Considerations (Medium Priority)Issue: The auth: if role != '' then {
jwt: {
serviceAccountRef: {
name: 'external-secrets',
},
},
} else {},
role: role, Problems:
Recommendation: awsSecretsManager(name, region='us-east-1', role='', namespace='mop'):: {
apiVersion: 'external-secrets.io/v1beta1',
kind: 'ClusterSecretStore',
metadata: {
name: name,
},
spec: {
provider: {
aws: {
service: 'SecretsManager',
region: region,
} + (if role != '' then {
auth: {
jwt: {
serviceAccountRef: {
name: 'external-secrets',
namespace: namespace,
},
},
},
role: role,
} else {}),
},
},
}, File: 2. GCP Configuration Issues (Medium Priority)Issue: Hardcoded cluster configuration in auth: {
workloadIdentity: {
clusterLocation: 'us-central1', // ❌ Hardcoded
clusterName: 'cluster-name', // ❌ Placeholder value
serviceAccountRef: {
name: 'external-secrets',
},
},
}, Problems:
Recommendation: gcpSecretManager(name, projectID='', clusterLocation='', clusterName='', namespace='mop'):: {
assert projectID != '' : 'projectID is required for GCP Secret Manager',
assert clusterLocation != '' : 'clusterLocation is required for Workload Identity',
assert clusterName != '' : 'clusterName is required for Workload Identity',
apiVersion: 'external-secrets.io/v1beta1',
kind: 'ClusterSecretStore',
metadata: {
name: name,
},
spec: {
provider: {
gcpsm: {
projectID: projectID,
auth: {
workloadIdentity: {
clusterLocation: clusterLocation,
clusterName: clusterName,
serviceAccountRef: {
name: 'external-secrets',
namespace: namespace,
},
},
},
},
},
},
}, File: 3. Missing Error Handling (Low Priority)Issue: No validation for required parameters in helper functions Examples:
Recommendation: Add Jsonnet assertions new(name, namespace='mop'):: {
assert name != '' : 'SecretStore name cannot be empty',
assert namespace != '' : 'Namespace cannot be empty',
// ... rest of implementation
} File: 4. Linkerd Integration (Note)Observation: This PR also includes Linkerd service mesh integration, which seems outside the scope of the PR title "Add External Secrets Operator for centralized secret management" Files:
Question: Was Linkerd intentionally included in this PR, or should it be in a separate PR? This makes the changeset significantly larger and combines two major infrastructure components. Recommendation: Consider splitting Linkerd into a separate PR for clearer review and atomic changes. If they're related (e.g., using ESO for Linkerd certificate management), please clarify in the PR description. 5. Backstage Configuration Changes (Medium Priority)Issue: The Backstage configuration in Examples (lines 7-182):
Current state: postgresql+: {
auth+: {
postgresPassword: '${POSTGRES_ADMIN_PASSWORD}', // ❌ Where does this come from?
},
} Recommendation:
File: 6. Missing Namespace Creation (Low Priority)Issue: The ESO deployment references namespace Recommendation:
7. Version Pinning (Best Practice)Good: Helm chart versions are pinned (✅ Consider: Document the ESO version upgrade strategy
8. Testing Gaps (Medium Priority)From PR description test plan:
Recommendation: Complete the test plan before merging, especially:
🐛 Potential Bugs1. File Naming InconsistencyLocation: local alloy_operator = import 'alloy-operator.jsonnet'; // ❌ Dash
local config = import 'config.libsonnet'; // ❌ .libsonnet extension Changed to: local alloy_operator = import 'alloy_operator.jsonnet'; // ✅ Underscore
local config = import 'config.jsonnet'; // ✅ .jsonnet extension Risk: If 2. Incomplete Template DataLocation: TLS secret template uses: data: {
'tls.crt': '{{ .cert }}',
'tls.key': '{{ .key }}',
}, But the secret keys are 📊 Metrics & Complexity
Assessment: This is a large PR, but the size is justified given it's adding a complete new subsystem. The code quality is high enough to warrant the size. 🚀 Recommendations SummaryMust Fix (Before Merge)
Should Fix
Nice to Have
🎯 VerdictRecommendation: Approve with changes required This PR represents high-quality infrastructure code with excellent documentation and reusable patterns. The ESO library is well-designed and will serve as a strong foundation for secret management across the platform. The issues identified are fixable and mostly concentrated in the cloud provider authentication configurations. Once the AWS/GCP configuration issues are resolved and the test plan is completed, this PR will be ready to merge. Estimated effort to address feedback: 2-3 hours Great work on this implementation! The patterns and documentation will be valuable for the team. 🎉 |
Summary
Integrates External Secrets Operator (ESO) across all three environments (mop-central, mop-cloud, mop-edge) to enable secure, scalable secret management from external backends.
This PR adds comprehensive ESO support including:
tanka/lib/eso.libsonnet
) with helpers for all major backendsChanges
external-secrets/external-secrets@0.11.0
to all environment chartfileseso.jsonnet
for mop-central, mop-cloud, and mop-edge environmentstanka/lib/eso.libsonnet
with reusable helper functions and patternstanka/examples/
:eso-secretstore.jsonnet
- SecretStore/ClusterSecretStore for all backendseso-externalsecret.jsonnet
- Common ExternalSecret patternseso-backstage-migration.jsonnet
- Real-world migration exampleREADME.md
- Complete usage guide with troubleshootingCLAUDE.md
with ESO commands, architecture, and migration patternsmain.jsonnet
files to include ESO resourcesArchitecture
External Secrets Operator syncs secrets from external secret management systems into Kubernetes Secrets, eliminating hardcoded credentials and providing centralized secret management.
Key Components:
Deployment
Test plan
🤖 Generated with Claude Code