-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
replicated.yml
889 lines (863 loc) · 37.4 KB
/
replicated.yml
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
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
# Copyright 2020 YugaByte, Inc. and Contributors
#
# Licensed under the Polyform Free Trial License 1.0.0 (the "License"); you
# may not use this file except in compliance with the License. You
# may obtain a copy of the License at
#
# https://github.com/YugaByte/yugabyte-db/blob/master/licenses/POLYFORM-FREE-TRIAL-LICENSE-1.0.0.txt
---
replicated_api_version: "2.8.0"
name: "yugaware"
properties:
app_url: '{{repl if ConfigOptionEquals "https_enabled" "1"}}https://{{repl ConfigOption "hostname"}}:{{repl ConfigOption "ui_https_port"}}{{repl else}}http://{{repl ConfigOption "hostname"}}:{{repl ConfigOption "ui_http_port"}}{{repl end}}'
logo_url: https://s3-us-west-2.amazonaws.com/assets.yugabyte.com/yb-logo.png
console_title: YugabyteDB Anywhere Deployment Console
backup:
enabled: false
monitors:
cpuacct: []
memory: []
host_requirements:
disk_space: 50GB
docker_space: 10GB
docker_version: 20.10.0
custom_requirements:
- id: check_free_space
message: Ensure there is sufficient space for platform installation
details: Must have at least 40 GB space available.
results:
- status: success
message:
default_message: Directory {{.directory}} has enough space available
args:
directory: '{{repl ConfigOption "storage_path"}}'
condition:
status_code: 0
bool_expr: "{{repl Trim .Result | ParseFloat | lt 40e9 }}"
- status: error
message:
default_message: Directory {{.directory}} has {{.bytes}} space available. Please increase disk space to at least 40 GB
args:
directory: '{{repl ConfigOption "storage_path"}}'
bytes: "{{repl ParseFloat .Result | HumanSize }}"
condition:
status_code: 0
- status: warn
message:
default_message: "Invalid status code {{.status}}. Error: {{.error}}"
args:
status: "{{repl .StatusCode }}"
error: "{{repl .Error }}"
command:
id: disk_space_available
data:
cluster: false
dir: '{{repl ConfigOption "storage_path"}}'
- id: check_replicated_free_space
message: "/var/lib/replicated has enough total space"
details: Directory must have at least 15GB total space.
results:
- status: success
message:
default_message: Total space requirement met for directory {{.directory}}
args:
directory: /var/lib/replicated
condition:
status_code: 0
bool_expr: "{{repl Trim .Result | ParseFloat | lt 15e9 }}"
- status: error
message:
default_message: Directory {{.directory}} has {{.bytes}} space available. Please increase disk space to at least 15 GB
args:
directory: /var/lib/replicated
bytes: "{{repl ParseFloat .Result | HumanSize }}"
condition:
status_code: 0
- status: warn
message:
default_message: "Invalid status code {{.status}}. Error: {{.error}}"
args:
status: "{{repl .StatusCode }}"
error: "{{repl .Error }}"
command:
id: disk_space_available
data:
cluster: false
dir: /var/lib/replicated
cmds:
- name: get_docker_gateway_ip
cmd: raw
args:
- 'ip route show default | grep default | cut -d " " -f3'
- name: dbpass_cmd
cmd: random
args:
- "16"
- "[A-Za-z0-9]"
- name: app_secret
cmd: random
args:
- "64"
- "[A-Za-z0-9]"
- name: storage_path_cmd
cmd: echo
args:
- "/opt/yugabyte"
- name: host_ip
cmd: publicip
components:
- name: prometheus_conf
containers:
- source: public
image_name: xmartlabs/htpasswd
name: prometheus_conf
version: latest
volumes:
- host_path: '{{repl ConfigOption "storage_path"}}/prometheus_configs'
container_path: /prometheus_configs
permission: "0777"
publish_events:
- name: Prometheus_config created
trigger: container-stop
subscriptions:
- component: prometheus
container: prom/prometheus
action: start
config_files:
- filename: /prometheus_configs/generate_prom_web_conf.sh
contents: |
#!/bin/sh
set -x -o errexit
rm -f /prometheus_configs/web.yml
touch /prometheus_configs/web.yml
{{repl if ConfigOptionEquals "prometheus_enable_https" "1"}}
echo "tls_server_config:" >> /prometheus_configs/web.yml
echo " cert_file: /prometheus_configs/cert.pem" >> /prometheus_configs/web.yml
echo " key_file: /prometheus_configs/key.pem" >> /prometheus_configs/web.yml
{{repl end}}
{{repl if ConfigOptionEquals "prometheus_enable_auth" "1"}}
echo "basic_auth_users:" >> /prometheus_configs/web.yml
htpasswd_out=$(htpasswd -nbB {{repl ConfigOption "prometheus_username"}} {{repl ConfigOption "prometheus_password"}})
echo " ${htpasswd_out/:/: }" >> /prometheus_configs/web.yml
{{repl end}}
ephemeral: true
entrypoint: ["sh", "/prometheus_configs/generate_prom_web_conf.sh"]
- name: pg_upgrade
containers:
- source: public
image_name: tianon/postgres-upgrade
name: postgres_upgrade
version: 9.6-to-14
volumes:
- host_path: '{{repl ConfigOption "storage_path"}}/postgresql/yugaware'
container_path: /var/lib/postgresql/9.6/data
owner: "999"
- host_path: '{{repl ConfigOption "storage_path"}}/postgresql/14/yugaware'
container_path: /var/lib/postgresql/14/data
owner: "999"
- host_path: '{{repl ConfigOption "storage_path"}}/postgresql'
container_path: /var/lib/postgresql/status
owner: "999"
publish_events:
- name: Postgres_Upgrade started
trigger: container-stop
subscriptions:
- component: db
container: postgres
action: start
config_files:
- filename: /home/entrypoint.sh
contents: |
#!/bin/bash
set -x -o errexit
if [ ! "$(ls -A /var/lib/postgresql/14/data)" ] && [ "$(ls -A /var/lib/postgresql/9.6/data)" ];
then
docker-upgrade pg_upgrade;
echo "host all all all scram-sha-256" >> /var/lib/postgresql/14/data/pg_hba.conf;
fi
ephemeral: true
entrypoint: ["sh", "/home/entrypoint.sh"]
- name: db
containers:
- source: public
image_name: postgres
name: postgres
version: 14.9
env_vars:
- name: POSTGRES_DB
static_val: "yugaware"
- name: POSTGRES_USER
static_val: '{{repl ConfigOption "dbuser"}}'
- name: POSTGRES_PASSWORD
static_val: '{{repl ConfigOption "dbpass"}}'
- name: PGDATA
static_val: "/var/lib/postgresql/data/yugaware"
ports:
- private_port: "5432"
public_port: '{{repl ConfigOption "db_external_port"}}'
interface: docker0
when: '{{repl ConfigOptionEquals "expose_db_port" "0"}}'
- private_port: "5432"
public_port: '{{repl ConfigOption "db_external_port"}}'
when: '{{repl ConfigOptionEquals "expose_db_port" "1"}}'
volumes:
- host_path: '{{repl ConfigOption "storage_path"}}/postgresql/14'
container_path: /var/lib/postgresql/data
owner: "999"
publish_events:
- name: Postgres_14 started
trigger: exec
args: ["sh", "/home/startup.sh"]
subscriptions:
- component: app
container: yugabyte/yugaware
action: start
config_files:
- filename: /home/update_password.sql
contents: |
ALTER USER {{repl ConfigOption "dbuser"}} WITH PASSWORD '{{repl ConfigOption "dbpass"}}';
- filename: /home/reload_pg_hba_conf.sql
contents: |
SELECT pg_reload_conf();
- filename: /home/create_user.sql
contents: |
CREATE USER {{repl ConfigOption "dbuser"}} WITH SUPERUSER CREATEDB CREATEROLE;
- filename: /home/create_user_if_missing.sh
contents: |
#!/bin/bash
set -x -o errexit
# Check for the existence of role before creating.
if ! ( psql -U postgres -t -c '\du' | cut -d \| -f 1 | grep -qw {{repl ConfigOption "dbuser"}} ) then
psql -U postgres -f /home/create_user.sql;
fi
- filename: /home/enable_ldap.sh
contents: |
#!/bin/bash
set -x -o errexit
sleep 5;
cat /home/base_pg_hba.conf > /var/lib/postgresql/data/yugaware/pg_hba.conf;
su - postgres bash -c 'echo host all all all ldap ldapserver=\"{{repl ConfigOption "ldap_server"}}\" ldapprefix=\"{{repl ConfigOption "ldap_dn_prefix"}}\" ldapsuffix=\"{{repl ConfigOption "ldap_base_dn"}}\" ldapport={{repl ConfigOption "ldap_port"}} ldaptls={{repl ConfigOption "secure_ldap"}} >> /var/lib/postgresql/data/yugaware/pg_hba.conf';
psql -U postgres -f /home/reload_pg_hba_conf.sql;
- filename: /home/setup_auth.sh
contents: |
#!/bin/bash
set -x -o errexit
# Disable all the existing auth mechanism for the host
sleep 5;
cat /home/base_pg_hba.conf > /var/lib/postgresql/data/yugaware/pg_hba.conf;
# Enabling sha hash password based auth.
su - postgres bash -c 'echo host all all all scram-sha-256 >> /var/lib/postgresql/data/yugaware/pg_hba.conf';
psql -U postgres -f /home/update_password.sql;
psql -U postgres -f /home/reload_pg_hba_conf.sql;
- filename: /home/base_pg_hba.conf
contents: |
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
- filename: /home/startup.sh
contents: |
#!/bin/bash
set -x -o errexit
{{repl if ConfigOptionNotEquals "dbuser" "postgres"}} sh /home/create_user_if_missing.sh {{repl end}}
{{repl if ConfigOptionEquals "dbldapauth" "0"}} sh /home/setup_auth.sh {{repl else}} sh /home/enable_ldap.sh {{repl end}}
- name: prometheus
containers:
- source: public
name: prometheus
image_name: prom/prometheus
version: v2.47.1
volumes:
- host_path: '{{repl ConfigOption "storage_path"}}/prometheusv2'
container_path: /prometheus
permission: "0777"
- host_path: '{{repl ConfigOption "storage_path"}}/yugaware/swamper_targets'
container_path: /opt/yugabyte/prometheus/targets
- host_path: '{{repl ConfigOption "storage_path"}}/yugaware/swamper_rules'
container_path: /opt/yugabyte/prometheus/rules
- host_path: '{{repl ConfigOption "storage_path"}}/prometheus_configs'
container_path: /prometheus_configs
permission: "0777"
ports:
- private_port: "9090"
public_port: '{{repl ConfigOption "prometheus_external_port"}}'
- private_port: "9090"
public_port: "9190"
interface: docker0
entrypoint: [
"/bin/sh",
"-c",
"rm -rf /prometheus/lock && \
cp /prometheus_configs/default_prometheus.yml /prometheus_configs/prometheus.yml && \
exec /bin/prometheus \
--config.file=/prometheus_configs/prometheus.yml \
--storage.tsdb.path=/prometheus \
--storage.tsdb.retention={{repl ConfigOption \"prometheus_retention\"}} \
--query.max-concurrency={{repl ConfigOption \"prometheus_query_concurrency\"}} \
--query.max-samples={{repl ConfigOption \"prometheus_query_max_samples\"}} \
--query.timeout={{repl ConfigOption \"prometheus_query_timeout\"}} \
--web.enable-admin-api \
--web.enable-lifecycle \
--web.config.file=/prometheus_configs/web.yml",
]
publish_events:
- name: Prometheus started
trigger: container-start
subscriptions:
- component: pg_upgrade
container: tianon/postgres-upgrade
action: start
config_files:
- filename: /prometheus_configs/cert.pem
contents: |
{{repl ConsoleSetting "tls.cert.data"}}
- filename: /prometheus_configs/key.pem
contents: |
{{repl ConsoleSetting "tls.key.data"}}
- filename: /prometheus_configs/default_prometheus.yml
contents: |
global:
scrape_interval: {{repl ConfigOption "prometheus_scrape_interval"}}
evaluation_interval: {{repl ConfigOption "prometheus_scrape_interval"}}
external_labels:
monitor: 'swamper'
rule_files:
- '/opt/yugabyte/prometheus/rules/yugaware.ad.*.yml'
- '/opt/yugabyte/prometheus/rules/yugaware.recording-rules.yml'
scrape_configs:
- job_name: 'prometheus'
scrape_timeout: {{repl ConfigOption "prometheus_scrape_timeout"}}
{{repl if ConfigOptionEquals "prometheus_enable_https" "1"}}
scheme: https
tls_config:
insecure_skip_verify: true
{{repl end}}
{{repl if ConfigOptionEquals "prometheus_enable_auth" "1"}}
basic_auth:
username: '{{repl ConfigOption "prometheus_username" }}'
password: '{{repl ConfigOption "prometheus_password" }}'
{{repl end}}
static_configs:
- targets: [
'{{repl ConfigOption "docker_gateway" }}:9190'
]
- job_name: 'platform'
scrape_timeout: {{repl ConfigOption "prometheus_scrape_timeout"}}
metrics_path: "/api/v1/prometheus_metrics"
{{repl if ConfigOptionEquals "https_enabled" "1"}}
scheme: https
tls_config:
insecure_skip_verify: true
{{repl end}}
static_configs:
- targets: [
'{{repl ConfigOption "docker_gateway" }}:{{repl if ConfigOptionEquals "https_enabled" "1"}}9543{{repl else}}9100{{repl end}}'
]
- job_name: 'node-agent'
scrape_timeout: {{repl ConfigOption "prometheus_scrape_timeout"}}
metrics_path: "/metrics"
file_sd_configs:
- files:
- '/opt/yugabyte/prometheus/targets/node-agent.*.json'
- job_name: "node"
file_sd_configs:
- files:
- '/opt/yugabyte/prometheus/targets/node.*.json'
metric_relabel_configs:
# Below relabels are required for smooth migration from node_exporter
# 0.13.0 to the latest
- source_labels: ["__name__"]
regex: "node_cpu"
target_label: "__name__"
replacement: "node_cpu_seconds_total"
- source_labels: ["__name__"]
regex: "node_filesystem_free"
target_label: "__name__"
replacement: "node_filesystem_free_bytes"
- source_labels: ["__name__"]
regex: "node_filesystem_size"
target_label: "__name__"
replacement: "node_filesystem_size_bytes"
- source_labels: ["__name__"]
regex: "node_disk_reads_completed"
target_label: "__name__"
replacement: "node_disk_reads_completed_total"
- source_labels: ["__name__"]
regex: "node_disk_writes_completed"
target_label: "__name__"
replacement: "node_disk_writes_completed_total"
- source_labels: ["__name__"]
regex: "node_memory_MemTotal"
target_label: "__name__"
replacement: "node_memory_MemTotal_bytes"
- source_labels: ["__name__"]
regex: "node_memory_Slab"
target_label: "__name__"
replacement: "node_memory_Slab_bytes"
- source_labels: ["__name__"]
regex: "node_memory_Cached"
target_label: "__name__"
replacement: "node_memory_Cached_bytes"
- source_labels: ["__name__"]
regex: "node_memory_Buffers"
target_label: "__name__"
replacement: "node_memory_Buffers_bytes"
- source_labels: ["__name__"]
regex: "node_memory_MemFree"
target_label: "__name__"
replacement: "node_memory_MemFree_bytes"
- source_labels: ["__name__"]
regex: "node_network_receive_bytes"
target_label: "__name__"
replacement: "node_network_receive_bytes_total"
- source_labels: ["__name__"]
regex: "node_network_transmit_bytes"
target_label: "__name__"
replacement: "node_network_transmit_bytes_total"
- source_labels: ["__name__"]
regex: "node_network_receive_packets"
target_label: "__name__"
replacement: "node_network_receive_packets_total"
- source_labels: ["__name__"]
regex: "node_network_transmit_packets"
target_label: "__name__"
replacement: "node_network_transmit_packets_total"
- source_labels: ["__name__"]
regex: "node_network_receive_errs"
target_label: "__name__"
replacement: "node_network_receive_errs_total"
- source_labels: ["__name__"]
regex: "node_network_transmit_errs"
target_label: "__name__"
replacement: "node_network_transmit_errs_total"
- source_labels: ["__name__"]
regex: "node_disk_bytes_read"
target_label: "__name__"
replacement: "node_disk_read_bytes_total"
- source_labels: ["__name__"]
regex: "node_disk_bytes_written"
target_label: "__name__"
replacement: "node_disk_written_bytes_total"
- source_labels: ["__name__"]
regex: "node_boot_time"
target_label: "__name__"
replacement: "node_boot_time_seconds"
# Save the name of the metric so we can group_by since we cannot by __name__ directly...
- source_labels: ["__name__"]
regex: "(.*)"
target_label: "saved_name"
replacement: "$1"
- job_name: "yugabyte"
tls_config:
insecure_skip_verify: true
metrics_path: "/prometheus-metrics"
file_sd_configs:
- files:
- '/opt/yugabyte/prometheus/targets/yugabyte.*.json'
metric_relabel_configs:
# Save the name of the metric so we can group_by since we cannot by __name__ directly...
- source_labels: ["__name__"]
regex: "(.*)"
target_label: "saved_name"
replacement: "$1"
# The following basically retrofit the handler_latency_* metrics to label format.
- source_labels: ["__name__"]
regex: "handler_latency_(yb_[^_]*)_([^_]*)_([^_]*)(.*)"
target_label: "server_type"
replacement: "$1"
- source_labels: ["__name__"]
regex: "handler_latency_(yb_[^_]*)_([^_]*)_([^_]*)(.*)"
target_label: "service_type"
replacement: "$2"
- source_labels: ["__name__"]
regex: "handler_latency_(yb_[^_]*)_([^_]*)_([^_]*)(_sum|_count)?"
target_label: "service_method"
replacement: "$3"
- source_labels: ["__name__"]
regex: "handler_latency_(yb_[^_]*)_([^_]*)_([^_]*)(_sum|_count)?"
target_label: "__name__"
replacement: "rpc_latency$4"
- name: app
containers:
- source: yugabyte
name: yugaware
image_name: yugabyte/yugaware
version: "YUGABYTE_RELEASE_VERSION"
volumes:
- host_path: '{{repl ConfigOption "storage_path"}}/yugaware/swamper_targets'
container_path: /opt/yugabyte/prometheus/targets
- host_path: '{{repl ConfigOption "storage_path"}}/yugaware/swamper_rules'
container_path: /opt/yugabyte/prometheus/rules
- host_path: '{{repl ConfigOption "storage_path"}}/yugaware/data'
container_path: /opt/yugabyte/yugaware/data
- host_path: '{{repl ConfigOption "storage_path"}}/releases'
container_path: /opt/yugabyte/releases
- host_path: '{{repl ConfigOption "storage_path"}}/ybc/releases'
container_path: /opt/yugabyte/ybc/releases
- host_path: '{{repl ConfigOption "storage_path"}}/prometheusv2'
container_path: /prometheus
- host_path: '{{repl ConfigOption "storage_path"}}/prometheus_configs'
container_path: /prometheus_configs
env_vars:
- name: http_proxy
value: '{{repl ConfigOption "http_proxy"}}'
when: '{{repl ConfigOptionEquals "enable_proxy" "1"}}'
- name: https_proxy
value: '{{repl ConfigOption "https_proxy"}}'
when: '{{repl ConfigOptionEquals "enable_proxy" "1"}}'
- name: no_proxy
value: '{{repl ConfigOption "no_proxy"}}'
when: '{{repl ConfigOptionEquals "enable_proxy" "1"}}'
ports:
- private_port: "9443"
public_port: '{{repl ConfigOption "ui_https_port"}}'
port_type: tcp
when: '{{repl ConfigOptionEquals "https_enabled" "1"}}'
- private_port: "9443"
public_port: "9543"
port_type: tcp
when: '{{repl ConfigOptionEquals "https_enabled" "1"}}'
interface: docker0
- private_port: "9000"
public_port: '{{repl ConfigOption "ui_http_port"}}'
port_type: tcp
when: '{{repl ConfigOptionEquals "http_enabled" "1"}}'
- private_port: "9000"
public_port: "9100"
port_type: tcp
when: '{{repl ConfigOptionEquals "http_enabled" "1"}}'
interface: docker0
config_files:
- filename: /opt/yugabyte/yugaware/conf/server.pem
contents: |
{{repl ConsoleSetting "tls.key.data"}}{{repl ConsoleSetting "tls.cert.data"}}
- filename: /opt/yugabyte/yugaware/conf/application.docker.conf
contents: |
include classpath("application.common.conf")
play.crypto.secret="{{repl ConfigOption "app_secret"}}"
play.http.forwarded.trustedProxies = ["{{repl ConfigOption "docker_gateway"}}"]
play.i18n.langs = [ "en" ]
pidfile.path = "/dev/null"
log.override.path = "/opt/yugabyte/yugaware/data/logs"
db {
default.host="{{repl ConfigOption "docker_gateway"}}"
default.port="{{repl ConfigOption "db_external_port"}}"
default.username="{{repl ConfigOption "dbuser"}}"
default.password="{{repl ConfigOption "dbpass"}}"
}
play.filters {
# CSRF config
csrf {
cookie {
# If non null, the CSRF token will be placed in a cookie with this name
name = "csrfCookie"
# Whether the cookie should be set to secure
secure = false
# Whether the cookie should have the HTTP only flag set
httpOnly = false
}
# Whether to bypass CSRF check if CORS check is satisfied
bypassCorsTrustedOrigins = false
header {
# The name of the header to accept CSRF tokens from.
name = "Csrf-Token"
}
}
# CORS config
cors {
pathPrefixes = ["/"]
allowedOrigins = [
"{{repl if ConfigOptionEquals "https_enabled" "1"}}https://{{repl ConfigOption "hostname"}}:{{repl ConfigOption "ui_https_port"}}{{repl end}}",
"{{repl if ConfigOptionEquals "http_enabled" "1"}}http://{{repl ConfigOption "hostname"}}:{{repl ConfigOption "ui_http_port"}}{{repl end}}",
"{{repl Trim (ConfigOption "support_origin_url") "/" }}"
]
supportsCredentials=true
allowedHttpMethods = ["GET", "POST", "PUT", "OPTIONS", "DELETE"]
allowedHttpHeaders = ["Accept", "Origin", "Content-Type", "X-Auth-Token", "X-AUTH-YW-API-TOKEN", ${play.filters.csrf.header.name}]
}
}
{{repl if ConfigOptionNotEquals "http_enabled" "1"}}
http.port = disabled
{{repl else}}
http.port = 9000
{{repl end}}
{{repl if ConfigOptionEquals "https_enabled" "1"}}
https.port = 9443
play.server.https.keyStore {
path = /opt/yugabyte/yugaware/conf/server.pem
type = PEM
}
{{repl end}}
yb {
devops.home = /opt/yugabyte/devops
metrics.host = "{{repl ConfigOption "docker_gateway" }}"
metrics.port = 9190
metrics.protocol = "{{repl if ConfigOptionEquals "prometheus_enable_https" "1"}}https{{repl else}}http{{repl end}}"
metrics.scrape_interval = "{{repl ConfigOption "prometheus_scrape_interval" }}"
metrics.external.url = "{{repl if ConfigOptionEquals "prometheus_enable_https" "1"}}https{{repl else}}http{{repl end}}://{{repl HostPrivateIpAddress "prometheus" "prom/prometheus" }}:{{repl ConfigOption "prometheus_external_port"}}"
{{repl if ConfigOptionEquals "prometheus_enable_auth" "1"}}
metrics.auth = true
metrics.auth_username = "{{repl ConfigOption "prometheus_username" }}"
metrics.auth_password = "{{repl ConfigOption "prometheus_password" }}"
{{repl end}}
storage.path = /opt/yugabyte/yugaware/data
docker.network = bridge
seedData = false
swamper.targetPath = /opt/yugabyte/prometheus/targets
swamper.rulesPath = /opt/yugabyte/prometheus/rules
multiTenant = false
docker.release = "/opt/yugabyte/release"
helm.packagePath = "/opt/yugabyte/helm"
health.check_interval_ms = 300000
health.status_interval_ms = 43200000
health.default_email = "YB_ALERTS_EMAIL_REPLACE"
url = "{{repl if ConfigOptionEquals "https_enabled" "1"}}https://{{repl ConfigOption "hostname"}}:{{repl ConfigOption "ui_https_port"}}{{repl else}}http://{{repl ConfigOption "hostname"}}:{{repl ConfigOption "ui_http_port"}}{{repl end}}"
security.ssh2_enabled = false
node_agent {
releases.path = "/opt/yugabyte/node-agent/releases"
}
}
ybc {
releases.path = "/opt/yugabyte/ybc/releases"
docker.release = "/opt/yugabyte/ybc/release"
}
config:
- name: database
title: Database config
description: Configure your postgres database
items:
- name: dbpass
title: Password
type: password
required: true
value_cmd:
name: dbpass_cmd
value_at: 0
- name: dbuser
title: DB User
type: text
default: "postgres"
- name: expose_db_port
title: Expose Postgres Database Port
help_text: When enabled you can access postgres database on host ip
type: bool
default: "0"
- name: db_external_port
title: Postgres Database Port
type: text
value: ""
default: "5432"
when: '{{repl ConfigOptionEquals "expose_db_port" "1" }}'
- name: dbldapauth
title: Enable LDAP Authentication for DB
help_text: When enabled YB Anywhere will use ldap for Postgres Authentication
type: bool
default: "0"
- name: ldap_server
title: LDAP server DNS/IP
type: text
when: '{{repl ConfigOptionEquals "dbldapauth" "1" }}'
- name: ldap_base_dn
title: LDAP Base DN
type: text
when: '{{repl ConfigOptionEquals "dbldapauth" "1" }}'
- name: ldap_dn_prefix
title: LDAP DN Prefix
type: text
when: '{{repl ConfigOptionEquals "dbldapauth" "1" }}'
- name: ldap_port
title: LDAP Port
type: text
when: '{{repl ConfigOptionEquals "dbldapauth" "1" }}'
- name: secure_ldap
title: Enable Secure LDAP(LDAPS)
type: bool
default: "0"
when: '{{repl ConfigOptionEquals "dbldapauth" "1" }}'
- name: app
title: Application config
description: Configure your yugaware application
items:
- name: app_secret
title: Application Secret
type: text
hidden: true
readonly: true
default_cmd:
name: app_secret
value_at: 0
- name: storage_path
title: Storage Path
type: text
value_cmd:
name: storage_path_cmd
value_at: 0
- name: hostname
title: Hostname
type: text
recommended: false
default: '{{repl ConsoleSetting "tls.hostname"}}'
value_cmd:
name: host_ip
value_at: 0
test_proc:
run_on_save: true
display_name: Check hostname is valid
command: regex_match
args:
- '^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$'
- "Enter a valid hostname or IP address without http(s)"
required: true
- name: support_origin_url
title: Support Origin URL
type: text
default: http://localhost
test_proc:
run_on_save: true
display_name: Check Support Origin URL is valid
command: regex_match
args:
- '^http[s]?:\/\/\w+([\.\-\_]\w+)*(:[0-9]+)?(\/.*)?$'
- "Enter a valid URL of the form http://localhost:3000"
help_text: Specify protocol-host to be whitelisted in the CORS filter.
- name: http_enabled
title: Enable HTTP
help_text: When enabled we will listen to HTTPS (At least one of http or https should be enabled)
type: bool
default: '{{repl if ConfigOptionEquals "https_enabled" "1"}}0{{repl else}}1{{repl end}}'
- name: ui_http_port
title: Yugaware UI HTTP Port
help_text: Yugaware UI HTTP Port
type: text
default: "80"
when: '{{repl ConfigOptionEquals "http_enabled" "1"}}'
- name: https_enabled
title: Enable HTTPS
help_text: When enabled we will listen to HTTPS (At least one of HTTPS or HTTP should be enabled)
type: bool
default: "1"
- name: ui_https_port
title: Yugaware UI HTTPS Port
help_text: Yugaware UI HTTPS Port
type: text
default: "443"
when: '{{repl ConfigOptionEquals "https_enabled" "1"}}'
- name: hsts_enabled
title: Enable HSTS
help_text: Enable HTTP Strict Transport Security. (Requires setup of DNS and SSL certificate issued by a trusted Certificate Authority)
type: bool
default: "0"
when: '{{repl ConfigOptionEquals "https_enabled" "1" }}'
- name: upload_size
title: Maximum Request Size
help_text: Maximum size of the file uploads allowed by Yugabyte Platform.
type: text
default: "10G"
- name: enable_proxy
title: Enable Proxy
help_text: When enabled pass the following settings for web proxy
type: bool
default: '{{repl ConsoleSetting "http.proxy.enabled"}}'
- name: http_proxy
title: HTTP Proxy setting
help_text: Specify the setting for http_proxy
type: text
default: '{{repl ConsoleSetting "http.proxy"}}'
when: '{{repl ConfigOptionEquals "enable_proxy" "1" }}'
- name: https_proxy
title: HTTPS Proxy setting
help_text: Specify the setting for https_proxy
type: text
default: '{{repl ConsoleSetting "http.proxy"}}'
when: '{{repl ConfigOptionEquals "enable_proxy" "1" }}'
- name: no_proxy
title: HTTP no proxy setting
help_text: Specify the setting for no_proxy
type: text
default: '{{repl ConfigOption "docker_gateway" }}'
when: '{{repl ConfigOptionEquals "enable_proxy" "1" }}'
- name: tls_version
title: TLS Versions
help_text: TLS version support for Platform HTTPS frontend
type: text
default: "TLSv1 TLSv1.1 TLSv1.2"
test_proc:
display_name: Check TLS version list is valid
command: regex_match
args:
- '^((TLSv(1|1\.[1-3]))(?: ){1}){0,3}(TLSv(1|1\.[1-3])){1}$'
- "The argument provided to TLS Versions isn't valid"
- name: docker_gateway
title: Docker Gateway IP Address
type: text
default_cmd:
name: get_docker_gateway_ip
value_at: 0
- name: metrics
title: Metrics config
description: Configure your yugabyte metrics
items:
- name: prometheus_external_port
title: Metrics port
type: text
default: "9090"
- name: prometheus_retention
title: Amount of time to retain the metrics, default to 15 days
type: text
default: "15d"
- name: prometheus_scrape_interval
title: How frequently we want to scrape data, default to 10 seconds
type: text
default: "10s"
- name: prometheus_scrape_timeout
title: How long until a scrape request times out, default to 10 seconds
type: text
default: "10s"
- name: prometheus_query_concurrency
title: How many queries to execute concurrently, default to 20 queries
type: text
default: "20"
- name: prometheus_query_max_samples
title: How many samples can Prometheus load to process single query, default to 5M samples
type: text
default: "5000000"
- name: prometheus_query_timeout
title: How long until query execution times out, default to 30s
type: text
default: "30s"
- name: prometheus_enable_https
title: Enable HTTPS for Prometheus web UI/APIs
help_text: When enabled Prometheus will listen to HTTPS
type: bool
default: "0"
- name: prometheus_enable_auth
title: Enable basic auth for Prometheus web UI/APIs
help_text: When enabled Prometheus will require username/password to access UI/APIs
type: bool
default: "0"
- name: prometheus_username
title: Auth Username
type: text
default: "prometheus"
when: '{{repl ConfigOptionEquals "prometheus_enable_auth" "1" }}'
- name: prometheus_password
title: Auth Password
type: password
value_cmd:
name: dbpass_cmd
value_at: 0
test_proc:
run_on_save: true
display_name: Check password is at least 8 characters long
command: regex_match
args:
- '^.{8,}$'
- "Password must contain at least 8 characters"
when: '{{repl ConfigOptionEquals "prometheus_enable_auth" "1" }}'
state:
ready:
command: http_status_code
args:
- '{{repl if ConfigOptionEquals "https_enabled" "1"}}https://{{repl ConfigOption "hostname"}}:{{repl ConfigOption "ui_https_port"}}{{repl else}}http://{{repl ConfigOption "hostname"}}:{{repl ConfigOption "ui_http_port"}}{{repl end}}'
- "200"
- "15"
timeout: 900