Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dennis Zielke
committed
Apr 29, 2019
1 parent
f08ac6d
commit 8847499
Showing
10 changed files
with
204 additions
and
98 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
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
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
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
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,48 @@ | ||
# https://www.terraform.io/docs/providers/kubernetes/index.html | ||
|
||
provider "kubernetes" { | ||
host = "${azurerm_kubernetes_cluster.akstf.kube_config.0.host}" | ||
client_certificate = "${base64decode(azurerm_kubernetes_cluster.akstf.kube_config.0.client_certificate)}" | ||
client_key = "${base64decode(azurerm_kubernetes_cluster.akstf.kube_config.0.client_key)}" | ||
cluster_ca_certificate = "${base64decode(azurerm_kubernetes_cluster.akstf.kube_config.0.cluster_ca_certificate)}" | ||
} | ||
|
||
resource "kubernetes_namespace" "example" { | ||
metadata { | ||
name = "my-first-namespace" | ||
} | ||
|
||
depends_on = ["azurerm_kubernetes_cluster.akstf"] | ||
} | ||
|
||
resource "kubernetes_service_account" "tiller_service_account" { | ||
metadata { | ||
name = "tiller" | ||
namespace = "kube-system" | ||
} | ||
|
||
depends_on = ["azurerm_kubernetes_cluster.akstf"] | ||
} | ||
|
||
resource "kubernetes_cluster_role_binding" "tiller_cluster_role_binding" { | ||
metadata { | ||
name = "tiller" | ||
} | ||
role_ref { | ||
api_group = "rbac.authorization.k8s.io" | ||
kind = "ClusterRole" | ||
name = "cluster-admin" | ||
} | ||
subject { | ||
kind = "ServiceAccount" | ||
name = "default" | ||
namespace = "kube-system" | ||
} | ||
subject { | ||
kind = "ServiceAccount" | ||
name = "${kubernetes_service_account.tiller_service_account.metadata.0.name}" | ||
namespace = "kube-system" | ||
} | ||
|
||
depends_on = ["azurerm_kubernetes_cluster.akstf", "kubernetes_service_account.tiller_service_account"] | ||
} |
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
This file was deleted.
Oops, something went wrong.
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,55 @@ | ||
|
||
provider "helm" { | ||
install_tiller = "true" | ||
service_account = "${kubernetes_service_account.tiller_service_account.metadata.0.name}" | ||
|
||
kubernetes { | ||
host = "${azurerm_kubernetes_cluster.akstf.kube_config.0.host}" | ||
client_certificate = "${base64decode(azurerm_kubernetes_cluster.akstf.kube_config.0.client_certificate)}" | ||
client_key = "${base64decode(azurerm_kubernetes_cluster.akstf.kube_config.0.client_key)}" | ||
cluster_ca_certificate = "${base64decode(azurerm_kubernetes_cluster.akstf.kube_config.0.cluster_ca_certificate)}" | ||
} | ||
} | ||
|
||
# Create Static Public IP Address to be used by Nginx Ingress | ||
resource "azurerm_public_ip" "nginx_ingress" { | ||
name = "nginx-ingress-pip" | ||
location = "${azurerm_kubernetes_cluster.akstf.location}" | ||
resource_group_name = "${azurerm_kubernetes_cluster.akstf.node_resource_group}" | ||
allocation_method = "Static" | ||
domain_name_label = "${var.dns_prefix}" | ||
|
||
depends_on = ["azurerm_kubernetes_cluster.akstf"] | ||
} | ||
|
||
# https://www.terraform.io/docs/providers/helm/repository.html | ||
data "helm_repository" "stable" { | ||
name = "stable" | ||
url = "https://kubernetes-charts.storage.googleapis.com" | ||
} | ||
|
||
# Install Nginx Ingress using Helm Chart | ||
# https://www.terraform.io/docs/providers/helm/release.html | ||
resource "helm_release" "nginx_ingress" { | ||
name = "nginx-ingress" | ||
repository = "${helm_repository.stable.metadata.0.name}" | ||
chart = "nginx-ingress" | ||
namespace = "kube-system" | ||
|
||
set { | ||
name = "rbac.create" | ||
value = "true" | ||
} | ||
|
||
set { | ||
name = "controller.service.externalTrafficPolicy" | ||
value = "Local" | ||
} | ||
|
||
set { | ||
name = "controller.service.loadBalancerIP" | ||
value = "${azurerm_public_ip.nginx_ingress.ip_address}" | ||
} | ||
|
||
depends_on = ["azurerm_kubernetes_cluster.akstf", "azurerm_public_ip.nginx_ingress"] | ||
} |
Oops, something went wrong.