File tree 2 files changed +24
-20
lines changed
2 files changed +24
-20
lines changed Original file line number Diff line number Diff line change @@ -29,28 +29,13 @@ microk8s status --wait-ready
29
29
#
30
30
#
31
31
MY_EMAIL_ADDRESS=
" [email protected] " # REPLACE - used for Let's Encrypt
32
- APPSEC_TOKEN=cp-67c2... # REPLACE WITH REAL TOKEN from Infinity Portal - Docker simple MANAGED profile token
32
+ # REPLACE WITH REAL TOKEN from Infinity Portal - Docker simple MANAGED profile token
33
+ APPSEC_TOKEN=cp-67c2...
33
34
APPSEC_HOSTNAME=appsec1493.klaud.online # REPLACE
34
35
35
- # prepare DNS
36
- function verifyDns {
37
- sudo resolvectl flush-caches
38
- VMPUBLICIP=$( curl -s ip.iol.cz/ip/)
39
- DNSIP=$( dig +short $APPSEC_HOSTNAME )
40
- echo " Checking that DNS recort for $APPSEC_HOSTNAME points to $VMPUBLICIP "
41
- if [ " $VMPUBLICIP " == " $DNSIP " ]; then
42
- echo " Success: DNS points to this VM."
43
- else
44
- if [ -z " $DNSIP " ]; then
45
- echo " DNS record not defined"
46
- else
47
- echo " DNS record points to ***wrong*** IP: $DNSIP "
48
- fi
49
- echo " Failed: please setup DNS record for $APPSEC_HOSTNAME "
50
- fi
51
- }
52
- # run (and rerun after DNS changes)
53
- verifyDns
36
+ # prepare DNS record for the service
37
+ # check DNS util properly configured
38
+ verify-dns
54
39
55
40
# ready to install
56
41
helm install appsec https://github.com/mkol5222/appsec-chart/releases/download/appsec-0.1.1/appsec-0.1.1.tgz --set cptoken=$APPSEC_TOKEN --set hostname=$APPSEC_HOSTNAME --set letsencrypt.email=$MY_EMAIL_ADDRESS
Original file line number Diff line number Diff line change @@ -31,5 +31,24 @@ write_files:
31
31
alias k='kubectl'
32
32
alias h='helm'
33
33
append : true
34
+ - path : /usr/local/bin/verify-dns
35
+ content : |
36
+ #!/bin/bash
37
+ # Verify DNS resolution
38
+ sudo resolvectl flush-caches
39
+ VMPUBLICIP=$(curl -s ip.iol.cz/ip/)
40
+ DNSIP=$(dig +short $APPSEC_HOSTNAME)
41
+ echo "Checking that DNS recort for $APPSEC_HOSTNAME points to $VMPUBLICIP"
42
+ if [ "$VMPUBLICIP" == "$DNSIP" ]; then
43
+ echo "SUCCESS: DNS points to this VM."
44
+ else
45
+ if [ -z "$DNSIP" ]; then
46
+ echo "DNS record not defined. Create: $APPSEC_HOSTNAME IN A $VMPUBLICIP"
47
+ else
48
+ echo "DNS record points to ***wrong*** IP: $DNSIP, but it should be $VMPUBLICIP"
49
+ fi
50
+ echo "!!! FAILED !!!: please setup DNS record for $APPSEC_HOSTNAME"
51
+ fi
52
+ permissions : ' 0755'
34
53
35
54
final_message : " The system is finally up, after $UPTIME seconds"
You can’t perform that action at this time.
0 commit comments