Skip to content

Commit

Permalink
feat: add open cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
incubator4 committed Oct 29, 2024
1 parent 7fd8697 commit 72d9256
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 25 deletions.
28 changes: 28 additions & 0 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,31 @@ resource "argocd_cluster" "ops" {
}

}

resource "argocd_cluster" "open_dev" {
server = "https://${data.google_container_cluster.open.endpoint}"
name = "open"

metadata {
labels = {
"env" = "open"
"secret" = "avp-prod"
"provider" = "gcp"
"cluster-type" = "gke-autopilot"
"tenant" = "3"
}
}

config {
exec_provider_config {
command = "argocd-k8s-auth"
args = ["gcp"]
api_version = "client.authentication.k8s.io/v1beta1"
}
tls_client_config {
insecure = false
ca_data = base64decode(data.google_container_cluster.us_central1_ops.master_auth[0].cluster_ca_certificate)
}
}

}
10 changes: 10 additions & 0 deletions gke.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ data "google_container_cluster" "us_central1_ops" {
location = "us-central1"
}

locals {
project_open = "open-440103"
}

data "google_container_cluster" "open" {
project = local.project_open
name = "open"
location = "us-central1"
}

provider "kubernetes" {
alias = "us-central1-dev"
host = "https://${data.google_container_cluster.us_central1_dev.endpoint}"
Expand Down
27 changes: 2 additions & 25 deletions repo_cred.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ locals {
"Crossbell-Box" = "53140935",
"RSS3-Network" = "53140941",
"RSSNext" = "53140947",
"webisopen" = "56516542",
}
}

Expand All @@ -15,28 +16,4 @@ resource "argocd_repository_credentials" "org" {
githubapp_id = var.GITHUB_APP_ID
githubapp_installation_id = each.value
githubapp_private_key = base64decode(var.GITHUB_APP_PRIVATE_KEY_BASE64)
}
#
# resource "argocd_repository_credentials" "nsl" {
# url = "https://github.com/NaturalSelectionLabs"
# username = "git"
# password = var.PAT
# }
#
# resource "argocd_repository_credentials" "crossbell" {
# url = "https://github.com/Crossbell-Box"
# username = "git"
# password = var.PAT
# }
#
# resource "argocd_repository_credentials" "rss3" {
# url = "https://github.com/RSS3-Network"
# username = "git"
# password = var.PAT
# }
#
# resource "argocd_repository_credentials" "rss-next" {
# url = "https://github.com/RSSNext"
# username = "git"
# password = var.PAT
# }
}

0 comments on commit 72d9256

Please sign in to comment.