Skip to content

Commit

Permalink
add rbac for argo to backfill chart
Browse files Browse the repository at this point in the history
  • Loading branch information
coutug committed Aug 22, 2024
1 parent 572042f commit 17f18cf
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 14 deletions.
8 changes: 1 addition & 7 deletions charts/substreams-sink-sql-backfill/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
apiVersion: v2
name: substreams-sink-sql-backfill
description: Chart to backfill clickhouse database using jobs
annotations:
artifacthub.io/images: |
- name: fixed image
image: ghcr.io/pinax-network/substreams-sink-sql:f9081de
platforms:
- linux/amd64

# A chart can be either an 'application' or a 'library' chart.
#
Expand All @@ -21,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.2
version: 0.1.3

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
69 changes: 69 additions & 0 deletions charts/substreams-sink-sql-backfill/templates/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.serviceAccount }}
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ .Values.serviceAccount }}
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ .Values.serviceAccount }}
subjects:
- kind: ServiceAccount
name: {{ .Values.serviceAccount }}
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ .Values.serviceAccount }}
namespace: {{ .Release.Namespace }}
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- watch
- patch
- apiGroups:
- ""
resources:
- pods/log
verbs:
- get
- watch
- apiGroups:
- ""
resources:
- pods/exec
verbs:
- create
- apiGroups:
- argoproj.io
resources:
- workflowtaskresults
verbs:
- create
- patch
- apiGroups:
- argoproj.io
resources:
- workflowtasksets
- workflowartifactgctasks
verbs:
- list
- watch
- apiGroups:
- argoproj.io
resources:
- workflowtasksets/status
- workflowartifactgctasks/status
verbs:
- patch
8 changes: 1 addition & 7 deletions charts/substreams-sink-sql-backfill/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Before running the workload, you should have
# - an existing namespace with the argo workflow serviceAccount
# - a secret with the credentials for the clickhouse database

image:
repository: ghcr.io/pinax-network/substreams-sink-sql
tag: develop
Expand All @@ -22,16 +18,14 @@ fullnameOverride: ""
imagePullSecret: ghcr-cred

# Make sure to use the service account that match with argo workflow server
serviceAccount: argo-workflows
serviceAccount: argo-workflows-workflow

# Time to live for containers once the job is completed
ttlStrategy:
secondsAfterCompletion: 3600
secondsAfterFailure: 7200
secondsAfterSuccess: 3600

# If the namespace exist, make sure the serviceAccount mentionned previously is in that namespace
# If the namespace does not existe, create it and then add it to `workflowNamespaces` in argo-workflows helm values. This will add the serviceAccount to the new namespace.
# Indicate the number of parallel jobs and the resources used by a job
# This way, you can limit the total resources used with <parallelism>*<resource>
parallelism: 2
Expand Down

0 comments on commit 17f18cf

Please sign in to comment.