UNCLASSIFIED - NO CUI
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bigbang
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Big Bang
bigbang
Commits
b8692cfc
Commit
b8692cfc
authored
3 years ago
by
evan.rush
Committed by
Micah Nagel
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Docs - 948 - k3d-dev.sh needs preflight/requirement checks
parent
e8697351
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!1386
Master
,
!1165
Docs - 948 - k3d-dev.sh needs preflight/requirement checks
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/developer/scripts/k3d-dev.sh
+27
-3
27 additions, 3 deletions
docs/developer/scripts/k3d-dev.sh
with
27 additions
and
3 deletions
docs/developer/scripts/k3d-dev.sh
+
27
−
3
View file @
b8692cfc
#!/bin/bash
#### Preflight Checks
# check for tools
tooldependencies
=(
jq
sed
aws ssh ssh-keygen scp kubectl
)
for
tooldependency
in
"
${
tooldependencies
[@]
}
"
do
command
-v
$tooldependency
>
/dev/null 2>&1
||
{
echo
>
&2
"
$tooldependency
is not installed."
;
missingtool
=
1
;
}
done
sed_gsed
=
"sed"
# verify sed version if mac
uname
=
"
$(
uname
-s
)
"
if
[[
"
${
uname
}
"
==
"Darwin"
]]
;
then
if
[[
$(
command
-v
gsed
)
]]
;
then
sed_gsed
=
"gsed"
else
missingtool
=
1
echo
' gnu-sed is not installed. "brew install gnu-sed"'
fi
fi
# if tool missing, exit
if
[[
"
${
missingtool
}
"
==
1
]]
;
then
echo
" Please install required tools. Aborting."
exit
1
fi
# getting AWs user name
AWSUSERNAME
=
$(
aws sts get-caller-identity
--query
Arn
--output
text |
cut
-f
2
-d
'/'
)
...
...
@@ -376,7 +400,7 @@ then
echo
echo
"copy kubeconfig"
scp
-i
~/.ssh/
${
KeyName
}
.pem
-o
StrictHostKeyChecking
=
no ubuntu@
${
PublicIP
}
:/home/ubuntu/.kube/config ~/.kube/
${
AWSUSERNAME
}
-dev-config
sed
-i
"s/0
\.
0
\.
0
\.
0/
${
PrivateIP
}
/g"
~/.kube/
${
AWSUSERNAME
}
-dev-config
$sed_g
sed
-i
"s/0
\.
0
\.
0
\.
0/
${
PrivateIP
}
/g"
~/.kube/
${
AWSUSERNAME
}
-dev-config
elif
[[
"
$PRIVATE_IP
"
==
true
]]
then
...
...
@@ -387,7 +411,7 @@ then
echo
echo
"copy kubeconfig"
scp
-i
~/.ssh/
${
KeyName
}
.pem
-o
StrictHostKeyChecking
=
no ubuntu@
${
PublicIP
}
:/home/ubuntu/.kube/config ~/.kube/
${
AWSUSERNAME
}
-dev-config
sed
-i
"s/0
\.
0
\.
0
\.
0/
${
PrivateIP
}
/g"
~/.kube/
${
AWSUSERNAME
}
-dev-config
$sed_g
sed
-i
"s/0
\.
0
\.
0
\.
0/
${
PrivateIP
}
/g"
~/.kube/
${
AWSUSERNAME
}
-dev-config
else
# default is public ip
ssh
-i
~/.ssh/
${
KeyName
}
.pem
-o
StrictHostKeyChecking
=
no ubuntu@
${
PublicIP
}
"k3d cluster create --servers 1 --agents 3 --volume /etc/machine-id:/etc/machine-id --k3s-server-arg "
--disable
=
traefik
" --k3s-server-arg "
--disable
=
metrics-server
" --k3s-server-arg "
--tls-san
=
${
PublicIP
}
" --port 80:80@loadbalancer --port 443:443@loadbalancer --api-port 6443"
...
...
@@ -398,7 +422,7 @@ else # default is public ip
echo
echo
"copy kubeconfig"
scp
-i
~/.ssh/
${
KeyName
}
.pem
-o
StrictHostKeyChecking
=
no ubuntu@
${
PublicIP
}
:/home/ubuntu/.kube/config ~/.kube/
${
AWSUSERNAME
}
-dev-config
sed
-i
"s/0
\.
0
\.
0
\.
0/
${
PublicIP
}
/g"
~/.kube/
${
AWSUSERNAME
}
-dev-config
$sed_g
sed
-i
"s/0
\.
0
\.
0
\.
0/
${
PublicIP
}
/g"
~/.kube/
${
AWSUSERNAME
}
-dev-config
fi
# add tools
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment