Skip to content

Commit

Permalink
feat: integrate momentum-core
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel-Haeberli committed Jul 18, 2023
1 parent 9ee622a commit f930d92
Show file tree
Hide file tree
Showing 220 changed files with 4,223 additions and 8,525 deletions.
6 changes: 0 additions & 6 deletions momentum-backend/.gitignore

This file was deleted.

11 changes: 11 additions & 0 deletions momentum-backend/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
build: main.go
go build .

clean:
rm momentum-core

run: build
./momentum-core

clean-caches:
go clean -cache -testcache
95 changes: 0 additions & 95 deletions momentum-backend/README.md

This file was deleted.

21 changes: 21 additions & 0 deletions momentum-backend/_templates/applications/_base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ns.yaml
- release.yaml
configMapGenerator:
- files:
- values.yaml
name: base-values
options:
disableNameSuffixHash: true
secretGenerator:
- files:
- secrets.yaml
name: base-secrets
options:
disableNameSuffixHash: true
labels:
- includeSelectors: true
pairs:
gitops.natron.io/application: {{ .ApplicationName }}
28 changes: 28 additions & 0 deletions momentum-backend/_templates/applications/_base/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: {{ .ApplicationName }}
spec:
interval: 10m
chart:
spec:
chart: '{{ .ApplicationChartName }}'
sourceRef:
kind: HelmRepository
name: '{{ .ApplicationName }}-charts'
namespace: '{{ .ApplicationName }}'
install:
remediation:
remediateLastFailure: true
upgrade:
remediation:
remediateLastFailure: true
valuesFrom:
- kind: ConfigMap
name: base-values
- kind: Secret
name: base-secrets
- kind: ConfigMap
name: deploy-values
- kind: Secret
name: deploy-secrets
Empty file.
Empty file.
Empty file.
8 changes: 8 additions & 0 deletions momentum-backend/_templates/applications/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
# config
- ./ns.yaml
- ./repository.yaml
# deployments
# stages
4 changes: 4 additions & 0 deletions momentum-backend/_templates/applications/ns.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: '{{ .ApplicationName }}'
8 changes: 8 additions & 0 deletions momentum-backend/_templates/applications/repository.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: '{{ .ApplicationName }}-charts'
namespace: '{{ .ApplicationName }}'
spec:
interval: 10m0s
url: https://charts.bitnami.com/bitnami
11 changes: 11 additions & 0 deletions momentum-backend/_templates/deployments/deploymentName.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: '{{ .DeploymentNameWithoutEnding }}'
spec:
interval: 5m0s
path: ./_deploy/{{ .DeploymentName }}/
prune: true
sourceRef:
kind: GitRepository
name: '{{ .RepositoryName }}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: {{ .DeploymentNameWithoutEnding }}
resources:
- ../../_base/
configMapGenerator:
- files:
- values.yaml
name: deploy-values
options:
disableNameSuffixHash: true
secretGenerator:
- files:
- secrets.yaml
name: deploy-secrets
options:
disableNameSuffixHash: true
labels:
- includeSelectors: true
pairs:
gitops.natron.io/stage: base
patches:
- path: release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: {{ .ApplicationName }}
Empty file.
Empty file.
28 changes: 28 additions & 0 deletions momentum-backend/_templates/stages/_base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../_base/release.yaml
configMapGenerator:
- files:
- ../../_base/values.yaml
name: base-values
options:
disableNameSuffixHash: true
- files:
- values.yaml
name: '{{ .StageName }}-values'
options:
disableNameSuffixHash: true
secretGenerator:
- files:
- ../../_base/secrets.yaml
name: base-secrets
options:
disableNameSuffixHash: true
- files:
- secrets.yaml
name: '{{ .StageName }}-secrets'
options:
disableNameSuffixHash: true
patches:
- path: release.yaml
18 changes: 18 additions & 0 deletions momentum-backend/_templates/stages/_base/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: '{{ .ApplicationName }}'
spec:
valuesFrom:
- kind: ConfigMap
name: base-values
- kind: Secret
name: base-secrets
- kind: ConfigMap
name: '{{ .StageName }}-values'
- kind: Secret
name: '{{ .StageName }}-secrets'
- kind: ConfigMap
name: deploy-values
- kind: Secret
name: deploy-secrets
Empty file.
Empty file.
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions momentum-backend/_templates/stages/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Loading

0 comments on commit f930d92

Please sign in to comment.