-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTODO
332 lines (228 loc) · 8.28 KB
/
TODO
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
https://github.com/akoutmos/doctor
docker pull dpage/pgadmin4
https://github.com/DockYard/ecto_fixtures
remover https://github.com/phoenixframework/phoenix_live_reload e adicionar {:phoenix_live_reload, "~> 1.2", only: :dev},
phoenix 1.5
test for scroll withtout query params
codacy
travis
shield do coverrals
terraform
readme
redis
configs https://github.com/cristopher-rodrigues/phoenix-graphql-postgresql-api-boilerplate/tree/master/config
readme
step by step to create new things => https://github.com/aichbauer/express-graphql-boilerplate
https://github.com/cristopher-rodrigues/phoenix-graphql-postgresql-api-boilerplate/tree/master/k8s/kops
Authentication via JWT?
FRONT-END
----
kustomize
kops
istio
colocar redis/pg
no terraform
terraform + https://www.runatlantis.io/ + argocd
kustomize
onde to usando o cache?
teste de carga nos subscriptions
simple chat example
https://www.codacy.com/
K8s
kafka/event-driven
----
Elastix.Search.search("http://localhost:9200", "users", ["users"], %{query: %{match_all: %{}}})
Elastix.Search.search("http://localhost:9200", "users", ["users"], %{query: %{match: %{name: %{query: "ksdnsknsk"}}}})
Elastix.Search.search("http://localhost:9200", "users", ["users"], %{query: %{term: %{name: "ksdnsknsk"}}})
Elastix.Search.search("http://localhost:9200", "users", ["users"], %{query: %{match: %{name: "ksdnsknsk"}}})
Elastix.Search.search("http://localhost:9200", "users", ["users"], %{query: %{query_string: %{query: "ksdnsknsk", default_field: "name"}}})
Elastix.Search.search("http://localhost:9200", "users", ["users"], %{query: %{bool: %{should: %{match: %{name: "ksdnsknsk"}}}}})
Elastix.Search.search("http://localhost:9200", "users", ["users"], %{query: %{bool: %{must: %{match: %{name: "ksdnsknsk"}}}}})
\o/ Elastix.Search.search("http://localhost:9200", "postgresql.public.users", ["users"], %{query: %{query_string: %{query: "*ks*", default_field: "name"}}})
q = %{
query: %{
bool: %{
must: [
%{
query_string: %{query: "*J*", default_field: "name"}
}
],
must_not: %{
exists: %{
field: "removed_at"
}
}
}
}
}
Elastix.Search.search("http://localhost:9200", "postgresql.public.users", ["users"], q)
Elastix.Document.index("http://localhost:9200", "users", "users", "42", %{id: 123, name: "dksnd", uuid: Ecto.UUID.generate, inserted_at: DateTime.utc_now, updated_at: DateTime.utc_now})
Boilerplate.Users.Scroll.call(%Boilerplate.Users.Scroll.Params{query: "ks"})
{:excoveralls, "~> 0.10", only: :test},
como fazer a subscription retornar tudo de user e n apenas oq o user passou na mutations?
----
provider "aws" {
profile = "default"
region = "us-east-1"
access_key = "my-access-key"
secret_key = "my-secret-key"
}
resource "aws_instance" "example" {
ami = "ami-2757f631"
instance_type = "t2.micro"
}
resource "aws_eip" "ip" {
vpc = true
instance = aws_instance.example.id
}
# New resource for the S3 bucket our application will use.
resource "aws_s3_bucket" "example" {
# NOTE: S3 bucket names must be unique across _all_ AWS accounts, so
# this name must be changed before applying this example to avoid naming
# conflicts.
bucket = "terraform-getting-started-guide"
acl = "private"
}
# Change the aws_instance we declared earlier to now include "depends_on"
resource "aws_instance" "example" {
ami = "ami-2757f631"
instance_type = "t2.micro"
# Tells Terraform that this EC2 instance must be created only after the
# S3 bucket has been created.
depends_on = [aws_s3_bucket.example]
}
-----
resource "aws_db_subnet_group" "elastic-cache" {
name = "${var.namespace}-${var.name}"
subnet_ids = ["${var.private_subnets_ids}"]
tags = "${var.tags}"
}
// Elasticache subnet group required to create the redis inside the VPC
resource "aws_elasticache_subnet_group" "pipefy-elasticache" {
name = "${var.namespace}-${var.name}"
subnet_ids = ["${var.private_subnets_ids}"]
}
resource "aws_elasticache_replication_group" "redis" {
automatic_failover_enabled = true
availability_zones = ["${var.azs}"]
replication_group_id = "${var.namespace}-${var.name}"
replication_group_description = "${var.namespace} ${var.name} redis"
node_type = "${var.node_type}"
number_cache_clusters = "${length(var.azs)}"
engine = "redis"
engine_version = "${var.redis_engine_version}"
parameter_group_name = "${var.redis_parameter_group_name}"
port = 6379
subnet_group_name = "${aws_elasticache_subnet_group.pipefy-elasticache.name}"
security_group_ids = ["${aws_security_group.elasticache.id}"]
transit_encryption_enabled = "${var.enable_redis_transit_encryption}"
at_rest_encryption_enabled = "${var.enable_redis_encryption}"
auth_token = "${var.auth_token}"
tags = "${var.tags}"
}
// Generate a random string for auth token, no special chars
resource "random_string" "auth_token" {
length = 64
special = false
}
resource "aws_security_group" "elasticache" {
name = "${var.namespace}-${var.name}"
description = "Managed by Terraform"
vpc_id = "${var.vpc_id}"
ingress {
from_port = 6379
to_port = 6379
protocol = "tcp"
cidr_blocks = [
"${var.cidr}",
"10.100.0.0/16"
]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
}
output "auth_token" {
value = "${random_string.auth_token.result}"
}
================================================================
kops export kubecfg $KOPS_CLUSTER_NAME # Remember when you installed kubectl earlier? The configuration for your cluster was automatically generated and written to ~/.kube/config for you!
https://aws.amazon.com/getting-started/hands-on/get-a-domain/
https://kops.sigs.k8s.io/getting_started/aws/#configure-dns
dig ns kops.boilerplate.io
export AWS_ACCESS_KEY_ID=$(aws configure get aws_access_key_id) # tf output
export AWS_SECRET_ACCESS_KEY=$(aws configure get aws_secret_access_key) # tf output
------
https://kops.sigs.k8s.io/boot-sequence/
export KOPS_STATE_STORE=s3://k8s-us-west
export KOPS_CLOUD=aws
export ZONE="us-west-1a"
export MASTER_ZONES="us-west-1a"
export NAME=k8s.example.com
export K8S_VERSION=1.6.4
export NETWORKCIDR="10.240.0.0/16"
export MASTER_SIZE="m3.large"
export WORKER_SIZE="m4.large"
Next you call the kops command to create the cluster in your terminal:
kops create cluster $NAME \
--cloud=$KOPS_CLOUD \
--zones="$ZONE" \
--kubernetes-version=$K8S_VERSION \
--master-zones="$MASTER_ZONES" \
--node-count=3 \
--node-size="$WORKER_SIZE" \
--master-size="$MASTER_SIZE" \
--network-cidr=${NETWORKCIDR} \
--dns-zone=ZVO7KL181S5AP \
--ssh-public-key=$HOME/.ssh/lab_no_password.pub
kops get --name $NAME -o yaml > a_fun_name_you_will_remember.yml
https://kops.sigs.k8s.io/horizontal_pod_autoscaling/
--------------------------------TF--------------------------------
https://www.terraform.io/docs/backends/index.html
https://registry.terraform.io/providers/hashicorp/aws/2.59.0/docs#authentication
https://learn.hashicorp.com/terraform/getting-started/install.html
terraform -install-autocomplete
https://learn.hashicorp.com/terraform/getting-started/build
terraform.tfstate # https://www.terraform.io/docs/state/remote.html || https://learn.hashicorp.com/terraform/getting-started/remote
# Backend Reference
terraform {
required_version = "~> 0.12.0"
backend "remote" {}
}
terraform {
backend "remote" {
organization = "<ORG_NAME>"
workspaces {
name = "Example-Workspace"
}
}
}
----
terraform destroy
----- VARIABLES
variable "amis" {
type = "map"
default = {
"us-east-1" = "ami-b374d5a5"
"us-west-2" = "ami-4b32be2b"
}
}
variable "region" {}
variable "amis" {
type = "map"
}
amis = {
"us-east-1" = "ami-abc123"
"us-west-2" = "ami-def456"
}
var.amis[var.region]
variable "cidrs" { type = list }
cidrs = [ "10.0.0.0/16", "10.1.0.0/16" ]
---
output "ip" {
value = aws_eip.ip.public_ip
}
terraform output ip