Added terraform
This commit is contained in:
parent
5a1e9fa22c
commit
489e3779d3
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.terraform
|
9
terraform/blockStorage.tf
Normal file
9
terraform/blockStorage.tf
Normal file
@ -0,0 +1,9 @@
|
||||
# resource "scaleway_instance_volume" "kubernetes" {
|
||||
# type = "l_ssd"
|
||||
# name = "kubernetes"
|
||||
# size_in_gb = 100
|
||||
# }
|
||||
|
||||
# output "block-storage-id" {
|
||||
# value = scaleway_instance_volume.kubernetes.id
|
||||
# }
|
8
terraform/bucket.tf
Normal file
8
terraform/bucket.tf
Normal file
@ -0,0 +1,8 @@
|
||||
resource "scaleway_object_bucket" "kubernetes" {
|
||||
name = "cluster.fun"
|
||||
acl = "private"
|
||||
}
|
||||
|
||||
output "bucket_id" {
|
||||
value = scaleway_object_bucket.kubernetes.id
|
||||
}
|
36
terraform/kubernetes.tf
Normal file
36
terraform/kubernetes.tf
Normal file
@ -0,0 +1,36 @@
|
||||
resource "scaleway_k8s_cluster_beta" "k8s-cluster" {
|
||||
name = "cluster-fun"
|
||||
description = ""
|
||||
version = "1.18.2"
|
||||
cni = "weave"
|
||||
enable_dashboard = false
|
||||
ingress = "traefik"
|
||||
|
||||
default_pool {
|
||||
node_type = "DEV1-M"
|
||||
size = 1
|
||||
autoscaling = true
|
||||
autohealing = true
|
||||
min_size = 1
|
||||
max_size = 2
|
||||
}
|
||||
|
||||
feature_gates = [
|
||||
"EphemeralContainers",
|
||||
"HPAScaleToZero",
|
||||
"TTLAfterFinished"
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
output "api_server" {
|
||||
value = scaleway_k8s_cluster_beta.k8s-cluster.apiserver_url
|
||||
}
|
||||
|
||||
output "wildcard_dns" {
|
||||
value = scaleway_k8s_cluster_beta.k8s-cluster.wildcard_dns
|
||||
}
|
||||
|
||||
output "kubeconfig" {
|
||||
value = scaleway_k8s_cluster_beta.k8s-cluster.kubeconfig
|
||||
}
|
4
terraform/provider.tf
Normal file
4
terraform/provider.tf
Normal file
@ -0,0 +1,4 @@
|
||||
provider "scaleway" {
|
||||
zone = "fr-par-1"
|
||||
region = "fr-par"
|
||||
}
|
10
terraform/state.tf
Normal file
10
terraform/state.tf
Normal file
@ -0,0 +1,10 @@
|
||||
terraform {
|
||||
backend "s3" {
|
||||
bucket = "cluster.fun-tfstate"
|
||||
key = "state.tfstate"
|
||||
region = "fr-par"
|
||||
endpoint = "https://s3.fr-par.scw.cloud"
|
||||
skip_credentials_validation = true
|
||||
skip_region_validation = true
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user