Skip to content

Commit

Permalink
update to use civo installed apps
Browse files Browse the repository at this point in the history
  • Loading branch information
jhole89 committed Jun 17, 2020
1 parent 4a1f072 commit 043d7f3
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 120 deletions.
112 changes: 0 additions & 112 deletions civo-portainer-k3s/apps/portainer.tf

This file was deleted.

3 changes: 2 additions & 1 deletion civo-portainer-k3s/cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ locals {
}

resource "civo_kubernetes_cluster" "k3s" {
name = "dev_k3s"
name = "my_k3s"
num_target_nodes = 3
target_nodes_size = "g2.small"
tags = "terraform"
applications = "Portainer,Longhorn"

provisioner "local-exec" {
command = "echo '${civo_kubernetes_cluster.k3s.kubeconfig}' > ${local.kubeconf_path}"
Expand Down
22 changes: 22 additions & 0 deletions civo-portainer-k3s/ingress/ingress.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
resource "kubernetes_ingress" "portainer" {
metadata {
name = "portainer"
namespace = "portainer"
annotations = {
"ingress.class" = "traefik"
}
}
spec {
rule {
http {
path {
path = "/"
backend {
service_name = "portainer"
service_port = "http"
}
}
}
}
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ variable "kubeconf_path" {}
variable "config_user" {}

variable "cluster_name" {}

variable "cluster_dns" {}
5 changes: 2 additions & 3 deletions civo-portainer-k3s/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ module "cluster" {
auth_token = var.auth_token
}

module "apps" {
source = "./apps"
module "ingress" {
source = "./ingress"

kubeconf_path = module.cluster.kubeconf_path
config_user = module.cluster.config_user
cluster_dns = module.cluster.cluster_dns
cluster_name = module.cluster.cluster_name
}
4 changes: 2 additions & 2 deletions civo-portainer-k3s/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
output "portainer_url" {
value = module.apps.portainer_url
output "url" {
value = module.cluster.cluster_dns
}

0 comments on commit 043d7f3

Please sign in to comment.