Skip to content
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

docs: add blog post for multi-stage delivery #3352

Merged
merged 24 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ appcreationrequest
APPNAME
appv
appversion
applicationdeployment
aquasecurity
architecting
ARCHS
Expand Down Expand Up @@ -205,6 +206,7 @@ ghtoken
ginkgotypes
giscus
Gitlab
gitops
gke
glasskube
gms
Expand Down Expand Up @@ -387,6 +389,7 @@ linenums
linkedin
linkedtrace
livenessprobe
loadtests
LOCALBIN
logf
logr
Expand Down
413 changes: 413 additions & 0 deletions docs/blog/posts/multi-stage-delivery-using-gitops.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: simple-go-app-context
namespace: argocd
spec:
project: default
source:
repoURL: 'https://github.com/bacherfl/keptn-analysis-demo'
path: simple-app/chart-dev
targetRevision: HEAD
helm:
parameters:
- name: "commitID"
value: "$ARGOCD_APP_REVISION"
destination:
server: 'https://kubernetes.default.svc'
namespace: simple-go
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: simple-go-app-context-prod
namespace: argocd
spec:
project: default
source:
repoURL: 'https://github.com/bacherfl/keptn-analysis-demo'
path: simple-app/chart-prod
targetRevision: HEAD
helm:
parameters:
- name: "commitID"
value: "$ARGOCD_APP_REVISION"
destination:
server: 'https://kubernetes.default.svc'
namespace: simple-go
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: simple-go-service
namespace: simple-go
spec:
selector:
matchLabels:
app: simple-go-service
template:
metadata:
labels:
app: simple-go-service
app.kubernetes.io/name: simple-go-service
app.kubernetes.io/part-of: simple-go
app.kubernetes.io/version: {{.Values.serviceVersion}}
keptn.sh/post-deployment-tasks: wait-for-monitoring
spec:
containers:
- image: bacherfl/simple-go-service:{{.Values.serviceVersion}}
imagePullPolicy: Always
name: simple-go-service
ports:
- containerPort: 9000
name: http
protocol: TCP
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: lifecycle.keptn.sh/v1beta1
kind: KeptnAppContext
metadata:
name: simple-go-prod
namespace: simple-go-prod
spec:

preDeploymentTasks:
- wait-for-prometheus
postDeploymentTasks:
- post-deployment-loadtests
- post-deployment-loadtests-backend
spanLinks:
- {{.Values.traceParent}}
metadata:
commitID: {{.Values.commitID}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: lifecycle.keptn.sh/v1beta1
kind: KeptnAppContext
metadata:
name: simple-go
namespace: simple-go
spec:
preDeploymentTasks:
- wait-for-prometheus
postDeploymentTasks:
- post-deployment-loadtests
- post-deployment-loadtests-backend
postDeploymentEvaluations:
- response-time
promotionTasks:
- promote
metadata:
commitID: {{.Values.commitID}}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions docs/blog/posts/multi-stage-delivery-using-gitops/promote.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: promote

on:
workflow_dispatch:
inputs:
traceParent:
description: 'OTEL parent trace'
required: false
type: string

permissions:
contents: write
pull-requests: write

jobs:
promote:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
# configure git client
git config --global user.email "<email address>"
git config --global user.name "<name>"

# create a new branch
git switch -c production/${{ github.sha }}

# promote the change
cp dev/values.yaml production/values.yaml

echo "traceParent: $TRACE_PARENT" >> production/values.yaml

# push the change to the new branch
git add production/values.yaml
git commit -m "Promote dev to production"
git push -u origin production/${{ github.sha }}
env:
TRACE_PARENT: ${{ inputs.traceParent }}
- run: |
gh pr create \
-B main \
-H production/${{ github.sha }} \
--title "Promote dev to production" \
--body "Automatically created by GHA"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
serviceVersion: v1
backendServiceVersion: v1
targetResponseTime: "0.50"
commitID: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
serviceVersion: v1
backendServiceVersion: v1
targetResponseRate: "0.50"
commitID: ""
traceParent: ""
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading