Skip to content

Commit

Permalink
feat: inital commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dirien committed Sep 18, 2024
1 parent 09470a9 commit 46dca7b
Show file tree
Hide file tree
Showing 15 changed files with 196 additions and 21 deletions.
2 changes: 1 addition & 1 deletion charts/infra-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v2
name: infra-chart
description: A Helm chart for Kubernetes
type: application
version: 0.1.3
version: 0.1.4
7 changes: 7 additions & 0 deletions charts/infra-chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{- define "environmentSelector" -}}
{{- if eq . "dev" }}development
{{- else if eq . "uat" }}staging
{{- else if eq . "prod" }}production
{{- else }}unknown
{{- end -}}
{{- end -}}
13 changes: 6 additions & 7 deletions charts/infra-chart/templates/crossplane.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
apiVersion: project.digitalocean.crossplane.io/v1alpha1
kind: Project
metadata:
name: do-project-{{ .Values.stage }}-{{ .Values.region }}
{{- if .Values.iac.crossplane.enabled }}
apiVersion: spaces.digitalocean.crossplane.io/v1alpha1
kind: BucketObject
spec:
forProvider:
name: cp-{{ .Values.stage }}-{{ .Values.region }}
description: A project to represent test resources via CrossPlane
environment: development2
name: cp-space-{{ .Values.stage }}-{{ .Values.region }}
region: {{ .Values.region }}
{{- end }}
12 changes: 7 additions & 5 deletions charts/infra-chart/templates/pulumi.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{{- if .Values.iac.pulumi.enabled }}
apiVersion: pulumi.com/v1
kind: Program
metadata:
name: pu-program-{{ .Values.stage }}-{{ .Values.region }}
program:
resources:
do_project:
spacesBucket:
type: digitalocean:SpacesBucket
properties:
description: A project to represent test resources via Pulumi
environment: development2
name: pu-{{ .Values.stage }}-{{ .Values.region }}
type: digitalocean:Project
name: pu-space-{{ .Values.stage }}-{{ .Values.region }}
region: {{ .Values.region }}

---
apiVersion: pulumi.com/v1
kind: Stack
Expand All @@ -25,3 +26,4 @@ spec:
programRef:
name: pu-program-{{ .Values.stage }}-{{ .Values.region }}
stack: ediri/pu-program-{{ .Values.stage }}-{{ .Values.region }}/{{ .Values.stage }}
{{- end }}
5 changes: 5 additions & 0 deletions charts/infra-chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
region: world
stage: dev
iac:
pulumi:
enabled: true
crossplane:
enabled: true
112 changes: 104 additions & 8 deletions setup/cd-summit-demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ spec:
discoveryLimit: 20
name: infra-chart
repoURL: https://dirien.github.io/kargo-test/
#- git:
# commitSelectionStrategy: NewestFromBranch
# discoveryLimit: 20
# excludePaths:
# - charts
# - setup
# - .github
# repoURL: https://github.com/dirien/kargo-test
---
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
Expand All @@ -49,3 +41,107 @@ spec:
name: infra-chart-warehouse
sources:
direct: true
---
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: uat
namespace: cd-summit-demo
spec:
promotionMechanisms:
argoCDAppUpdates:
- appName: cd-summit-demo-uat
appNamespace: argocd
gitRepoUpdates:
- helm:
charts:
- chartPath: stages/uat
name: infra-chart
repository: https://dirien.github.io/kargo-test/
repoURL: https://github.com/dirien/kargo-test
writeBranch: main
requestedFreight:
- origin:
kind: Warehouse
name: infra-chart-warehouse
sources:
stages:
- test
---
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-nyc
namespace: cd-summit-demo
spec:
promotionMechanisms:
argoCDAppUpdates:
- appName: cd-summit-demo-prod-nyc
appNamespace: argocd
gitRepoUpdates:
- helm:
charts:
- chartPath: stages/prod-nyc
name: infra-chart
repository: https://dirien.github.io/kargo-test/
repoURL: https://github.com/dirien/kargo-test
writeBranch: main
requestedFreight:
- origin:
kind: Warehouse
name: infra-chart-warehouse
sources:
stages:
- uat
---
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-ams
namespace: cd-summit-demo
spec:
promotionMechanisms:
argoCDAppUpdates:
- appName: cd-summit-demo-prod-ams
appNamespace: argocd
gitRepoUpdates:
- helm:
charts:
- chartPath: stages/prod-ams
name: infra-chart
repository: https://dirien.github.io/kargo-test/
repoURL: https://github.com/dirien/kargo-test
writeBranch: main
requestedFreight:
- origin:
kind: Warehouse
name: infra-chart-warehouse
sources:
stages:
- prod-nyc
---
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-lon
namespace: cd-summit-demo
spec:
promotionMechanisms:
argoCDAppUpdates:
- appName: cd-summit-demo-prod-lon
appNamespace: argocd
gitRepoUpdates:
- helm:
charts:
- chartPath: stages/prod-lon
name: infra-chart
repository: https://dirien.github.io/kargo-test/
repoURL: https://github.com/dirien/kargo-test
writeBranch: main
requestedFreight:
- origin:
kind: Warehouse
name: infra-chart-warehouse
sources:
stages:
- prod-nyc
11 changes: 11 additions & 0 deletions stages/prod-ams/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v2

dependencies:
- name: infra-chart
version: 0.1.0
repository: https://dirien.github.io/kargo-test/

name: infrastructure

appVersion: 1.0.0
version: 0.1.0
3 changes: 3 additions & 0 deletions stages/prod-ams/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
infra-chart:
region: ams3
stage: prod
11 changes: 11 additions & 0 deletions stages/prod-lon/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v2

dependencies:
- name: infra-chart
version: 0.1.0
repository: https://dirien.github.io/kargo-test/

name: infrastructure

appVersion: 1.0.0
version: 0.1.0
3 changes: 3 additions & 0 deletions stages/prod-lon/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
infra-chart:
region: lon1
stage: prod
11 changes: 11 additions & 0 deletions stages/prod-nyc/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v2

dependencies:
- name: infra-chart
version: 0.1.0
repository: https://dirien.github.io/kargo-test/

name: infrastructure

appVersion: 1.0.0
version: 0.1.0
3 changes: 3 additions & 0 deletions stages/prod-nyc/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
infra-chart:
region: nyc3
stage: prod
5 changes: 5 additions & 0 deletions stages/test/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
infra-chart:
region: fra1
stage: dev
iac:
pulumi:
enabled: true
crossplane:
enabled: false
11 changes: 11 additions & 0 deletions stages/uat/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v2

dependencies:
- name: infra-chart
version: 0.1.0
repository: https://dirien.github.io/kargo-test/

name: infrastructure

appVersion: 1.0.0
version: 0.1.0
8 changes: 8 additions & 0 deletions stages/uat/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
infra-chart:
region: fra1
stage: uat
iac:
pulumi:
enabled: false
crossplane:
enabled: true

0 comments on commit 46dca7b

Please sign in to comment.