Initial Helm and Kargo setup
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
apiVersion: kargo.akuity.io/v1alpha1
|
||||
kind: Project
|
||||
|
||||
metadata:
|
||||
name: web
|
||||
@@ -0,0 +1,83 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: web-dev
|
||||
namespace: argocd
|
||||
annotations:
|
||||
kargo.akuity.io/authorized-stage: web:dev
|
||||
spec:
|
||||
project: default
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
namespace: web-dev
|
||||
source:
|
||||
repoURL: https://git.5vl.nl/5vl/kub-web-test.git
|
||||
targetRevision: dev
|
||||
path: .
|
||||
helm:
|
||||
releaseName: web-dev
|
||||
valueFiles:
|
||||
- values-dev.yaml
|
||||
syncPolicy:
|
||||
automated:
|
||||
prune: true
|
||||
selfHeal: true
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
|
||||
---
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: web-staging
|
||||
namespace: argocd
|
||||
annotations:
|
||||
kargo.akuity.io/authorized-stage: web:staging
|
||||
spec:
|
||||
project: default
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
namespace: web-staging
|
||||
source:
|
||||
repoURL: https://git.5vl.nl/5vl/kub-web-test.git
|
||||
# Baseline only. Kargo pins this live to the exact promoted dev commit.
|
||||
targetRevision: prod
|
||||
path: .
|
||||
helm:
|
||||
releaseName: web-staging
|
||||
valueFiles:
|
||||
- values-staging.yaml
|
||||
syncPolicy:
|
||||
automated:
|
||||
prune: true
|
||||
selfHeal: true
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
|
||||
---
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: web-prod
|
||||
namespace: argocd
|
||||
annotations:
|
||||
kargo.akuity.io/authorized-stage: web:prod
|
||||
spec:
|
||||
project: default
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
namespace: web-prod
|
||||
source:
|
||||
repoURL: https://git.5vl.nl/5vl/kub-web-test.git
|
||||
targetRevision: prod
|
||||
path: .
|
||||
helm:
|
||||
releaseName: web-prod
|
||||
valueFiles:
|
||||
- values-prod.yaml
|
||||
syncPolicy:
|
||||
automated:
|
||||
prune: true
|
||||
selfHeal: true
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
@@ -0,0 +1,184 @@
|
||||
apiVersion: kargo.akuity.io/v1alpha1
|
||||
kind: ProjectConfig
|
||||
metadata:
|
||||
name: web
|
||||
namespace: web
|
||||
spec:
|
||||
promotionPolicies:
|
||||
- stageSelector:
|
||||
name: dev
|
||||
autoPromotionEnabled: true
|
||||
- stageSelector:
|
||||
name: staging
|
||||
autoPromotionEnabled: false
|
||||
- stageSelector:
|
||||
name: prod
|
||||
autoPromotionEnabled: false
|
||||
|
||||
---
|
||||
apiVersion: kargo.akuity.io/v1alpha1
|
||||
kind: Warehouse
|
||||
metadata:
|
||||
name: web
|
||||
namespace: web
|
||||
spec:
|
||||
subscriptions:
|
||||
- git:
|
||||
repoURL: https://git.5vl.nl/5vl/kub-web-test.git
|
||||
branch: dev
|
||||
includePaths:
|
||||
- Chart.yaml
|
||||
- values.yaml
|
||||
- values-dev.yaml
|
||||
- values-staging.yaml
|
||||
- values-prod.yaml
|
||||
- templates
|
||||
|
||||
---
|
||||
apiVersion: kargo.akuity.io/v1alpha1
|
||||
kind: Stage
|
||||
metadata:
|
||||
name: dev
|
||||
namespace: web
|
||||
spec:
|
||||
requestedFreight:
|
||||
- origin:
|
||||
kind: Warehouse
|
||||
name: web
|
||||
sources:
|
||||
direct: true
|
||||
promotionTemplate:
|
||||
spec:
|
||||
vars:
|
||||
- name: repoURL
|
||||
value: https://git.5vl.nl/5vl/kub-web-test.git
|
||||
steps:
|
||||
- uses: argocd-update
|
||||
config:
|
||||
apps:
|
||||
- name: web-dev
|
||||
sources:
|
||||
- repoURL: ${{ vars.repoURL }}
|
||||
desiredRevision: ${{ commitFrom(vars.repoURL).ID }}
|
||||
|
||||
---
|
||||
apiVersion: kargo.akuity.io/v1alpha1
|
||||
kind: Stage
|
||||
metadata:
|
||||
name: staging
|
||||
namespace: web
|
||||
spec:
|
||||
requestedFreight:
|
||||
- origin:
|
||||
kind: Warehouse
|
||||
name: web
|
||||
sources:
|
||||
stages:
|
||||
- dev
|
||||
promotionTemplate:
|
||||
spec:
|
||||
vars:
|
||||
- name: repoURL
|
||||
value: https://git.5vl.nl/5vl/kub-web-test.git
|
||||
steps:
|
||||
- uses: argocd-update
|
||||
config:
|
||||
apps:
|
||||
- name: web-staging
|
||||
sources:
|
||||
- repoURL: ${{ vars.repoURL }}
|
||||
desiredRevision: ${{ commitFrom(vars.repoURL).ID }}
|
||||
updateTargetRevision: true
|
||||
|
||||
---
|
||||
apiVersion: kargo.akuity.io/v1alpha1
|
||||
kind: Stage
|
||||
metadata:
|
||||
name: prod
|
||||
namespace: web
|
||||
spec:
|
||||
requestedFreight:
|
||||
- origin:
|
||||
kind: Warehouse
|
||||
name: web
|
||||
sources:
|
||||
stages:
|
||||
- staging
|
||||
promotionTemplate:
|
||||
spec:
|
||||
vars:
|
||||
- name: repoURL
|
||||
value: https://git.5vl.nl/5vl/kub-web-test.git
|
||||
steps:
|
||||
- uses: git-clone
|
||||
config:
|
||||
repoURL: ${{ vars.repoURL }}
|
||||
author:
|
||||
name: Kargo
|
||||
email: kargo@max.test.scrumdapp.open-ict.hu
|
||||
checkout:
|
||||
- commit: ${{ commitFrom(vars.repoURL).ID }}
|
||||
path: ./src
|
||||
- branch: prod
|
||||
create: true
|
||||
path: ./out
|
||||
|
||||
- uses: git-clear
|
||||
config:
|
||||
path: ./out
|
||||
|
||||
- uses: copy
|
||||
config:
|
||||
inPath: ./src/Chart.yaml
|
||||
outPath: ./out/Chart.yaml
|
||||
- uses: copy
|
||||
config:
|
||||
inPath: ./src/values.yaml
|
||||
outPath: ./out/values.yaml
|
||||
- uses: copy
|
||||
config:
|
||||
inPath: ./src/values-dev.yaml
|
||||
outPath: ./out/values-dev.yaml
|
||||
- uses: copy
|
||||
config:
|
||||
inPath: ./src/values-staging.yaml
|
||||
outPath: ./out/values-staging.yaml
|
||||
- uses: copy
|
||||
config:
|
||||
inPath: ./src/values-prod.yaml
|
||||
outPath: ./out/values-prod.yaml
|
||||
- uses: copy
|
||||
config:
|
||||
inPath: ./src/templates
|
||||
outPath: ./out/templates
|
||||
- uses: copy
|
||||
config:
|
||||
inPath: ./src/bootstrap
|
||||
outPath: ./out/bootstrap
|
||||
- uses: copy
|
||||
config:
|
||||
inPath: ./src/README.md
|
||||
outPath: ./out/README.md
|
||||
- uses: copy
|
||||
config:
|
||||
inPath: ./src/.gitignore
|
||||
outPath: ./out/.gitignore
|
||||
|
||||
- uses: git-commit
|
||||
as: commit
|
||||
config:
|
||||
path: ./out
|
||||
message: Promote ${{ commitFrom(vars.repoURL).ID }} to prod
|
||||
|
||||
- uses: git-push
|
||||
config:
|
||||
path: ./out
|
||||
targetBranch: prod
|
||||
|
||||
- uses: argocd-update
|
||||
config:
|
||||
apps:
|
||||
- name: web-prod
|
||||
sources:
|
||||
- repoURL: ${{ vars.repoURL }}
|
||||
desiredRevision: ${{ outputs.commit.commit }}
|
||||
@@ -0,0 +1,13 @@
|
||||
# EXAMPLE ONLY. Do not commit a real token.
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: kub-web-test-repository
|
||||
namespace: argocd
|
||||
labels:
|
||||
argocd.argoproj.io/secret-type: repository
|
||||
stringData:
|
||||
type: git
|
||||
url: https://git.5vl.nl/5vl/kub-web-test.git
|
||||
username: 5vl
|
||||
password: REPLACE_WITH_GIT_TOKEN
|
||||
@@ -0,0 +1,13 @@
|
||||
# EXAMPLE ONLY. Do not commit a real token.
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: kub-web-test-git
|
||||
namespace: web
|
||||
labels:
|
||||
kargo.akuity.io/cred-type: git
|
||||
type: Opaque
|
||||
stringData:
|
||||
repoURL: https://git.5vl.nl/5vl/kub-web-test.git
|
||||
username: 5vl
|
||||
password: REPLACE_WITH_GIT_TOKEN
|
||||
Reference in New Issue
Block a user