Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1408c82

Browse files
Merge branch 'joebot_deploy' into 'master'
DLE with AMI Joebot deploy See merge request postgres-ai/database-lab!296
2 parents fabc9c1 + 3cb8894 commit 1408c82

File tree

3 files changed

+270
-1
lines changed

3 files changed

+270
-1
lines changed

‎packer/envoy.yaml‎

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,30 @@ static_resources:
3131
socket_address:
3232
address: 0.0.0.0
3333
port_value: 6001
34-
34+
- name: dle-api-http
35+
type: STRICT_DNS
36+
connect_timeout: 1s
37+
load_assignment:
38+
cluster_name: dle-api-http
39+
endpoints:
40+
- lb_endpoints:
41+
- endpoint:
42+
address:
43+
socket_address:
44+
address: 0.0.0.0
45+
port_value: 2345
46+
- name: joe-api-http
47+
type: STRICT_DNS
48+
connect_timeout: 1s
49+
load_assignment:
50+
cluster_name: joe-api-http
51+
endpoints:
52+
- lb_endpoints:
53+
- endpoint:
54+
address:
55+
socket_address:
56+
address: 0.0.0.0
57+
port_value: 2400
3558
listeners:
3659
- name: dle_clone_9000_listener
3760
address:
@@ -93,3 +116,71 @@ static_resources:
93116
filename: "/etc/envoy/certs/fullchain1.pem"
94117
private_key:
95118
filename: "/etc/envoy/certs/privkey1.pem"
119+
- address:
120+
socket_address:
121+
address: 0.0.0.0
122+
port_value: 443
123+
filter_chains:
124+
- filters:
125+
- name: envoy.filters.network.http_connection_manager
126+
typed_config:
127+
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
128+
codec_type: AUTO
129+
stat_prefix: ingress_http
130+
route_config:
131+
name: local_route
132+
virtual_hosts:
133+
- name: dle
134+
domains:
135+
- "*"
136+
routes:
137+
- match:
138+
prefix: "/"
139+
route:
140+
cluster: dle-api-http
141+
http_filters:
142+
- name: envoy.filters.http.router
143+
transport_socket:
144+
name: envoy.transport_sockets.tls
145+
typed_config:
146+
"@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
147+
common_tls_context:
148+
tls_certificates:
149+
certificate_chain:
150+
filename: "/etc/envoy/certs/fullchain1.pem"
151+
private_key:
152+
filename: "/etc/envoy/certs/privkey1.pem"
153+
- address:
154+
socket_address:
155+
address: 0.0.0.0
156+
port_value: 444
157+
filter_chains:
158+
- filters:
159+
- name: envoy.filters.network.http_connection_manager
160+
typed_config:
161+
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
162+
codec_type: AUTO
163+
stat_prefix: ingress_http
164+
route_config:
165+
name: local_route
166+
virtual_hosts:
167+
- name: dle
168+
domains:
169+
- "*"
170+
routes:
171+
- match:
172+
prefix: "/"
173+
route:
174+
cluster: joe-api-http
175+
http_filters:
176+
- name: envoy.filters.http.router
177+
transport_socket:
178+
name: envoy.transport_sockets.tls
179+
typed_config:
180+
"@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
181+
common_tls_context:
182+
tls_certificates:
183+
certificate_chain:
184+
filename: "/etc/envoy/certs/fullchain1.pem"
185+
private_key:
186+
filename: "/etc/envoy/certs/privkey1.pem"

‎packer/joe.yml‎

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
app:
2+
# HTTP server IP address or host.
3+
# Used only for Web UI and Slack Events API communication types.
4+
# By default uses an empty string to accept connections to all network interfaces.
5+
# Keep it default when running inside a Docker container.
6+
host: ""
7+
8+
# HTTP server port. Used only for Web UI and Slack Events API communication types.
9+
# Default: 2400.
10+
port: 2400
11+
12+
# Minimal duration of long query processing used for notifications.
13+
# When query processing is finished, a notification will be issued if duration
14+
# has exceeded this value. Default: 60s.
15+
minNotifyDuration: 60s
16+
17+
# Debug mode. Default: false.
18+
debug: false
19+
20+
# Integration with Postgres.ai Platform instance. It may be either
21+
# SaaS (https://postgres.ai) of self-managed instance (usually located inside
22+
# private infrastructure).
23+
platform:
24+
# Postgres.ai Platform API base URL. Default: https://postgres.ai/api/general.
25+
url: "https://postgres.ai/api/general"
26+
27+
# Postgres.ai Platform API secret token.
28+
token: "platform_secret_token"
29+
30+
# Enable command history in Postgres.ai Platform for collaboration and
31+
# visualization. Default: true.
32+
historyEnabled: true
33+
34+
# Channel Mapping is used to allow working with more than one database in
35+
# one Database Lab instance. This is useful when your PostgreSQL master node
36+
# has more than one application databases and you want to organize optimization
37+
# processes for all of them. Thanks to Channel Mapping you can use a single Joe
38+
# Bot instance.
39+
channelMapping:
40+
# Active Database Lab instances that are used by this Joe Bot instance.
41+
dblabServers:
42+
# Alias for this Database Lab instance (internal, used only in this config)
43+
prod1:
44+
# URL of Database Lab API server
45+
url: "https://dblab.domain.com"
46+
# Secret token used to communicate with Database Lab API
47+
token: "secret_token"
48+
49+
# Available communication types ("webui", "slack", "slackrtm", etc.)
50+
communicationTypes:
51+
# Communication type: Web UI (part of Postgres.ai Platform).
52+
webui:
53+
# Web UI name. Feel free to choose any name, it is just an alias.
54+
- name: WebUI
55+
credentials:
56+
# Web UI signing secret. This secret verifies each request to ensure
57+
# that it came from one of configured Web UI instances.
58+
signingSecret: secret_signing
59+
60+
channels:
61+
# Web UI channel ID. Feel free to choose any name, it is just an alias.
62+
# This is what users see in browser.
63+
- channelID: ProductionDB
64+
65+
# Postgres.ai Platform project to which user sessions are to be assigned.
66+
project: "demo"
67+
68+
# Database Lab alias from the "dblabServers" section.
69+
dblabServer: prod1
70+
71+
# PostgreSQL connection parameters used to connect to a clone.
72+
# The username/password are not needed; they will be randomly
73+
# generated each time a new clone is created.
74+
dblabParams:
75+
# It is recommended to leave "postgres" here, because this DB
76+
# usually exists in any PostgreSQL setup.
77+
dbname: postgres
78+
# It is NOT recommended to work without SSL. This value will be
79+
# used in a clone's pg_hba.conf.
80+
# See https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS
81+
sslmode: prefer
82+
83+
# Communication type: Slack Events API.
84+
# slack:
85+
# # Workspace name. Feel free to choose any name, it is just an alias.
86+
# - name: Workspace
87+
#
88+
# credentials:
89+
# # Bot User OAuth Access.
90+
# # See https://api.slack.com/authentication/token-types
91+
# accessToken: xoxb-XXXX
92+
#
93+
# # Slack App Signing Secret.
94+
# # See https://api.slack.com/authentication/verifying-requests-from-slack
95+
# signingSecret: signing_secret
96+
#
97+
# channels:
98+
# # Slack channel ID. In Slack app, right-click on the channel name,
99+
# # and choose "Additional options > Copy link". From that link, we
100+
# # need the last part consisting of 9 letters starting with "C".
101+
# - channelID: CXXXXXXXX
102+
#
103+
# # Postgres.ai Platform project to which user sessions are to be assigned.
104+
# project: "demo"
105+
#
106+
# # Database Lab alias from the "dblabServers" section.
107+
# dblabServer: prod1
108+
#
109+
# # PostgreSQL connection parameters used to connect to a clone.
110+
# # The username/password are not needed; they will be randomly
111+
# # generated each time a new clone is created.
112+
# dblabParams:
113+
# # It is recommended to leave "postgres" here, because this DB
114+
# # usually exists in any PostgreSQL setup.
115+
# dbname: postgres
116+
# # It is NOT recommended to work without SSL. This value will be
117+
# # used in a clone's pg_hba.conf.
118+
# # See https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS
119+
# sslmode: prefer
120+
121+
# # Communication type: Slack RTM.
122+
# slackrtm:
123+
# # Workspace name. Feel free to choose any name, it is just an alias.
124+
# - name: Workspace
125+
#
126+
# credentials:
127+
# # Bot User OAuth Access.
128+
# # See https://api.slack.com/authentication/token-types
129+
# accessToken: xoxb-XXXX
130+
#
131+
# channels:
132+
# # Slack channel ID. In Slack app, right-click on the channel name,
133+
# # and choose "Additional options > Copy link". From that link, we
134+
# # need the last part consisting of 9 letters starting with "C".
135+
# - channelID: CXXXXXXXX
136+
#
137+
# # Postgres.ai Platform project to which user sessions are to be assigned.
138+
# project: "demo"
139+
#
140+
# # Database Lab alias from the "dblabServers" section.
141+
# dblabServer: prod1
142+
#
143+
# # PostgreSQL connection parameters used to connect to a clone.
144+
# # The username/password are not needed; they will be randomly
145+
# # generated each time a new clone is created.
146+
# dblabParams:
147+
# # It is recommended to leave "postgres" here, because this DB
148+
# # usually exists in any PostgreSQL setup.
149+
# dbname: postgres
150+
# # It is NOT recommended to work without SSL. This value will be
151+
# # used in a clone's pg_hba.conf.
152+
# # See https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS
153+
# sslmode: prefer
154+
155+
# Enterprise Edition options – only to use with active Postgres.ai Platform EE
156+
# subscription. Changing these options you confirm that you have active
157+
# subscription to Postgres.ai Platform Enterprise Edition.
158+
# See more: https://postgres.ai/docs/platform/postgres-ai-platform-overview
159+
enterprise:
160+
quota:
161+
# Limit request rates. Works in pair with "interval" value. Default: 10.
162+
limit: 10
163+
164+
# Time interval (in seconds) to apply quota limit. Default: 60.
165+
interval: 60
166+
167+
audit:
168+
# Enable command logging. Default: false.
169+
enabled: false
170+
171+
dblab:
172+
# Limit the number of available Database Lab instances. Default: 1.
173+
instanceLimit: 1

‎packer/template.json.pkr.hcl‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ build {
4444
destination = "/home/ubuntu/envoy.yaml"
4545
}
4646

47+
provisioner "file"{
48+
source = "joe.yml"
49+
destination = "/home/ubuntu/joe.yml"
50+
}
51+
4752
provisioner "shell" {
4853
environment_vars = ["dle_version=${var.dle_version}"]
4954
scripts = ["${path.root}/install-prereqs.sh", "${path.root}/install-dblabcli.sh","${path.root}/install-envoy.sh"]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /