Skip to content

Commit

Permalink
Fix simulator service account not being created for GKE.
Browse files Browse the repository at this point in the history
This addresses an issue that was missed in #1324.
  • Loading branch information
SanjayVas committed Feb 26, 2024
1 parent 8ea3a4b commit 33bc480
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/main/k8s/dev/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@wfa_common_jvm//build:defs.bzl", "expand_template")
load("@wfa_rules_cue//cue:defs.bzl", "cue_library")
load(
"//build:variables.bzl",
Expand All @@ -8,9 +9,8 @@ load(
"KINGDOM_K8S_SETTINGS",
"SIMULATOR_K8S_SETTINGS",
)
load("@wfa_common_jvm//build:defs.bzl", "expand_template")
load("//src/main/k8s:macros.bzl", "cue_dump")
load("//build/k8s:defs.bzl", "kustomization_dir")
load("//src/main/k8s:macros.bzl", "cue_dump")

SECRET_NAME = "certs-and-configs"

Expand Down Expand Up @@ -339,13 +339,13 @@ EDP_SIMULATOR_TAGS = {
"image_tag": IMAGE_REPOSITORY_SETTINGS.image_tag,
"kingdom_public_api_target": KINGDOM_K8S_SETTINGS.public_api_target,
"duchy_public_api_target": DUCHY_K8S_SETTINGS.public_api_target,
"google_cloud_project": GCLOUD_SETTINGS.project,
}

cue_dump(
name = "bigquery_edp_simulator_gke",
srcs = ["bigquery_edp_simulator_gke.cue"],
cue_tags = dict(EDP_SIMULATOR_TAGS.items() + {
"google_cloud_project": GCLOUD_SETTINGS.project,
"bigquery_dataset": SIMULATOR_K8S_SETTINGS.bigquery_dataset,
"bigquery_table": SIMULATOR_K8S_SETTINGS.bigquery_table,
}.items()),
Expand Down
11 changes: 0 additions & 11 deletions src/main/k8s/dev/bigquery_edp_simulator_gke.cue
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

package k8s

#SimulatorServiceAccount: "simulator"

_bigQueryConfig: #BigQueryConfig & {
dataset: string @tag("bigquery_dataset")
table: string @tag("bigquery_table")
Expand All @@ -41,16 +39,7 @@ edp_simulators: {
_container: {
resources: _resourceRequirements
}
spec: template: spec: #ServiceAccountPodSpec & {
serviceAccountName: #SimulatorServiceAccount
}
}
}
}
}

serviceAccounts: {
"\(#SimulatorServiceAccount)": #WorkloadIdentityServiceAccount & {
_iamServiceAccountName: "simulator"
}
}
11 changes: 10 additions & 1 deletion src/main/k8s/dev/edp_simulator_gke.cue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ _secret_name: string @tag("secret_name")
_kingdomPublicApiTarget: string @tag("kingdom_public_api_target")
_duchyPublicApiTarget: string @tag("duchy_public_api_target")

#SimulatorServiceAccount: "simulator"

objectSets: [
serviceAccounts,
configMaps,
Expand Down Expand Up @@ -62,7 +64,9 @@ edp_simulators: {
_mc_resource_name: _mc_name

deployment: {
spec: template: spec: #SpotVmPodSpec
spec: template: spec: #SpotVmPodSpec & #ServiceAccountPodSpec & {
serviceAccountName: #SimulatorServiceAccount
}
}
}
}
Expand All @@ -71,6 +75,11 @@ edp_simulators: {
serviceAccounts: [Name=string]: #ServiceAccount & {
metadata: name: Name
}
serviceAccounts: {
"\(#SimulatorServiceAccount)": #WorkloadIdentityServiceAccount & {
_iamServiceAccountName: "simulator"
}
}

configMaps: [Name=string]: #ConfigMap & {
metadata: name: Name
Expand Down

0 comments on commit 33bc480

Please sign in to comment.