-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add blog post for multi-stage delivery (#3352)
Signed-off-by: Florian Bacher <[email protected]> Signed-off-by: Meg McRoberts <[email protected]> Co-authored-by: Meg McRoberts <[email protected]>
- Loading branch information
1 parent
d0cb713
commit 15ccf05
Showing
15 changed files
with
575 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
docs/blog/posts/multi-stage-delivery-using-gitops/argo-apps.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Binary file added
BIN
+242 KB
docs/blog/posts/multi-stage-delivery-using-gitops/deployment-trace-dev.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+256 KB
docs/blog/posts/multi-stage-delivery-using-gitops/deployment-trace-prod.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions
26
docs/blog/posts/multi-stage-delivery-using-gitops/deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
16 changes: 16 additions & 0 deletions
16
docs/blog/posts/multi-stage-delivery-using-gitops/keptnappcontext-prod.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} |
17 changes: 17 additions & 0 deletions
17
docs/blog/posts/multi-stage-delivery-using-gitops/keptnappcontext.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
46
docs/blog/posts/multi-stage-delivery-using-gitops/promote.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
Binary file added
BIN
+133 KB
docs/blog/posts/multi-stage-delivery-using-gitops/token-permissions.png
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.
4 changes: 4 additions & 0 deletions
4
docs/blog/posts/multi-stage-delivery-using-gitops/values-dev.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
serviceVersion: v1 | ||
backendServiceVersion: v1 | ||
targetResponseTime: "0.50" | ||
commitID: "" |
5 changes: 5 additions & 0 deletions
5
docs/blog/posts/multi-stage-delivery-using-gitops/values-prod.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
serviceVersion: v1 | ||
backendServiceVersion: v1 | ||
targetResponseRate: "0.50" | ||
commitID: "" | ||
traceParent: "" |
Binary file added
BIN
+262 KB
docs/blog/posts/multi-stage-delivery-using-gitops/workflow-permissions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.