Added terraform

This commit is contained in:
Marcus Noble 2020-04-25 20:03:46 +01:00
parent 5a1e9fa22c
commit 489e3779d3
6 changed files with 68 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.terraform

View 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
View 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
View 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
View File

@ -0,0 +1,4 @@
provider "scaleway" {
zone = "fr-par-1"
region = "fr-par"
}

10
terraform/state.tf Normal file
View 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
}
}