Skip to content

Commit

Permalink
Merge pull request #27424 from ministryofjustice/adding-service-acc-p…
Browse files Browse the repository at this point in the history
…ermissions

adding service account permissions for stateful sets and volumes
  • Loading branch information
a5rar authored Nov 1, 2024
2 parents bc20464 + d698df7 commit 3c02649
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module "serviceaccount" {

serviceaccount_token_rotated_date = "01-01-2000"
serviceaccount_name = "laa-sds-serviceaccount-dev"
serviceaccount_rules = var.serviceaccount_rules

# Uncomment and provide repository names to create github actions secrets
# containing the ca.crt and token for use in github actions CI/CD pipelines
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,72 @@ variable "github_token" {
variable "eks_cluster_name" {
description = "The name of the EKS cluster"
}

variable "serviceaccount_rules" {
description = "The capabilities of this serviceaccount"

type = list(object({
api_groups = list(string),
resources = list(string),
verbs = list(string)
}))

# These values are usually sufficient for a CI/CD pipeline
default = [
{
api_groups = [""]
resources = [
"pods/portforward",
"deployment",
"secrets",
"services",
"serviceaccounts",
"pods",
"pods/exec",
"configmaps",
"statefulsets",
"persistentvolumeclaims",
]
verbs = [
"patch",
"get",
"create",
"update",
"delete",
"list",
"watch",
"update",
]
},
{
api_groups = [
"extensions",
"apps",
"batch",
"networking.k8s.io",
"monitoring.coreos.com",
"policy",
]
resources = [
"deployments",
"ingresses",
"cronjobs",
"jobs",
"replicasets",
"statefulsets",
"servicemonitors",
"networkpolicies",
"poddisruptionbudgets",
]
verbs = [
"get",
"update",
"delete",
"create",
"patch",
"list",
"watch",
]
}
]
}

0 comments on commit 3c02649

Please sign in to comment.