-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare ns dev for deploy with github runner
- Loading branch information
Valentin Khramtsov
committed
Aug 19, 2024
1 parent
bfb50d2
commit f2938b9
Showing
3 changed files
with
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
locals { | ||
dev_namespace = { | ||
namespace = local.namespaces[index(local.namespaces.*.id, "dev")].id | ||
enabled = local.namespaces[index(local.namespaces.*.id, "dev")].enabled | ||
} | ||
} | ||
|
||
module "dev_namespace" { | ||
count = local.dev_namespace.enabled ? 1 : 0 | ||
|
||
source = "../eks-kubernetes-namespace" | ||
name = local.dev_namespace.namespace | ||
network_policies = [] | ||
|
||
depends_on = [helm_release.gha_runner_scale_set] | ||
} | ||
resource "kubectl_manifest" "github_runner_role_binding" { | ||
count = local.dev_namespace.enabled && local.gha_runner_scale_set_controller.enabled ? 1 : 0 | ||
|
||
yaml_body = <<EOF | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: github-runner-role-binding | ||
namespace: ${local.dev_namespace.namespace} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: cluster-admin | ||
subjects: | ||
- kind: ServiceAccount | ||
name: gha-runner-scale-set-gha-rs-no-permission | ||
namespace: ${module.gha_runner_scale_set_controller_namespace[0].name} | ||
EOF | ||
|
||
depends_on = [module.dev_namespace] | ||
} | ||
|
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
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,3 @@ | ||
namespaces: | ||
- id: dev | ||
enabled: true |