kite 0.2.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +130 -66
- data/LICENSE.md +202 -0
- data/README.md +35 -11
- data/bin/concourse/out +16 -20
- data/docs/kite-concourse-resource.md +45 -0
- data/kite.gemspec +1 -0
- data/lib/kite.rb +3 -1
- data/lib/kite/cloud.rb +1 -0
- data/lib/kite/core.rb +8 -2
- data/lib/kite/generate.rb +12 -46
- data/lib/kite/helpers.rb +0 -72
- data/lib/kite/helpers/concourse.rb +3 -2
- data/lib/kite/module.rb +76 -0
- data/lib/kite/terraform.rb +45 -0
- data/lib/kite/version.rb +1 -1
- data/tpl/aws/environment/main.tf.tt +5 -0
- data/tpl/aws/environment/s3.tf.tt +13 -0
- data/tpl/gcp/environment/gcs.tf.tt +18 -0
- data/tpl/gcp/environment/main.tf.tt +5 -0
- data/tpl/gcp/environment/outputs.tf.tt +5 -0
- data/tpl/service/%output_path%/pipelines/review.yml.tt +55 -37
- data/tpl/service/%output_path%/pipelines/tasks/create-pull-requests-tag.yml.tt +1 -1
- data/tpl/service/%output_path%/pipelines/tasks/create-repository-tag.yml.tt +1 -1
- data/tpl/service/%output_path%/pipelines/tasks/run-unit.yml.tt +7 -0
- data/tpl/service/Makefile.tt +11 -7
- data/tpl/service/docs/getting-started.md +73 -0
- data/tpl/service/docs/service.md +101 -0
- data/tpl/skel/Gemfile.tt +0 -9
- data/tpl/skel/config/cloud.yml +11 -66
- metadata +29 -88
- data/lib/kite/render.rb +0 -116
- data/tpl/aws/README.md +0 -52
- data/tpl/aws/bin/base/bootstrap.sh +0 -35
- data/tpl/aws/bin/base/cleanup.sh.tt +0 -19
- data/tpl/aws/bin/base/set-env.sh.tt +0 -7
- data/tpl/aws/bin/base/setup-tunnel.sh.tt +0 -4
- data/tpl/aws/bin/bosh-install.sh.tt +0 -23
- data/tpl/aws/bin/concourse-deploy.sh.tt +0 -14
- data/tpl/aws/bin/ingress-deploy.sh.tt +0 -7
- data/tpl/aws/bin/ingress-update.sh.tt +0 -7
- data/tpl/aws/bin/kops-delete.sh.erb +0 -5
- data/tpl/aws/bin/kops-deploy.sh.erb +0 -11
- data/tpl/aws/bin/oauth-deploy.sh.tt +0 -17
- data/tpl/aws/bin/prometheus-deploy.sh.tt +0 -23
- data/tpl/aws/bin/vault-deploy.sh.tt +0 -10
- data/tpl/aws/bosh-vars.yml.erb +0 -12
- data/tpl/aws/config/oauth.yml +0 -59
- data/tpl/aws/deployments/bosh/bosh.yml +0 -144
- data/tpl/aws/deployments/bosh/cloud-config.yml.tt +0 -86
- data/tpl/aws/deployments/bosh/cpi.yml +0 -98
- data/tpl/aws/deployments/bosh/jumpbox-user.yml +0 -27
- data/tpl/aws/deployments/concourse/concourse.yml.tt +0 -98
- data/tpl/aws/deployments/ingress/ingress.yml.erb +0 -78
- data/tpl/aws/deployments/oauth/oauth.yml.tt +0 -95
- data/tpl/aws/deployments/prometheus/monitor-bosh.yml +0 -518
- data/tpl/aws/deployments/prometheus/monitor-kubernetes.yml +0 -30
- data/tpl/aws/deployments/prometheus/prometheus.yml.tt +0 -184
- data/tpl/aws/deployments/vault/vault.yml.erb +0 -38
- data/tpl/aws/docs/bosh.md +0 -31
- data/tpl/aws/docs/concourse.md +0 -41
- data/tpl/aws/docs/ingress.md +0 -14
- data/tpl/aws/docs/kops.md +0 -35
- data/tpl/aws/docs/oauth.md +0 -24
- data/tpl/aws/docs/prometheus.md +0 -31
- data/tpl/aws/docs/vault.md +0 -35
- data/tpl/aws/terraform/kite_bucket.tf +0 -8
- data/tpl/aws/terraform/main.tf.tt +0 -36
- data/tpl/aws/terraform/network.tf.tt +0 -252
- data/tpl/aws/terraform/outputs.tf +0 -19
- data/tpl/aws/terraform/terraform.tfvars.tt +0 -21
- data/tpl/aws/terraform/variables.tf +0 -73
- data/tpl/gcp/README.md +0 -54
- data/tpl/gcp/bin/base/bootstrap.sh +0 -35
- data/tpl/gcp/bin/base/cleanup.sh.tt +0 -20
- data/tpl/gcp/bin/base/set-env.sh.tt +0 -10
- data/tpl/gcp/bin/base/setup-tunnel.sh.tt +0 -13
- data/tpl/gcp/bin/bosh-install.sh.tt +0 -22
- data/tpl/gcp/bin/concourse-deploy.sh.tt +0 -14
- data/tpl/gcp/bin/ingress-deploy.sh.tt +0 -7
- data/tpl/gcp/bin/ingress-update.sh.tt +0 -7
- data/tpl/gcp/bin/oauth-deploy.sh.tt +0 -19
- data/tpl/gcp/bin/prometheus-deploy.sh.tt +0 -23
- data/tpl/gcp/bin/vault-deploy.sh.tt +0 -10
- data/tpl/gcp/bosh-vars.yml.erb +0 -9
- data/tpl/gcp/config/oauth.yml +0 -59
- data/tpl/gcp/deployments/bosh/bosh.yml +0 -144
- data/tpl/gcp/deployments/bosh/cloud-config.yml.tt +0 -73
- data/tpl/gcp/deployments/bosh/cpi.yml +0 -69
- data/tpl/gcp/deployments/bosh/jumpbox-user.yml +0 -27
- data/tpl/gcp/deployments/concourse/concourse.yml.tt +0 -104
- data/tpl/gcp/deployments/concourse/test/test-credentials.yml +0 -3
- data/tpl/gcp/deployments/concourse/test/test-pipeline.yml +0 -24
- data/tpl/gcp/deployments/ingress/ingress.yml.erb +0 -111
- data/tpl/gcp/deployments/oauth/oauth.yml.tt +0 -95
- data/tpl/gcp/deployments/prometheus/monitor-bosh.yml +0 -518
- data/tpl/gcp/deployments/prometheus/monitor-kubernetes.yml +0 -30
- data/tpl/gcp/deployments/prometheus/prometheus.yml +0 -183
- data/tpl/gcp/deployments/vault/vault.yml.erb +0 -37
- data/tpl/gcp/docs/bosh.md +0 -36
- data/tpl/gcp/docs/concourse.md +0 -41
- data/tpl/gcp/docs/ingress.md +0 -12
- data/tpl/gcp/docs/oauth.md +0 -24
- data/tpl/gcp/docs/prometheus.md +0 -27
- data/tpl/gcp/docs/vault.md +0 -36
- data/tpl/gcp/terraform/gcs.tf.tt +0 -18
- data/tpl/gcp/terraform/main.tf +0 -70
- data/tpl/gcp/terraform/network.tf +0 -52
- data/tpl/gcp/terraform/outputs.tf +0 -7
- data/tpl/gcp/terraform/terraform.tfvars.tt +0 -15
- data/tpl/gcp/terraform/variables.tf +0 -37
- data/tpl/service/%output_path%/pipelines/tasks/helm-deploy.yml.tt +0 -22
- data/tpl/service/%output_path%/pipelines/tasks/run-master-tests.yml.tt +0 -12
- data/tpl/service/%output_path%/pipelines/tasks/run-pr-tests.yml.tt +0 -12
- data/tpl/skel/docs/index.md.tt +0 -0
- data/tpl/skel/docs/quickstart.md.tt +0 -0
data/tpl/skel/config/cloud.yml
CHANGED
@@ -1,66 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
vpc_name: "platform-tools"
|
13
|
-
vpc_cidr_block: "10.0.0.0/16"
|
14
|
-
vpc_id: "" # submit vpc id if you want to use an existing vpc
|
15
|
-
public_subnet:
|
16
|
-
name: "platform-dmz"
|
17
|
-
gateway: "10.0.10.1"
|
18
|
-
network: "10.0.10.0/26"
|
19
|
-
id: "" # submit id if you want to use an existing public subnet
|
20
|
-
private_subnet:
|
21
|
-
name: "platform-net"
|
22
|
-
gateway: "10.0.20.1"
|
23
|
-
network: "10.0.20.0/26"
|
24
|
-
|
25
|
-
gcp:
|
26
|
-
project: "gcp-project"
|
27
|
-
region: "europe-west1"
|
28
|
-
zone: "europe-west1-c"
|
29
|
-
service_account: "~/safe/terraform.json"
|
30
|
-
vpc_name: "platform-tools"
|
31
|
-
subnet_name: "platform-net"
|
32
|
-
subnet_cidr: "10.0.20.0/24"
|
33
|
-
internal_gw: "10.0.20.2"
|
34
|
-
|
35
|
-
bosh:
|
36
|
-
name: "bosh-director"
|
37
|
-
static_ip: "10.0.20.10"
|
38
|
-
|
39
|
-
k8s:
|
40
|
-
config_path: "~/.kube/config"
|
41
|
-
cluster_address: "k8s.example.com"
|
42
|
-
api_server_address: "https://api.k8s.example.com"
|
43
|
-
|
44
|
-
ingress:
|
45
|
-
vip: "42.42.42.42"
|
46
|
-
|
47
|
-
vault:
|
48
|
-
hostname: "vault.example.com"
|
49
|
-
|
50
|
-
prometheus:
|
51
|
-
hostname: "prometheus.example.com"
|
52
|
-
|
53
|
-
grafana:
|
54
|
-
hostname: "grafana.example.com"
|
55
|
-
|
56
|
-
alertmanager:
|
57
|
-
hostname: "alertmanager.example.com"
|
58
|
-
|
59
|
-
concourse:
|
60
|
-
hostname: "concourse.example.com"
|
61
|
-
url: "https://concourse.example.com"
|
62
|
-
auth_username: "concourse"
|
63
|
-
|
64
|
-
oauth:
|
65
|
-
hostname: "oauth.example.com"
|
66
|
-
url: "https://oauth.example.com"
|
1
|
+
default: &default
|
2
|
+
region: "us-east1" # Note that region formats differ between AWS and GCP
|
3
|
+
zone: "us-east1-a"
|
4
|
+
gcp:
|
5
|
+
project: "hc-public"
|
6
|
+
service_account: "~/safe/hc-public/terraform.json"
|
7
|
+
bucket_name: "kite-state-helios-devel"
|
8
|
+
aws:
|
9
|
+
access_key: "********************"
|
10
|
+
secret_key: "****************************************"
|
11
|
+
bucket_name: "kite-state-helios-devel"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Louis Bellet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: git
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: simplecov
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,6 +122,7 @@ files:
|
|
108
122
|
- CHANGELOG.md
|
109
123
|
- Dockerfile
|
110
124
|
- Gemfile
|
125
|
+
- LICENSE.md
|
111
126
|
- Makefile
|
112
127
|
- README.md
|
113
128
|
- Rakefile
|
@@ -122,6 +137,7 @@ files:
|
|
122
137
|
- config/pipelines/tasks/create-repository-tag.yml
|
123
138
|
- config/pipelines/tasks/run-master-tests.yml
|
124
139
|
- config/pipelines/tasks/run-pr-tests.yml
|
140
|
+
- docs/kite-concourse-resource.md
|
125
141
|
- kite.gemspec
|
126
142
|
- lib/kite.rb
|
127
143
|
- lib/kite/base.rb
|
@@ -131,87 +147,14 @@ files:
|
|
131
147
|
- lib/kite/generate.rb
|
132
148
|
- lib/kite/helpers.rb
|
133
149
|
- lib/kite/helpers/concourse.rb
|
134
|
-
- lib/kite/
|
150
|
+
- lib/kite/module.rb
|
151
|
+
- lib/kite/terraform.rb
|
135
152
|
- lib/kite/version.rb
|
136
|
-
- tpl/aws/
|
137
|
-
- tpl/aws/
|
138
|
-
- tpl/
|
139
|
-
- tpl/
|
140
|
-
- tpl/
|
141
|
-
- tpl/aws/bin/bosh-install.sh.tt
|
142
|
-
- tpl/aws/bin/concourse-deploy.sh.tt
|
143
|
-
- tpl/aws/bin/ingress-deploy.sh.tt
|
144
|
-
- tpl/aws/bin/ingress-update.sh.tt
|
145
|
-
- tpl/aws/bin/kops-delete.sh.erb
|
146
|
-
- tpl/aws/bin/kops-deploy.sh.erb
|
147
|
-
- tpl/aws/bin/oauth-deploy.sh.tt
|
148
|
-
- tpl/aws/bin/prometheus-deploy.sh.tt
|
149
|
-
- tpl/aws/bin/vault-deploy.sh.tt
|
150
|
-
- tpl/aws/bosh-vars.yml.erb
|
151
|
-
- tpl/aws/config/oauth.yml
|
152
|
-
- tpl/aws/deployments/bosh/bosh.yml
|
153
|
-
- tpl/aws/deployments/bosh/cloud-config.yml.tt
|
154
|
-
- tpl/aws/deployments/bosh/cpi.yml
|
155
|
-
- tpl/aws/deployments/bosh/jumpbox-user.yml
|
156
|
-
- tpl/aws/deployments/concourse/concourse.yml.tt
|
157
|
-
- tpl/aws/deployments/ingress/ingress.yml.erb
|
158
|
-
- tpl/aws/deployments/oauth/oauth.yml.tt
|
159
|
-
- tpl/aws/deployments/prometheus/monitor-bosh.yml
|
160
|
-
- tpl/aws/deployments/prometheus/monitor-kubernetes.yml
|
161
|
-
- tpl/aws/deployments/prometheus/prometheus.yml.tt
|
162
|
-
- tpl/aws/deployments/vault/vault.yml.erb
|
163
|
-
- tpl/aws/docs/bosh.md
|
164
|
-
- tpl/aws/docs/concourse.md
|
165
|
-
- tpl/aws/docs/ingress.md
|
166
|
-
- tpl/aws/docs/kops.md
|
167
|
-
- tpl/aws/docs/oauth.md
|
168
|
-
- tpl/aws/docs/prometheus.md
|
169
|
-
- tpl/aws/docs/vault.md
|
170
|
-
- tpl/aws/terraform/kite_bucket.tf
|
171
|
-
- tpl/aws/terraform/main.tf.tt
|
172
|
-
- tpl/aws/terraform/network.tf.tt
|
173
|
-
- tpl/aws/terraform/outputs.tf
|
174
|
-
- tpl/aws/terraform/terraform.tfvars.tt
|
175
|
-
- tpl/aws/terraform/variables.tf
|
176
|
-
- tpl/gcp/README.md
|
177
|
-
- tpl/gcp/bin/base/bootstrap.sh
|
178
|
-
- tpl/gcp/bin/base/cleanup.sh.tt
|
179
|
-
- tpl/gcp/bin/base/set-env.sh.tt
|
180
|
-
- tpl/gcp/bin/base/setup-tunnel.sh.tt
|
181
|
-
- tpl/gcp/bin/bosh-install.sh.tt
|
182
|
-
- tpl/gcp/bin/concourse-deploy.sh.tt
|
183
|
-
- tpl/gcp/bin/ingress-deploy.sh.tt
|
184
|
-
- tpl/gcp/bin/ingress-update.sh.tt
|
185
|
-
- tpl/gcp/bin/oauth-deploy.sh.tt
|
186
|
-
- tpl/gcp/bin/prometheus-deploy.sh.tt
|
187
|
-
- tpl/gcp/bin/vault-deploy.sh.tt
|
188
|
-
- tpl/gcp/bosh-vars.yml.erb
|
189
|
-
- tpl/gcp/config/oauth.yml
|
190
|
-
- tpl/gcp/deployments/bosh/bosh.yml
|
191
|
-
- tpl/gcp/deployments/bosh/cloud-config.yml.tt
|
192
|
-
- tpl/gcp/deployments/bosh/cpi.yml
|
193
|
-
- tpl/gcp/deployments/bosh/jumpbox-user.yml
|
194
|
-
- tpl/gcp/deployments/concourse/concourse.yml.tt
|
195
|
-
- tpl/gcp/deployments/concourse/test/test-credentials.yml
|
196
|
-
- tpl/gcp/deployments/concourse/test/test-pipeline.yml
|
197
|
-
- tpl/gcp/deployments/ingress/ingress.yml.erb
|
198
|
-
- tpl/gcp/deployments/oauth/oauth.yml.tt
|
199
|
-
- tpl/gcp/deployments/prometheus/monitor-bosh.yml
|
200
|
-
- tpl/gcp/deployments/prometheus/monitor-kubernetes.yml
|
201
|
-
- tpl/gcp/deployments/prometheus/prometheus.yml
|
202
|
-
- tpl/gcp/deployments/vault/vault.yml.erb
|
203
|
-
- tpl/gcp/docs/bosh.md
|
204
|
-
- tpl/gcp/docs/concourse.md
|
205
|
-
- tpl/gcp/docs/ingress.md
|
206
|
-
- tpl/gcp/docs/oauth.md
|
207
|
-
- tpl/gcp/docs/prometheus.md
|
208
|
-
- tpl/gcp/docs/vault.md
|
209
|
-
- tpl/gcp/terraform/gcs.tf.tt
|
210
|
-
- tpl/gcp/terraform/main.tf
|
211
|
-
- tpl/gcp/terraform/network.tf
|
212
|
-
- tpl/gcp/terraform/outputs.tf
|
213
|
-
- tpl/gcp/terraform/terraform.tfvars.tt
|
214
|
-
- tpl/gcp/terraform/variables.tf
|
153
|
+
- tpl/aws/environment/main.tf.tt
|
154
|
+
- tpl/aws/environment/s3.tf.tt
|
155
|
+
- tpl/gcp/environment/gcs.tf.tt
|
156
|
+
- tpl/gcp/environment/main.tf.tt
|
157
|
+
- tpl/gcp/environment/outputs.tf.tt
|
215
158
|
- tpl/service/%output_path%/charts/%app_name%/Chart.yaml.tt
|
216
159
|
- tpl/service/%output_path%/charts/%app_name%/templates/NOTES.txt.tt
|
217
160
|
- tpl/service/%output_path%/charts/%app_name%/templates/_helpers.tpl
|
@@ -223,19 +166,17 @@ files:
|
|
223
166
|
- tpl/service/%output_path%/pipelines/review.yml.tt
|
224
167
|
- tpl/service/%output_path%/pipelines/tasks/create-pull-requests-tag.yml.tt
|
225
168
|
- tpl/service/%output_path%/pipelines/tasks/create-repository-tag.yml.tt
|
226
|
-
- tpl/service/%output_path%/pipelines/tasks/
|
227
|
-
- tpl/service/%output_path%/pipelines/tasks/run-master-tests.yml.tt
|
228
|
-
- tpl/service/%output_path%/pipelines/tasks/run-pr-tests.yml.tt
|
169
|
+
- tpl/service/%output_path%/pipelines/tasks/run-unit.yml.tt
|
229
170
|
- tpl/service/Dockerfile.tt
|
230
171
|
- tpl/service/Makefile.tt
|
231
172
|
- tpl/service/VERSION.tt
|
173
|
+
- tpl/service/docs/getting-started.md
|
232
174
|
- tpl/service/docs/pipeline.md.tt
|
175
|
+
- tpl/service/docs/service.md
|
233
176
|
- tpl/skel/Gemfile.tt
|
234
177
|
- tpl/skel/README.md.tt
|
235
178
|
- tpl/skel/bin/kite
|
236
179
|
- tpl/skel/config/cloud.yml
|
237
|
-
- tpl/skel/docs/index.md.tt
|
238
|
-
- tpl/skel/docs/quickstart.md.tt
|
239
180
|
- tpl/skel/lib/tasks/.keep
|
240
181
|
- tpl/skel/log/.keep
|
241
182
|
- tpl/skel/tmp/.keep
|
@@ -258,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
258
199
|
version: '0'
|
259
200
|
requirements: []
|
260
201
|
rubyforge_project:
|
261
|
-
rubygems_version: 2.
|
202
|
+
rubygems_version: 2.7.3
|
262
203
|
signing_key:
|
263
204
|
specification_version: 4
|
264
205
|
summary: Command line tool for devops scaffolding.
|
data/lib/kite/render.rb
DELETED
@@ -1,116 +0,0 @@
|
|
1
|
-
module Kite
|
2
|
-
# Subcommand for rendering manifests, deployments etc.
|
3
|
-
class Render < Base
|
4
|
-
|
5
|
-
include Kite::Helpers
|
6
|
-
|
7
|
-
no_commands do
|
8
|
-
def ingress_db_file
|
9
|
-
"config/ingress.yml"
|
10
|
-
end
|
11
|
-
|
12
|
-
def ingress_db
|
13
|
-
@db ||= YAML.load(File.read(ingress_db_file)) rescue {}
|
14
|
-
end
|
15
|
-
|
16
|
-
def ingress_db_save!
|
17
|
-
create_file ingress_db_file, YAML.dump(ingress_db), force: true
|
18
|
-
end
|
19
|
-
|
20
|
-
def ingress_add_entry(hostname, upstreams, args = {})
|
21
|
-
raise "upstreams argument should be an array" unless upstreams.is_a?(Array)
|
22
|
-
args[:port] ||= 80
|
23
|
-
args[:protocol] ||= "http"
|
24
|
-
ingress_db[hostname] = {
|
25
|
-
upstreams: upstreams,
|
26
|
-
port: args[:port],
|
27
|
-
protocol: args[:protocol],
|
28
|
-
}
|
29
|
-
ingress_db_save!
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
desc "manifest <type>", "Renders a manifest of selected type"
|
34
|
-
long_desc <<-LONGDESC
|
35
|
-
Available types:
|
36
|
-
\x5 BOSH Render Bosh environement
|
37
|
-
\x5 CONCOURSE Render Concourse deployment
|
38
|
-
\x5 VAULT Render Vault deployment
|
39
|
-
\x5 INGRESS Render Ingress deployment
|
40
|
-
\x5 PROMETHEUS Render Prometheus deployment
|
41
|
-
\x5 OAUTH Render OAuth (UAA) deployment
|
42
|
-
LONGDESC
|
43
|
-
method_option :cloud, type: :string, desc: "Cloud provider", enum: %w{aws gcp}, required: true
|
44
|
-
# Render a manifest of selected type based on <b>config/cloud.yml</b> and <b>terraform apply</b> results
|
45
|
-
def manifest(type)
|
46
|
-
type = type.downcase
|
47
|
-
say "Rendering #{type} manifest", :green
|
48
|
-
@values = parse_cloud_config
|
49
|
-
@tf_output = parse_tf_state('terraform/terraform.tfstate') if options[:cloud] == 'aws'
|
50
|
-
|
51
|
-
if options[:cloud] == 'aws'
|
52
|
-
@private_subnet = IPAddr.new(@values['aws']['private_subnet']['network']).to_range.to_a
|
53
|
-
@public_subnet = IPAddr.new(@values['aws']['public_subnet']['network']).to_range.to_a
|
54
|
-
else
|
55
|
-
@private_subnet = IPAddr.new(@values['gcp']['subnet_cidr']).to_range.to_a
|
56
|
-
end
|
57
|
-
|
58
|
-
@static_ip_vault = @private_subnet[11].to_s
|
59
|
-
@static_ips_concourse = [@private_subnet[12]].map(&:to_s)
|
60
|
-
@static_ip_prometheus_stack = @private_subnet[18].to_s
|
61
|
-
@static_ip_oauth = @private_subnet[23].to_s
|
62
|
-
|
63
|
-
case type
|
64
|
-
when "bosh"
|
65
|
-
directory("#{options[:cloud]}/deployments/bosh", 'deployments/bosh')
|
66
|
-
template("#{options[:cloud]}/bosh-vars.yml.erb", 'config/bosh-vars.yml')
|
67
|
-
copy_file("#{options[:cloud]}/docs/bosh.md", "docs/bosh.md")
|
68
|
-
template("#{options[:cloud]}/bin/bosh-install.sh.tt", "bin/bosh-install.sh")
|
69
|
-
chmod('bin/bosh-install.sh', 0755)
|
70
|
-
|
71
|
-
when "concourse"
|
72
|
-
directory("#{options[:cloud]}/deployments/concourse", "deployments/concourse")
|
73
|
-
copy_file("#{options[:cloud]}/docs/concourse.md", "docs/concourse.md")
|
74
|
-
template("#{options[:cloud]}/bin/concourse-deploy.sh.tt", "bin/concourse-deploy.sh")
|
75
|
-
chmod('bin/concourse-deploy.sh', 0755)
|
76
|
-
ingress_add_entry(@values['concourse']['hostname'], @static_ips_concourse, port: 8080)
|
77
|
-
|
78
|
-
when "vault"
|
79
|
-
template("#{options[:cloud]}/deployments/vault/vault.yml.erb", "deployments/vault/vault.yml")
|
80
|
-
copy_file("#{options[:cloud]}/docs/vault.md", "docs/vault.md")
|
81
|
-
template("#{options[:cloud]}/bin/vault-deploy.sh.tt", "bin/vault-deploy.sh")
|
82
|
-
chmod('bin/vault-deploy.sh', 0755)
|
83
|
-
ingress_add_entry(@values['vault']['hostname'], [@static_ip_vault], port: 8200)
|
84
|
-
|
85
|
-
when "ingress"
|
86
|
-
template("#{options[:cloud]}/deployments/ingress/ingress.yml.erb", "deployments/ingress/ingress.yml")
|
87
|
-
copy_file("#{options[:cloud]}/docs/ingress.md", "docs/ingress.md")
|
88
|
-
template("#{options[:cloud]}/bin/ingress-deploy.sh.tt", "bin/ingress-deploy.sh")
|
89
|
-
template("#{options[:cloud]}/bin/ingress-update.sh.tt", "bin/ingress-update.sh")
|
90
|
-
chmod('bin/ingress-deploy.sh', 0755)
|
91
|
-
chmod('bin/ingress-update.sh', 0755)
|
92
|
-
|
93
|
-
when "prometheus"
|
94
|
-
directory("#{options[:cloud]}/deployments/prometheus", "deployments/prometheus")
|
95
|
-
copy_file("#{options[:cloud]}/docs/prometheus.md", "docs/prometheus.md")
|
96
|
-
template("#{options[:cloud]}/bin/prometheus-deploy.sh.tt", "bin/prometheus-deploy.sh")
|
97
|
-
chmod('bin/prometheus-deploy.sh', 0755)
|
98
|
-
ingress_add_entry(@values['alertmanager']['hostname'], [@static_ip_prometheus_stack], port: 9093)
|
99
|
-
ingress_add_entry(@values['grafana']['hostname'], [@static_ip_prometheus_stack], port: 3000)
|
100
|
-
ingress_add_entry(@values['prometheus']['hostname'], [@static_ip_prometheus_stack], port: 9090)
|
101
|
-
|
102
|
-
when "oauth"
|
103
|
-
directory("#{options[:cloud]}/deployments/oauth", "deployments/oauth")
|
104
|
-
copy_file("#{options[:cloud]}/config/oauth.yml", "config/oauth.yml")
|
105
|
-
template("#{options[:cloud]}/docs/oauth.md", "docs/oauth.md")
|
106
|
-
template("#{options[:cloud]}/bin/oauth-deploy.sh.tt", "bin/oauth-deploy.sh")
|
107
|
-
chmod('bin/oauth-deploy.sh', 0755)
|
108
|
-
ingress_add_entry(@values['oauth']['hostname'], [@static_ip_oauth], port: 8080)
|
109
|
-
|
110
|
-
else
|
111
|
-
say "Manifest type not specified"
|
112
|
-
|
113
|
-
end
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
data/tpl/aws/README.md
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
## AWS Cloud
|
2
|
-
|
3
|
-
### Setup
|
4
|
-
|
5
|
-
Apply terraform code
|
6
|
-
```
|
7
|
-
pushd terraform && terraform init && terraform apply && popd
|
8
|
-
```
|
9
|
-
|
10
|
-
[Note]
|
11
|
-
To destroy Bastion later, use `terraform destroy -target aws_instance.bastion`
|
12
|
-
|
13
|
-
Render BOSH manifest and related files
|
14
|
-
```
|
15
|
-
kite render manifest bosh --cloud aws
|
16
|
-
```
|
17
|
-
|
18
|
-
Prepare BOSH environment using instructions from [docs/bosh.md](docs/bosh.md)
|
19
|
-
|
20
|
-
[Optional]
|
21
|
-
If you want to access components outside of your VPC, use the Ingress deployment:
|
22
|
-
|
23
|
-
Render Ingress deployment files
|
24
|
-
```
|
25
|
-
kite render manifest prometheus --cloud aws
|
26
|
-
```
|
27
|
-
|
28
|
-
Follow instructions from [docs/prometheus.md](docs/prometheus.md) to deploy Prometheus
|
29
|
-
|
30
|
-
[Note]
|
31
|
-
If you're using Ingress, create CNAME DNS records for each deployment as listed in `config/cloud.yml`(e.g. vault.example.com pointing to ingress.example.com)
|
32
|
-
|
33
|
-
Render Prometheus deployment files
|
34
|
-
```
|
35
|
-
kite render manifest prometheus --cloud aws
|
36
|
-
```
|
37
|
-
|
38
|
-
Follow instructions from [docs/prometheus.md](docs/prometheus.md) to deploy Prometheus
|
39
|
-
|
40
|
-
Render Vault deployment
|
41
|
-
```
|
42
|
-
kite render manifest vault --cloud aws
|
43
|
-
```
|
44
|
-
|
45
|
-
Follow instructions from [docs/vault.md](docs/vault.md) to deploy Vault
|
46
|
-
|
47
|
-
Render Concourse manifest
|
48
|
-
```
|
49
|
-
kite render manifest concourse --cloud aws
|
50
|
-
```
|
51
|
-
|
52
|
-
Follow instructions from [docs/concourse.md](docs/concourse.md) to deploy Concourse
|
@@ -1,35 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
set -xe
|
4
|
-
|
5
|
-
# Apply Terraform IaC
|
6
|
-
pushd terraform
|
7
|
-
|
8
|
-
terraform init
|
9
|
-
terraform apply
|
10
|
-
|
11
|
-
popd
|
12
|
-
|
13
|
-
# Set up an SSH tunnel to Bastion
|
14
|
-
. bin/setup-tunnel.sh
|
15
|
-
|
16
|
-
# Render BOSH manifest and related files
|
17
|
-
kite render manifest bosh --cloud aws
|
18
|
-
|
19
|
-
# Deploy BOSH Director
|
20
|
-
./bin/bosh-install.sh
|
21
|
-
|
22
|
-
# Set the needed environment variables
|
23
|
-
. bin/set-env.sh
|
24
|
-
|
25
|
-
# Render Vault manifest
|
26
|
-
kite render manifest vault --cloud aws
|
27
|
-
|
28
|
-
# Deploy Vault
|
29
|
-
./bin/vault-deploy.sh
|
30
|
-
|
31
|
-
# Render Concourse manifest and related files
|
32
|
-
kite render manifest concourse --cloud aws
|
33
|
-
|
34
|
-
# Deploy Concourse
|
35
|
-
./bin/concourse-deploy.sh
|