@@ -305,6 +305,7 @@ do_all_flintlock() {
305
305
local bridge_name=" $4 "
306
306
local insecure=" $5 "
307
307
local config_file=" $6 "
308
+ local port=" $7 "
308
309
309
310
install_flintlockd " $version "
310
311
@@ -314,10 +315,13 @@ do_all_flintlock() {
314
315
if [[ -z " $address " ]]; then
315
316
address=$( lookup_address " $parent_iface " )
316
317
fi
317
- write_flintlockd_config " $address " " $parent_iface " " $bridge_name " " $insecure " " $config_file "
318
+ if [[ -z " $port " ]]; then
319
+ port=" 9090"
320
+ fi
321
+ write_flintlockd_config " $address " " $parent_iface " " $bridge_name " " $insecure " " $config_file " " $port "
318
322
319
323
start_flintlockd_service
320
- say " Flintlockd running at $address :9090 via interface $parent_iface "
324
+ say " Flintlockd running at $address :$port via interface $parent_iface "
321
325
}
322
326
323
327
# Fetch and install the flintlockd binary at the specified version
@@ -346,14 +350,15 @@ write_flintlockd_config() {
346
350
local bridge_name=" $3 "
347
351
local insecure=" $4 "
348
352
local config_file=" $5 "
353
+ local port=" $6 "
349
354
350
355
mkdir -p " $( dirname " $FLINTLOCKD_CONFIG_PATH " ) "
351
356
352
357
say " Writing flintlockd config to $FLINTLOCKD_CONFIG_PATH ."
353
358
354
359
declare -A settings
355
360
settings[" containerd-socket" ]=" $CONTAINERD_STATE_DIR /containerd.sock"
356
- settings[" grpc-endpoint" ]=" $address :9090 "
361
+ settings[" grpc-endpoint" ]=" $address :$port "
357
362
settings[" verbosity" ]=" 9"
358
363
settings[" insecure" ]=" $insecure "
359
364
@@ -413,7 +418,7 @@ lookup_interface() {
413
418
lookup_address () {
414
419
local interface=" $1 "
415
420
416
- ip route show | awk -v i=" $interface " ' $0 ~ i {print $9}' | grep -E ' ^(192\.168|10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.)'
421
+ ip route show | awk -v i=" $interface " ' $0 ~ i {print $9}' | grep -E ' ^(192\.168|10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.)' -m 1
417
422
}
418
423
419
424
# # CONTAINERD
@@ -736,6 +741,7 @@ cmd_all() {
736
741
local skip_apt=false
737
742
local disk=" "
738
743
local fl_address=" "
744
+ local fl_port=" "
739
745
local fl_iface=" "
740
746
local bridge_name=" "
741
747
local insecure=false
@@ -766,6 +772,10 @@ cmd_all() {
766
772
shift
767
773
fl_address=" $1 "
768
774
;;
775
+ " -p" | " --grpc-port" )
776
+ shift
777
+ fl_port=" $1 "
778
+ ;;
769
779
" -i" | " --parent-iface" )
770
780
shift
771
781
fl_iface=" $1 "
@@ -821,7 +831,7 @@ cmd_all() {
821
831
822
832
install_firecracker " $fc_version "
823
833
do_all_containerd " $ctrd_version " " $set_thinpool "
824
- do_all_flintlock " $fl_version " " $fl_address " " $fl_iface " " $bridge_name " " $insecure " " $flintlock_config_file "
834
+ do_all_flintlock " $fl_version " " $fl_address " " $fl_iface " " $bridge_name " " $insecure " " $flintlock_config_file " " $fl_port "
825
835
826
836
say " $( date -u +' %F %H:%M:%S %Z' ) : Host $( hostname) provisioned"
827
837
}
@@ -899,6 +909,7 @@ cmd_containerd() {
899
909
cmd_flintlock () {
900
910
local version=" $FLINTLOCK_VERSION "
901
911
local address=" "
912
+ local port=" "
902
913
local parent_iface=" "
903
914
local bridge_name=" "
904
915
local insecure=false
@@ -918,6 +929,10 @@ cmd_flintlock() {
918
929
shift
919
930
address=" $1 "
920
931
;;
932
+ " -p" | " --grpc-port" )
933
+ shift
934
+ port=" $1 "
935
+ ;;
921
936
" -i" | " --parent-iface" )
922
937
shift
923
938
parent_iface=" $1 "
@@ -945,7 +960,7 @@ cmd_flintlock() {
945
960
946
961
set_arch
947
962
prepare_dirs
948
- do_all_flintlock " $version " " $address " " $parent_iface " " $bridge_name " " $insecure " " $config_file "
963
+ do_all_flintlock " $version " " $address " " $parent_iface " " $bridge_name " " $insecure " " $config_file " " $port "
949
964
}
950
965
951
966
cmd_direct_lvm () {
0 commit comments