From 009b3f0ccd5ea2d0d1738fa01be861a4dab0e478 Mon Sep 17 00:00:00 2001 From: rito528 <39003544+rito528@users.noreply.github.com> Date: Thu, 16 May 2024 00:20:02 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20event-source=E3=81=AE=E5=AE=9A=E7=BE=A9?= =?UTF-8?q?=E3=81=AE=E4=B8=8D=E8=B6=B3=E5=88=86=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../seichiassist-downloader/event-source.yaml | 5 +++++ terraform/main.tf | 10 ++++++++++ terraform/onp_cluster_minecraft_secrets.tf | 16 ++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-minecraft/seichiassist-downloader/event-source.yaml b/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-minecraft/seichiassist-downloader/event-source.yaml index 4418f3c29..60746f902 100644 --- a/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-minecraft/seichiassist-downloader/event-source.yaml +++ b/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-minecraft/seichiassist-downloader/event-source.yaml @@ -13,5 +13,10 @@ spec: webhook: endpoint: /create-seichiassist-release port: "12000" + method: POST + url: https://argo-wf-webhook.onp-k8s.admin.seichi.click events: - "release" + apiToken: + name: argo-events-github-access-token + key: ARGO_EVENTS_GITHUB_ACCESS_TOKEN diff --git a/terraform/main.tf b/terraform/main.tf index b0241e537..b199db377 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -349,3 +349,13 @@ variable "hackmd_mariadb_hackmd_db_url" { } #endregion + +# region env variables for ArgoEvents + +variable "argo_events_github_access_token" { + description = "ArgoEvents GitHub access token" + type = string + sensitive = true +} + +# endregion diff --git a/terraform/onp_cluster_minecraft_secrets.tf b/terraform/onp_cluster_minecraft_secrets.tf index 85b73bf14..c53fcae58 100644 --- a/terraform/onp_cluster_minecraft_secrets.tf +++ b/terraform/onp_cluster_minecraft_secrets.tf @@ -59,6 +59,22 @@ resource "kubernetes_secret" "onp_minecraft_prod_kagawa_secrets" { type = "Opaque" } +resource "kubernetes_secret" "argo_events_github_access_token" { + depends_on = [kubernetes_namespace.onp_seichi_minecraft] + + metadata { + name = "argo-events-github-access-token" + namespace = "seichi-minecraft" + } + + data = { + # ref: https://github.com/argoproj/argo-events/blob/4636435578ae2396fa637e4ed44c2d2edbbec58b/examples/event-sources/github.yaml#L54 + ARGO_EVENTS_GITHUB_ACCESS_TOKEN = base64encode(var.argo_events_github_access_token) + } + + type = "Opaque" +} + resource "random_password" "minecraft__prod_mariadb_root_password" { length = 16 special = true