-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path00-deploy.tf
74 lines (70 loc) · 1.47 KB
/
00-deploy.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
provider "shipa" {
host = "https://target.shipa.cloud:8081"
token = var.shipa_token
}
resource "shipa_framework" "tf-framework" {
framework {
name = var.framework_name
provisioner = "kubernetes"
resources {
general {
setup {
public = false
default = false
}
security {
disable_scan = true
}
router = "traefik"
app_quota {
limit = "5"
}
access {
append = ["shipa-team"]
}
plan {
name = "shipa-plan"
}
container_policy {
// allowed_hosts = ["docker.io/shipasoftware", "docker.io/shiparepo"]
allowed_hosts = []
}
}
}
}
}
resource "shipa_cluster" "tf-cluster" {
depends_on = [shipa_framework.tf-framework]
cluster {
name = var.cluster_name
endpoint {
addresses = [var.cluster_ip]
ca_cert = <<-EOT
-----BEGIN CERTIFICATE-----
${var.cluster_cacert}
-----END CERTIFICATE-----
EOT
token = var.cluster_token
}
resources {
frameworks {
name = [var.framework_name]
}
}
}
}
resource "shipa_app" "tf-app" {
depends_on = [shipa_cluster.tf-cluster]
app {
name = var.app_name
teamowner = "shipa-team"
framework = var.framework_name
}
}
resource "shipa_app_deploy" "tf-app-deploy" {
depends_on = [shipa_app.tf-app]
app = shipa_app.tf-app.app[0].name
deploy {
image = var.app_image
}
}