Skip to content

Commit

Permalink
adding service account
Browse files Browse the repository at this point in the history
  • Loading branch information
ajoaugustine committed May 28, 2024
1 parent 9fdf0df commit 9a38021
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kube/services/jobs/psql-db-copy-aurora-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ spec:
#
# 4. The source and the destination databases should be on the same Aurora instance.
#
# 5. The ServiceAccount, roles, and role binding must be set up using the script psql-db-copy-aurora-sa.yaml.
# The psql-db-copy-aurora-sa.yaml script is configured for the default namespace.
# Modify the namespace as needed before applying it where the script will run.
# These can be created by executing the command:
# kubectl apply -f ${GEN3_HOME}/kube/services/jobs/psql-db-copy-aurora-sa.yaml
#
# How to run the script:
# gen3 job run psql-db-copy-aurora -v SOURCE_NAMESPACE <source-namespace>
#
Expand Down
30 changes: 30 additions & 0 deletions kube/services/jobs/psql-db-copy-aurora-sa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: psql-db-copy-sa

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: psql-db-copy-role
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "watch", "list"]

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: psql-db-copy-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: psql-db-copy-role
subjects:
- kind: ServiceAccount
name: psql-db-copy-sa
namespace: default # Ensure this references the correct namespace
~

0 comments on commit 9a38021

Please sign in to comment.