Skip to content

Commit 9494457

Browse files
test: test gcloud service account kube
1 parent 1da1269 commit 9494457

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

.github/workflows/test-workflow.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,15 @@ jobs:
2323
with:
2424
create_credentials_file: true
2525
workload_identity_provider: 'projects/1006240973223/locations/global/workloadIdentityPools/gha-create-gke-cluster/providers/github-actions'
26-
service_account: '[email protected]'
26+
service_account: '[email protected]'
27+
- name: Set up kubectl
28+
uses: azure/setup-kubectl@v3
29+
with:
30+
version: 'v1.28.0'
31+
- name: Configure gcloud CLI
32+
run: |
33+
gcloud config set project code-idp
34+
gcloud container clusters get-credentials code-idp-gke --zone europe-west1
35+
- name: Deploy to GKE
36+
run: |
37+
kubectl get pods -n submissions-2024

kubernetes-terraform-config/main.tf

+7
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,13 @@ resource "kubernetes_role_binding" "github_actions_rolebinding" {
193193
name = kubernetes_service_account.github_actions_account.metadata[0].name
194194
namespace = kubernetes_namespace.submissions_namespace.metadata[0].name
195195
}
196+
197+
subject {
198+
kind = "User"
199+
200+
namespace = kubernetes_namespace.submissions_namespace.metadata[0].name
201+
api_group = "rbac.authorization.k8s.io"
202+
}
196203
}
197204

198205
resource "kubernetes_secret" "github_actions_token" {

0 commit comments

Comments
 (0)