kite 0.2.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +130 -66
  3. data/LICENSE.md +202 -0
  4. data/README.md +35 -11
  5. data/bin/concourse/out +16 -20
  6. data/docs/kite-concourse-resource.md +45 -0
  7. data/kite.gemspec +1 -0
  8. data/lib/kite.rb +3 -1
  9. data/lib/kite/cloud.rb +1 -0
  10. data/lib/kite/core.rb +8 -2
  11. data/lib/kite/generate.rb +12 -46
  12. data/lib/kite/helpers.rb +0 -72
  13. data/lib/kite/helpers/concourse.rb +3 -2
  14. data/lib/kite/module.rb +76 -0
  15. data/lib/kite/terraform.rb +45 -0
  16. data/lib/kite/version.rb +1 -1
  17. data/tpl/aws/environment/main.tf.tt +5 -0
  18. data/tpl/aws/environment/s3.tf.tt +13 -0
  19. data/tpl/gcp/environment/gcs.tf.tt +18 -0
  20. data/tpl/gcp/environment/main.tf.tt +5 -0
  21. data/tpl/gcp/environment/outputs.tf.tt +5 -0
  22. data/tpl/service/%output_path%/pipelines/review.yml.tt +55 -37
  23. data/tpl/service/%output_path%/pipelines/tasks/create-pull-requests-tag.yml.tt +1 -1
  24. data/tpl/service/%output_path%/pipelines/tasks/create-repository-tag.yml.tt +1 -1
  25. data/tpl/service/%output_path%/pipelines/tasks/run-unit.yml.tt +7 -0
  26. data/tpl/service/Makefile.tt +11 -7
  27. data/tpl/service/docs/getting-started.md +73 -0
  28. data/tpl/service/docs/service.md +101 -0
  29. data/tpl/skel/Gemfile.tt +0 -9
  30. data/tpl/skel/config/cloud.yml +11 -66
  31. metadata +29 -88
  32. data/lib/kite/render.rb +0 -116
  33. data/tpl/aws/README.md +0 -52
  34. data/tpl/aws/bin/base/bootstrap.sh +0 -35
  35. data/tpl/aws/bin/base/cleanup.sh.tt +0 -19
  36. data/tpl/aws/bin/base/set-env.sh.tt +0 -7
  37. data/tpl/aws/bin/base/setup-tunnel.sh.tt +0 -4
  38. data/tpl/aws/bin/bosh-install.sh.tt +0 -23
  39. data/tpl/aws/bin/concourse-deploy.sh.tt +0 -14
  40. data/tpl/aws/bin/ingress-deploy.sh.tt +0 -7
  41. data/tpl/aws/bin/ingress-update.sh.tt +0 -7
  42. data/tpl/aws/bin/kops-delete.sh.erb +0 -5
  43. data/tpl/aws/bin/kops-deploy.sh.erb +0 -11
  44. data/tpl/aws/bin/oauth-deploy.sh.tt +0 -17
  45. data/tpl/aws/bin/prometheus-deploy.sh.tt +0 -23
  46. data/tpl/aws/bin/vault-deploy.sh.tt +0 -10
  47. data/tpl/aws/bosh-vars.yml.erb +0 -12
  48. data/tpl/aws/config/oauth.yml +0 -59
  49. data/tpl/aws/deployments/bosh/bosh.yml +0 -144
  50. data/tpl/aws/deployments/bosh/cloud-config.yml.tt +0 -86
  51. data/tpl/aws/deployments/bosh/cpi.yml +0 -98
  52. data/tpl/aws/deployments/bosh/jumpbox-user.yml +0 -27
  53. data/tpl/aws/deployments/concourse/concourse.yml.tt +0 -98
  54. data/tpl/aws/deployments/ingress/ingress.yml.erb +0 -78
  55. data/tpl/aws/deployments/oauth/oauth.yml.tt +0 -95
  56. data/tpl/aws/deployments/prometheus/monitor-bosh.yml +0 -518
  57. data/tpl/aws/deployments/prometheus/monitor-kubernetes.yml +0 -30
  58. data/tpl/aws/deployments/prometheus/prometheus.yml.tt +0 -184
  59. data/tpl/aws/deployments/vault/vault.yml.erb +0 -38
  60. data/tpl/aws/docs/bosh.md +0 -31
  61. data/tpl/aws/docs/concourse.md +0 -41
  62. data/tpl/aws/docs/ingress.md +0 -14
  63. data/tpl/aws/docs/kops.md +0 -35
  64. data/tpl/aws/docs/oauth.md +0 -24
  65. data/tpl/aws/docs/prometheus.md +0 -31
  66. data/tpl/aws/docs/vault.md +0 -35
  67. data/tpl/aws/terraform/kite_bucket.tf +0 -8
  68. data/tpl/aws/terraform/main.tf.tt +0 -36
  69. data/tpl/aws/terraform/network.tf.tt +0 -252
  70. data/tpl/aws/terraform/outputs.tf +0 -19
  71. data/tpl/aws/terraform/terraform.tfvars.tt +0 -21
  72. data/tpl/aws/terraform/variables.tf +0 -73
  73. data/tpl/gcp/README.md +0 -54
  74. data/tpl/gcp/bin/base/bootstrap.sh +0 -35
  75. data/tpl/gcp/bin/base/cleanup.sh.tt +0 -20
  76. data/tpl/gcp/bin/base/set-env.sh.tt +0 -10
  77. data/tpl/gcp/bin/base/setup-tunnel.sh.tt +0 -13
  78. data/tpl/gcp/bin/bosh-install.sh.tt +0 -22
  79. data/tpl/gcp/bin/concourse-deploy.sh.tt +0 -14
  80. data/tpl/gcp/bin/ingress-deploy.sh.tt +0 -7
  81. data/tpl/gcp/bin/ingress-update.sh.tt +0 -7
  82. data/tpl/gcp/bin/oauth-deploy.sh.tt +0 -19
  83. data/tpl/gcp/bin/prometheus-deploy.sh.tt +0 -23
  84. data/tpl/gcp/bin/vault-deploy.sh.tt +0 -10
  85. data/tpl/gcp/bosh-vars.yml.erb +0 -9
  86. data/tpl/gcp/config/oauth.yml +0 -59
  87. data/tpl/gcp/deployments/bosh/bosh.yml +0 -144
  88. data/tpl/gcp/deployments/bosh/cloud-config.yml.tt +0 -73
  89. data/tpl/gcp/deployments/bosh/cpi.yml +0 -69
  90. data/tpl/gcp/deployments/bosh/jumpbox-user.yml +0 -27
  91. data/tpl/gcp/deployments/concourse/concourse.yml.tt +0 -104
  92. data/tpl/gcp/deployments/concourse/test/test-credentials.yml +0 -3
  93. data/tpl/gcp/deployments/concourse/test/test-pipeline.yml +0 -24
  94. data/tpl/gcp/deployments/ingress/ingress.yml.erb +0 -111
  95. data/tpl/gcp/deployments/oauth/oauth.yml.tt +0 -95
  96. data/tpl/gcp/deployments/prometheus/monitor-bosh.yml +0 -518
  97. data/tpl/gcp/deployments/prometheus/monitor-kubernetes.yml +0 -30
  98. data/tpl/gcp/deployments/prometheus/prometheus.yml +0 -183
  99. data/tpl/gcp/deployments/vault/vault.yml.erb +0 -37
  100. data/tpl/gcp/docs/bosh.md +0 -36
  101. data/tpl/gcp/docs/concourse.md +0 -41
  102. data/tpl/gcp/docs/ingress.md +0 -12
  103. data/tpl/gcp/docs/oauth.md +0 -24
  104. data/tpl/gcp/docs/prometheus.md +0 -27
  105. data/tpl/gcp/docs/vault.md +0 -36
  106. data/tpl/gcp/terraform/gcs.tf.tt +0 -18
  107. data/tpl/gcp/terraform/main.tf +0 -70
  108. data/tpl/gcp/terraform/network.tf +0 -52
  109. data/tpl/gcp/terraform/outputs.tf +0 -7
  110. data/tpl/gcp/terraform/terraform.tfvars.tt +0 -15
  111. data/tpl/gcp/terraform/variables.tf +0 -37
  112. data/tpl/service/%output_path%/pipelines/tasks/helm-deploy.yml.tt +0 -22
  113. data/tpl/service/%output_path%/pipelines/tasks/run-master-tests.yml.tt +0 -12
  114. data/tpl/service/%output_path%/pipelines/tasks/run-pr-tests.yml.tt +0 -12
  115. data/tpl/skel/docs/index.md.tt +0 -0
  116. data/tpl/skel/docs/quickstart.md.tt +0 -0
@@ -1,70 +0,0 @@
1
- provider "google" {
2
- credentials = "${file("${var.credentials}")}"
3
- project = "${var.project}"
4
- region = "${var.region}"
5
- version = "= 0.1.3"
6
- }
7
-
8
- # Allow SSH to Platform Bastion
9
- resource "google_compute_firewall" "bastion" {
10
- name = "bastion-rules"
11
- network = "${google_compute_network.platform.name}"
12
-
13
- allow {
14
- protocol = "icmp"
15
- }
16
-
17
- allow {
18
- protocol = "tcp"
19
- ports = ["22"]
20
- }
21
-
22
- target_tags = ["bastion"]
23
- }
24
-
25
- # Bastion host
26
- resource "google_compute_address" "bastion" {
27
- name = "bastion-ip"
28
- }
29
-
30
- resource "google_compute_instance" "bastion" {
31
- name = "bastion"
32
- machine_type = "g1-small"
33
- zone = "${var.zone}"
34
-
35
- tags = ["bastion", "platform-internal"]
36
-
37
- boot_disk {
38
- initialize_params {
39
- image = "debian-cloud/debian-8"
40
- }
41
- }
42
-
43
- network_interface {
44
- subnetwork = "${google_compute_subnetwork.platform_net.name}"
45
- access_config {
46
- nat_ip = "${google_compute_address.bastion.address}"
47
- }
48
- }
49
-
50
- can_ip_forward = true
51
-
52
- metadata {
53
- sshKeys = "kite:${file(var.public_key)}"
54
- }
55
-
56
- metadata_startup_script = <<EOT
57
- #!/bin/bash
58
- sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
59
- iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
60
- EOT
61
-
62
- service_account {
63
- scopes = ["userinfo-email", "compute-ro", "storage-ro"]
64
- }
65
- }
66
-
67
- # Ingress
68
- resource "google_compute_address" "ingress" {
69
- name = "ingress-ip"
70
- }
@@ -1,52 +0,0 @@
1
- resource "google_compute_network" "platform" {
2
- name = "${var.vpc_name}"
3
- }
4
-
5
- # Subnet for the Platform tools
6
- resource "google_compute_subnetwork" "platform_net" {
7
- name = "${var.platform_subnet_name}"
8
- ip_cidr_range = "${var.subnet_cidr}"
9
- network = "${google_compute_network.platform.self_link}"
10
- }
11
-
12
- resource "google_compute_route" "platform-gate" {
13
- name = "platform-gate"
14
- dest_range = "0.0.0.0/0"
15
- network = "${google_compute_network.platform.name}"
16
- next_hop_instance = "${google_compute_instance.bastion.name}"
17
- next_hop_instance_zone = "${var.zone}"
18
- priority = 800
19
- tags = ["no-ip"]
20
- project = "${var.project}"
21
- }
22
-
23
- # Allow open access between internal VM
24
- resource "google_compute_firewall" "platform_internal" {
25
- name = "platform-internal"
26
- network = "${google_compute_network.platform.name}"
27
-
28
- allow {
29
- protocol = "icmp"
30
- }
31
-
32
- allow {
33
- protocol = "tcp"
34
- }
35
-
36
- allow {
37
- protocol = "udp"
38
- }
39
- target_tags = ["platform-internal"]
40
- source_tags = ["platform-internal"]
41
- }
42
-
43
- # Allow concourse
44
- resource "google_compute_firewall" "allow_concourse" {
45
- name = "allow-concourse"
46
- network = "${google_compute_network.platform.name}"
47
-
48
- allow {
49
- protocol = "all"
50
- }
51
-
52
- }
@@ -1,7 +0,0 @@
1
- output "bastion_ip" {
2
- value = "${google_compute_address.bastion.address}"
3
- }
4
-
5
- output "ingress_ip" {
6
- value = "${google_compute_address.ingress.address}"
7
- }
@@ -1,15 +0,0 @@
1
- # Kite config
2
- keypair_name = "<%= @values['kite']['keypair_name'] %>"
3
- public_key = "<%= @values['kite']['public_key_path'] %>"
4
- private_key = "<%= @values['kite']['private_key_path'] %>"
5
-
6
- # Credentials
7
- credentials = "<%= @values['gcp']['service_account'] %>"
8
- project = "<%= @values['gcp']['project'] %>"
9
- region = "<%= @values['gcp']['region'] %>"
10
- zone = "<%= @values['gcp']['zone'] %>"
11
-
12
- # Network Config
13
- vpc_name = "<%= @values['gcp']['vpc_name'] %>"
14
- platform_subnet_name = "<%= @values['gcp']['subnet_name'] %>"
15
- subnet_cidr = "<%= @values['gcp']['subnet_cidr'] %>"
@@ -1,37 +0,0 @@
1
-
2
- variable "project" {
3
- type = "string"
4
- }
5
-
6
- variable "region" {
7
- type = "string"
8
- default = "us-east1"
9
- }
10
-
11
- variable "zone" {
12
- type = "string"
13
- default = "us-east1-d"
14
- }
15
-
16
- variable "credentials" {
17
- type = "string"
18
- }
19
-
20
- variable "vpc_name" {
21
- type = "string"
22
- default = "platform-tools"
23
- }
24
-
25
- variable "platform_subnet_name" {
26
- type = "string"
27
- default = "platform-net"
28
- }
29
-
30
- variable "subnet_cidr" {
31
- type = "string"
32
- default = "10.0.0.0/24"
33
- }
34
-
35
- variable "public_key" {
36
- type = "string"
37
- }
@@ -1,22 +0,0 @@
1
- ---
2
- platform: linux
3
-
4
- image_resource:
5
- type: docker-image
6
- source:
7
- repository: heliostech/kite
8
-
9
- inputs:
10
- - name: <%= @name %>-repository
11
-
12
- run:
13
- path: "sh"
14
- args:
15
- - "-exc"
16
- - |
17
- helm init --client-only
18
- echo ${GOOGLE_APPLICATION_JSON} > gcr_credentials.json
19
- export GOOGLE_APPLICATION_CREDENTIALS="${PWD}/gcr_credentials.json"
20
- echo ${KUBECONFIG_FILE} | tr -d ' ' | base64 -d > kubeconfig
21
- export KUBECONFIG="${PWD}/kubeconfig"
22
- helm install <%= @name %>-repository/.kite/charts/<%= @name %>
@@ -1,12 +0,0 @@
1
- ---
2
- platform: linux
3
- image_resource:
4
- type: docker-image
5
- source:
6
- repository: <%= @image %>
7
- username: _json_key
8
- password: ((gcr_password))
9
-
10
- run:
11
- path: sh
12
- args: ["-exc", "echo Success"]
@@ -1,12 +0,0 @@
1
- ---
2
- platform: linux
3
- image_resource:
4
- type: docker-image
5
- source:
6
- repository: <%= @image %>
7
- username: _json_key
8
- password: ((gcr_password))
9
-
10
- run:
11
- path: sh
12
- args: ["-exc", "echo Success"]
File without changes
File without changes