Skip to content

Commit 69b5b1d

Browse files
patrickleetclaude
andcommitted
feat: ESO integration + change default projects path to apps/
ESO integration for ArgoCD repo credentials: - ExternalSecret pulls GitHub App creds from AWS Secrets Manager - Projects/Crossplane apps gated on repo creds when ESO enabled - Usage protects deletion ordering - 5 new unit tests (17 total, all passing) DX improvements: - Default projects.path changed from .gitops/deploy to apps/ - Works with hops-ops/gitops-template for intuitive repo structure Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5b97869 commit 69b5b1d

21 files changed

Lines changed: 532 additions & 27 deletions

.github/workflows/on-pr.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ jobs:
3434
{ "example": "examples/gitopsstacks/minimal.yaml" },
3535
{ "example": "examples/gitopsstacks/standard.yaml" },
3636
{ "example": "examples/gitopsstacks/standard.yaml", "observed_resources": "examples/test/mocks/observed-resources/standard/steps/1/" },
37-
{ "example": "examples/gitopsstacks/standard.yaml", "observed_resources": "examples/test/mocks/observed-resources/standard/steps/2/" }
37+
{ "example": "examples/gitopsstacks/standard.yaml", "observed_resources": "examples/test/mocks/observed-resources/standard/steps/2/" },
38+
{ "example": "examples/gitopsstacks/eso.yaml" },
39+
{ "example": "examples/gitopsstacks/eso.yaml", "observed_resources": "examples/test/mocks/observed-resources/eso/steps/1/" },
40+
{ "example": "examples/gitopsstacks/eso.yaml", "observed_resources": "examples/test/mocks/observed-resources/eso/steps/2/" },
41+
{ "example": "examples/gitopsstacks/eso.yaml", "observed_resources": "examples/test/mocks/observed-resources/eso/steps/3/" }
3842
]
3943
api_path: apis/gitopsstacks
4044
error_on_missing_schemas: true

.github/workflows/on-push-main.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ jobs:
3030
{ "example": "examples/gitopsstacks/minimal.yaml" },
3131
{ "example": "examples/gitopsstacks/standard.yaml" },
3232
{ "example": "examples/gitopsstacks/standard.yaml", "observed_resources": "examples/test/mocks/observed-resources/standard/steps/1/" },
33-
{ "example": "examples/gitopsstacks/standard.yaml", "observed_resources": "examples/test/mocks/observed-resources/standard/steps/2/" }
33+
{ "example": "examples/gitopsstacks/standard.yaml", "observed_resources": "examples/test/mocks/observed-resources/standard/steps/2/" },
34+
{ "example": "examples/gitopsstacks/eso.yaml" },
35+
{ "example": "examples/gitopsstacks/eso.yaml", "observed_resources": "examples/test/mocks/observed-resources/eso/steps/1/" },
36+
{ "example": "examples/gitopsstacks/eso.yaml", "observed_resources": "examples/test/mocks/observed-resources/eso/steps/2/" },
37+
{ "example": "examples/gitopsstacks/eso.yaml", "observed_resources": "examples/test/mocks/observed-resources/eso/steps/3/" }
3438
]
3539
api_path: apis/gitopsstacks
3640
error_on_missing_schemas: true

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ EXAMPLES := \
2121
examples/gitopsstacks/minimal.yaml:: \
2222
examples/gitopsstacks/standard.yaml:: \
2323
examples/gitopsstacks/standard.yaml::examples/test/mocks/observed-resources/standard/steps/1/ \
24-
examples/gitopsstacks/standard.yaml::examples/test/mocks/observed-resources/standard/steps/2/
24+
examples/gitopsstacks/standard.yaml::examples/test/mocks/observed-resources/standard/steps/2/ \
25+
examples/gitopsstacks/eso.yaml:: \
26+
examples/gitopsstacks/eso.yaml::examples/test/mocks/observed-resources/eso/steps/1/ \
27+
examples/gitopsstacks/eso.yaml::examples/test/mocks/observed-resources/eso/steps/2/ \
28+
examples/gitopsstacks/eso.yaml::examples/test/mocks/observed-resources/eso/steps/3/
2529

2630
# Render all examples (parallel execution, output shown per-job when complete)
2731
render\:all:

apis/gitopsstacks/definition.yaml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,34 @@ spec:
140140
type: boolean
141141
required:
142142
- org
143+
externalSecrets:
144+
description: External Secrets Operator integration for ArgoCD repository credentials. Requires SecretStack as a prerequisite.
145+
type: object
146+
properties:
147+
enabled:
148+
description: Enable ESO integration. Creates an ExternalSecret to pull GitHub App credentials from AWS Secrets Manager into ArgoCD repo-creds.
149+
type: boolean
150+
secretStoreName:
151+
description: Name of the ClusterSecretStore created by SecretStack. Defaults to "default".
152+
type: string
153+
githubApp:
154+
description: GitHub App credential references in AWS Secrets Manager.
155+
type: object
156+
properties:
157+
secretPath:
158+
description: AWS Secrets Manager secret name containing GitHub App credentials.
159+
type: string
160+
appIdKey:
161+
description: JSON key for the GitHub App ID within the secret. Defaults to "appId".
162+
type: string
163+
installationIdKey:
164+
description: JSON key for the GitHub App Installation ID within the secret. Defaults to "installationId".
165+
type: string
166+
privateKeyKey:
167+
description: JSON key for the GitHub App private key within the secret. Defaults to "privateKey".
168+
type: string
169+
required:
170+
- secretPath
143171
applications:
144172
description: ArgoCD Application configuration.
145173
type: object
@@ -152,7 +180,7 @@ spec:
152180
description: Enable the projects Application. Defaults to true.
153181
type: boolean
154182
path:
155-
description: Path in the gitops repo to sync. Defaults to .gitops/deploy.
183+
description: Path in the gitops repo to sync. Defaults to apps.
156184
type: string
157185
crossplane:
158186
description: Crossplane-specific ArgoCD projects and applications.

examples/gitopsstacks/eso.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apiVersion: hops.ops.com.ai/v1alpha1
2+
kind: GitopsStack
3+
metadata:
4+
name: gitops
5+
namespace: example-env
6+
spec:
7+
clusterName: example-cluster
8+
labels:
9+
team: platform
10+
repository:
11+
org: hops-ops
12+
name: example-cluster-gitops
13+
description: GitOps repository for example-cluster
14+
visibility: private
15+
externalSecrets:
16+
enabled: true
17+
secretStoreName: default
18+
githubApp:
19+
secretPath: github/argocd-credentials
20+
appIdKey: appId
21+
installationIdKey: installationId
22+
privateKeyKey: privateKey
23+
applications:
24+
projects:
25+
enabled: true
26+
path: .gitops/deploy
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: repo.github.m.upbound.io/v1alpha1
2+
kind: Repository
3+
metadata:
4+
name: gitops-gitops-repo
5+
annotations:
6+
crossplane.io/composition-resource-name: github-repository
7+
status:
8+
conditions:
9+
- type: Ready
10+
status: "True"
11+
- type: Synced
12+
status: "True"
13+
atProvider:
14+
fullName: hops-ops/example-cluster-gitops
15+
htmlUrl: https://github.com/hops-ops/example-cluster-gitops
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: helm.m.crossplane.io/v1beta1
2+
kind: Release
3+
metadata:
4+
name: argocd
5+
annotations:
6+
crossplane.io/composition-resource-name: helm-release-argocd
7+
status:
8+
conditions:
9+
- type: Ready
10+
status: "True"
11+
- type: Synced
12+
status: "True"
13+
atProvider:
14+
state: deployed
15+
revision: "1"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: kubernetes.m.crossplane.io/v1alpha1
2+
kind: Object
3+
metadata:
4+
name: gitops-argocd-repo-creds
5+
annotations:
6+
crossplane.io/composition-resource-name: external-secret-argocd-repo-creds
7+
status:
8+
conditions:
9+
- type: Ready
10+
status: "True"
11+
- type: Synced
12+
status: "True"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../1/github-repository.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../1/helm-release-argocd.yaml

0 commit comments

Comments
 (0)