Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
add azure and openstack examples (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
zreigz authored Oct 6, 2020
1 parent a8d8fff commit e41e333
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/azure/README.md
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.
44 changes: 44 additions & 0 deletions examples/azure/main.tf
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
}
}
}
}
14 changes: 14 additions & 0 deletions examples/azure/variables.tf
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"
}
9 changes: 9 additions & 0 deletions examples/openstack/README.md
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.
46 changes: 46 additions & 0 deletions examples/openstack/main.tf
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
}
}
}
}
14 changes: 14 additions & 0 deletions examples/openstack/variables.tf
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"
}

0 comments on commit e41e333

Please sign in to comment.