This repository has been archived by the owner on Aug 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add azure and openstack examples (#31)
- Loading branch information
Showing
6 changed files
with
136 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,9 @@ | ||
# Azure Example | ||
|
||
This examples shows how to create Kubermatic project and deploy Kubernetes cluster on Azure using Terraform. | ||
|
||
To run, set up your Azure provider credentials. Configure Kubermatic host address. | ||
|
||
Running the example | ||
|
||
run `terraform apply` to see it work. |
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,44 @@ | ||
provider kubermatic { | ||
host = "set_it_up" | ||
} | ||
resource "kubermatic_project" "example_project" { | ||
name = var.project_name | ||
} | ||
resource "kubermatic_cluster" "example_cluster" { | ||
name = var.cluster_name | ||
dc_name = "azure-westeurope" | ||
project_id = kubermatic_project.example_project.id | ||
spec { | ||
version = var.k8s_version | ||
cloud { | ||
azure { | ||
client_id = "set_it_up" | ||
subscription_id = "set_it_up" | ||
tenant_id = "set_it_up" | ||
client_secret = "set_it_up" | ||
} | ||
} | ||
} | ||
} | ||
resource "kubermatic_node_deployment" "example_node" { | ||
name = "examplenode" | ||
cluster_id = kubermatic_cluster.example_cluster.id | ||
spec { | ||
replicas = 2 | ||
template { | ||
cloud { | ||
azure { | ||
size = "Standard_D1_v2" | ||
} | ||
} | ||
operating_system { | ||
ubuntu { | ||
dist_upgrade_on_boot = false | ||
} | ||
} | ||
versions { | ||
kubelet = var.k8s_version | ||
} | ||
} | ||
} | ||
} |
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,14 @@ | ||
variable "project_name" { | ||
description = "Name of the Kubermatic project" | ||
default = "exampleProject" | ||
} | ||
|
||
variable "cluster_name" { | ||
description = "Name of the Kubermatic cluster" | ||
default = "exampleCluster" | ||
} | ||
|
||
variable "k8s_version" { | ||
description = "The Kubernetes version" | ||
default = "1.17.9" | ||
} |
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,9 @@ | ||
# OpenStack Example | ||
|
||
This examples shows how to create Kubermatic project and deploy Kubernetes cluster on OpenStack using Terraform. | ||
|
||
To run, set up your OpenStack provider credentials. Configure Kubermatic host address. | ||
|
||
Running the example | ||
|
||
run `terraform apply` to see it work. |
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,46 @@ | ||
provider kubermatic { | ||
host = "set_it_up" | ||
} | ||
resource "kubermatic_project" "example_project" { | ||
name = var.project_name | ||
} | ||
resource "kubermatic_cluster" "example_cluster" { | ||
name = var.cluster_name | ||
dc_name = "set_it_up" | ||
project_id = kubermatic_project.example_project.id | ||
credential = "loodse" | ||
spec { | ||
version = "1.17.9" | ||
cloud { | ||
openstack { | ||
floating_ip_pool = "" | ||
password = "set_it_up" | ||
tenant = "set_it_up" | ||
username = "set_it_up" | ||
} | ||
} | ||
} | ||
} | ||
resource "kubermatic_node_deployment" "example_node" { | ||
name = "examplenode" | ||
cluster_id = kubermatic_cluster.example_cluster.id | ||
spec { | ||
replicas = 2 | ||
template { | ||
cloud { | ||
openstack { | ||
flavor = "l1c.tiny" | ||
image = "kubermatic-e2e-ubuntu" | ||
} | ||
} | ||
operating_system { | ||
ubuntu { | ||
dist_upgrade_on_boot = false | ||
} | ||
} | ||
versions { | ||
kubelet = var.k8s_version | ||
} | ||
} | ||
} | ||
} |
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,14 @@ | ||
variable "project_name" { | ||
description = "Name of the Kubermatic project" | ||
default = "exampleProject" | ||
} | ||
|
||
variable "cluster_name" { | ||
description = "Name of the Kubermatic cluster" | ||
default = "exampleCluster" | ||
} | ||
|
||
variable "k8s_version" { | ||
description = "The Kubernetes version" | ||
default = "1.17.9" | ||
} |