Added terraform

pull/1/head
Marcus Noble 3 years ago
parent 5a1e9fa22c
commit 489e3779d3
  1. 1
      .gitignore
  2. 9
      terraform/blockStorage.tf
  3. 8
      terraform/bucket.tf
  4. 36
      terraform/kubernetes.tf
  5. 4
      terraform/provider.tf
  6. 10
      terraform/state.tf

1
.gitignore vendored

@ -0,0 +1 @@
.terraform

@ -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
# }

@ -0,0 +1,8 @@
resource "scaleway_object_bucket" "kubernetes" {
name = "cluster.fun"
acl = "private"
}
output "bucket_id" {
value = scaleway_object_bucket.kubernetes.id
}

@ -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
}

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

@ -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…
Cancel
Save