Skip to content

Commit

Permalink
Merge pull request #211 from zeebe-io/os-deploy-zbchaos
Browse files Browse the repository at this point in the history
feat: deployment manifests for zbchaos worker
  • Loading branch information
lenaschoenburg authored Nov 9, 2022
2 parents 8689985 + 5e100ef commit fb41277
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 3 deletions.
29 changes: 26 additions & 3 deletions .github/workflows/publishZbchaosImage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,33 @@ on:
jobs:
publish-image:
runs-on: ubuntu-latest
env:
VERSION: ${{ github.event.release.name || github.sha }}
steps:
- uses: actions/checkout@v3
- name: Collect image tags
uses: actions/github-script@v6
id: image-tags
with:
# language=javascript
script: |
// noinspection JSUnresolvedVariable
const imageName = `gcr.io/zeebe-io/zbchaos`
const versionRegex = /zbchaos v(?<version>\d+\.\d+\.\d+)/i
if (context.eventName === "release") {
const versionMatch = context.payload.release.name.match(versionRegex)
if (versionMatch == null) {
core.warning(`Release was published but not detected as a zbchaos release. Tagging image only with sha ${context.sha}`)
return `${imageName}:${context.sha}`
}
// For releases, tag with release version, sha and 'latest'
let version = versionMatch.groups["version"];
core.info(`Detected zbchaos release ${version}, tagging image ${imageName} with ${version}, 'latest' and sha ${context.sha}`)
return `${imageName}:${version},${imageName}:latest,${imageName}:${context.sha}`
} else {
// If not a release, tag only with sha
return `${imageName}:${context.sha}`
}
result-encoding: string
- name: Setup BuildKit
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
Expand All @@ -24,6 +47,6 @@ jobs:
with:
context: go-chaos
push: true
tags: gcr.io/zeebe-io/zbchaos:${{ env.VERSION }}
tags: ${{ steps.image-tags.outputs.result }}
cache-from: type=gha
cache-to: type=gha,mode=max
43 changes: 43 additions & 0 deletions go-chaos/deploy/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: zbchaos-worker
labels:
app: zbchaos-worker
spec:
replicas: 3
selector:
matchLabels:
app: zbchaos-worker
template:
metadata:
name: zbchaos-worker
labels:
app: zbchaos-worker
spec:
containers:
- image: gcr.io/zeebe-io/zbchaos:latest
name: zbchaos-worker
resources:
limits:
cpu: 1000m
memory: 512Mi
requests:
cpu: 150m
memory: 128Mi
volumeMounts:
- mountPath: /.kube
name: kubeconfig
envFrom:
- secretRef:
name: zeebe-backup-store-s3
- secretRef:
name: zbchaos-worker-client-config
volumes:
- name: kubeconfig
secret:
defaultMode: 420
items:
- key: kubeconfig
path: config
secretName: zbchaos-worker-kubeconfig

0 comments on commit fb41277

Please sign in to comment.