-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 226eae3
Showing
7 changed files
with
144 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,11 @@ | ||
test: fmt init validate | ||
|
||
i init: | ||
terraform init | ||
|
||
v validate: | ||
terraform validate | ||
|
||
f fmt: | ||
terraform fmt -recursive | ||
|
Empty file.
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,13 @@ | ||
locals { | ||
kubeconfig = abspath(pathexpand(var.kubeconfig_filename)) | ||
suffix = random_string.suffix.result | ||
secret = random_string.secret.result | ||
|
||
# git_clone = <<EOF | ||
# if ! [ -d kubespray ]; then | ||
# git clone --recurse-submodules $GIT_REPO $GIT_WORK_TREE | ||
# fi | ||
# cd $GIT_WORK_TREE | ||
# git checkout -b $GIT_BRANCH | ||
# EOF | ||
} |
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,11 @@ | ||
module "internet" { | ||
source = "github.com/getupcloud/terraform-module-internet?ref=main" | ||
} | ||
|
||
module "flux" { | ||
source = "github.com/getupcloud/terraform-module-flux?ref=main" | ||
|
||
git_repo = var.flux_git_repo | ||
manifests_path = "./clusters/${var.name}/eks/manifests" | ||
wait = var.flux_wait | ||
} |
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,40 @@ | ||
terraform { | ||
required_providers { | ||
cronitor = { | ||
source = "nauxliu/cronitor" | ||
version = "~> 1" | ||
} | ||
|
||
shell = { | ||
source = "scottwinkler/shell" | ||
version = "~> 1" | ||
} | ||
|
||
kubectl = { | ||
source = "gavinbunney/kubectl" | ||
version = "~> 1" | ||
} | ||
|
||
random = { | ||
version = "~> 2" | ||
} | ||
|
||
kubernetes = { | ||
version = "~> 2.3.2" | ||
} | ||
} | ||
} | ||
|
||
provider "shell" { | ||
enable_parallelism = true | ||
interpreter = ["/bin/bash", "-c"] | ||
} | ||
|
||
provider "kubectl" { | ||
config_path = var.kubeconfig_filename | ||
apply_retry_count = 2 | ||
} | ||
|
||
provider "kubernetes" { | ||
config_path = var.kubeconfig_filename | ||
} |
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,12 @@ | ||
resource "random_string" "suffix" { | ||
length = 16 | ||
special = false | ||
upper = false | ||
} | ||
|
||
resource "random_string" "secret" { | ||
length = 128 | ||
special = false | ||
upper = true | ||
number = true | ||
} |
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,57 @@ | ||
variable "name" { | ||
description = "Cluster name" | ||
type = string | ||
} | ||
|
||
#variable "git_repo" { | ||
# description = "Kubespray git repository" | ||
# type = string | ||
# default = "https://github.com/kubernetes-sigs/kubespray.git" | ||
#} | ||
|
||
#variable "git_branch" { | ||
# description = "Kubespray branch name" | ||
# type = string | ||
# default = "release-2.17" | ||
#} | ||
|
||
variable "kubeconfig_filename" { | ||
description = "Kubeconfig path" | ||
default = "~/.kube/config" | ||
type = string | ||
} | ||
|
||
variable "get_kubeconfig_command" { | ||
description = "Command to create/update kubeconfig" | ||
default = "true" | ||
} | ||
|
||
variable "flux_git_repo" { | ||
description = "GitRepository URL." | ||
type = string | ||
default = "" | ||
} | ||
|
||
variable "flux_wait" { | ||
description = "Wait for all manifests to apply" | ||
type = bool | ||
default = true | ||
} | ||
|
||
variable "manifests_path" { | ||
description = "Manifests dir inside GitRepository" | ||
type = string | ||
default = "" | ||
} | ||
|
||
variable "cronitor_api_key" { | ||
description = "Wait for all manifests to apply" | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "cronitor_pagerduty_key" { | ||
description = "Wait for all manifests to apply" | ||
type = string | ||
default = null | ||
} |