Skip to content

Commit b7dd69e

Browse files
committed
Merge branch 'CF_with_Netdata' into 'master'
CF bootstrap now starts Netdata (as a docker container) See merge request postgres-ai/database-lab!607
2 parents a028cdc + 4e69e05 commit b7dd69e

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

cloudformation/dle_cf_template.yaml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ Resources:
203203
IamSSMRole:
204204
Type: "AWS::IAM::Role"
205205
Properties:
206-
RoleName: "EC2RoleForSSM"
207206
Description: "EC2 IAM role for SSM access"
208207
AssumeRolePolicyDocument:
209208
Version: "2012-10-17"
@@ -386,7 +385,29 @@ Resources:
386385
--url=http://localhost:2345 \
387386
--token=${DLEVerificationToken} \
388387
--insecure'
389-
388+
389+
# Start Netdata
390+
391+
touch $dle_config_path/netdata_DLE.conf
392+
echo "DLE_token=${DLEVerificationToken}"> $dle_config_path/netdata_DLE.conf
393+
394+
sudo docker run -d \
395+
--name=netdata \
396+
--network host \
397+
--hostname=$(hostname) \
398+
-p 19999:19999 \
399+
-v netdataconfig:/etc/netdata \
400+
-v $dle_config_path/netdata_DLE.conf:/etc/netdata/charts.d/DLE.conf \
401+
-v netdatalib:/var/lib/netdata \
402+
-v netdatacache:/var/cache/netdata \
403+
-v /proc:/host/proc:ro \
404+
-v /sys:/host/sys:ro \
405+
-v /etc/os-release:/host/etc/os-release:ro \
406+
--restart unless-stopped \
407+
--cap-add SYS_PTRACE \
408+
--security-opt apparmor=unconfined \
409+
postgresai/netdata-for-dle:v1.34.1
410+
390411
while ! echo "UI started" | nc localhost 2346; do sleep 10; done
391412
/opt/aws/bin/cfn-signal -e $? -d "DLE UI is available" -r "DLE Deploy Process Complete" '${WaitHandle}'
392413

@@ -511,6 +532,20 @@ Outputs:
511532
- 'ssh -N -L 2346:${DNSName}:2346 ubuntu@${DNSName} -i YOUR_PRIVATE_KEY'
512533
- DNSName: !GetAtt DLEInstance.PublicDnsName
513534

535+
07NetdataTunnel:
536+
Description: Use SSH port forwarding to be able to access monitoring (Netdata)
537+
Value: !Sub
538+
- 'ssh -N -L 19999:${DNSName}:19999 ubuntu@${DNSName} -i YOUR_PRIVATE_KEY'
539+
- DNSName: !GetAtt DLEInstance.PublicDnsName
540+
08NetdataUrl:
541+
Description: Netdata URL with a domain for newly created DLE instance
542+
Value: !Sub 'https://${CertificateSubdomain}.${CertificateHostedZone}:19999'
543+
Condition: CreateSubDomain
544+
08NetdataUrl:
545+
Description: Netdata URL with a domain for newly created DLE instance
546+
Value: !Sub 'http://localhost:19999'
547+
Condition: NotCreateSubDomain
548+
514549
04CloneTunnel:
515550
Description: Use SSH port forwarding to be able to access a database clone
516551
Value: !Sub

0 commit comments

Comments
 (0)