Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
microservice-architecture
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Nico Benjamin Pögel
microservice-architecture
Commits
c2932baa
Commit
c2932baa
authored
1 year ago
by
Nico P
Browse files
Options
Downloads
Patches
Plain Diff
fixed install script to work for non-root users. Also added install script for wsl environment.
parent
031b997f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
install_msa.sh
+24
-3
24 additions, 3 deletions
install_msa.sh
install_msa_wsl.sh
+79
-0
79 additions, 0 deletions
install_msa_wsl.sh
with
103 additions
and
3 deletions
install_msa.sh
+
24
−
3
View file @
c2932baa
#Save directory of the script in variable
SCRIPT_DIR
=
$(
cd
--
"
$(
dirname
--
"
${
BASH_SOURCE
[0]
}
"
)
"
&> /dev/null
&&
pwd
)
USER_HOME
=
$(
getent passwd
$SUDO_USER
|
cut
-d
:
-f6
)
#Download and install K3s, then create a single node cluster
curl
-sfL
https://get.k3s.io | sh -
#Wait for availability of Traefik-CRDs in the cluster
counter
=
1
retries
=
10
sleeptime
=
10
while
[
$counter
-le
$retries
]
do
((
counter++
))
kubectl get ingressroute
if
[
$?
-eq
0
]
;
then
break
else
if
[
$counter
-eq
$retries
]
;
then
echo
CRDs are not yet available, please
install
helm-chart manually
exit
1
fi
echo
CRDs not yet ready, retrying
in
$sleeptime
seconds
sleep
$sleeptime
fi
done
#Download Linkerd and install onto cluster
linkerd version
if
[
$?
-eq
0
]
;
then
...
...
@@ -12,7 +33,7 @@ else
curl
--proto
'=https'
--tlsv1
.2
-sSfL
https://run.linkerd.io/install | sh
fi
export
PATH
=
$PATH
:
/root
/.linkerd2/bin
export
PATH
=
$PATH
:
$USER_HOME
/.linkerd2/bin
export
KUBECONFIG
=
/etc/rancher/k3s/k3s.yaml
linkerd
install
--crds
| kubectl apply
-f
-
...
...
@@ -30,14 +51,14 @@ else
sudo
apt-get
install
helm
fi
#Wait for availability of CRDs in the cluster
#Wait for availability of
Linkerd-
CRDs in the cluster
counter
=
1
retries
=
10
sleeptime
=
10
while
[
$counter
-le
$retries
]
do
((
counter++
))
kubectl get
ingressroute
kubectl get
serviceprofiles
if
[
$?
-eq
0
]
;
then
break
else
...
...
This diff is collapsed.
Click to expand it.
install_msa_wsl.sh
0 → 100644
+
79
−
0
View file @
c2932baa
#Save directory of the script in variable
SCRIPT_DIR
=
$(
cd
--
"
$(
dirname
--
"
${
BASH_SOURCE
[0]
}
"
)
"
&> /dev/null
&&
pwd
)
USER_HOME
=
$(
getent passwd
$SUDO_USER
|
cut
-d
:
-f6
)
#Download and install K3s, then create a single node cluster
curl
-sfL
https://get.k3s.io | sh -
#Wait for availability of Traefik-CRDs in the cluster
counter
=
1
retries
=
10
sleeptime
=
10
while
[
$counter
-le
$retries
]
do
((
counter++
))
kubectl get ingressroute
if
[
$?
-eq
0
]
;
then
break
else
if
[
$counter
-eq
$retries
]
;
then
echo
CRDs are not yet available, please
install
helm-chart manually
exit
1
fi
echo
CRDs not yet ready, retrying
in
$sleeptime
seconds
sleep
$sleeptime
fi
done
#Edit K3s service environment variable file to change access permissions to k3s.yaml
sudo echo
K3S_KUBECONFIG_MODE
=
\"
644
\"
>>
/etc/systemd/system/k3s.service.env
sudo
systemctl restart k3s
#Download Linkerd and install onto cluster
linkerd version
if
[
$?
-eq
0
]
;
then
echo
Linkerd already installed
else
curl
--proto
'=https'
--tlsv1
.2
-sSfL
https://run.linkerd.io/install | sh
fi
export
PATH
=
$PATH
:
$USER_HOME
/.linkerd2/bin
export
KUBECONFIG
=
/etc/rancher/k3s/k3s.yaml
linkerd
install
--crds
| kubectl apply
-f
-
linkerd
install
| kubectl apply
-f
-
#Install Helm if not present
helm version
if
[
$?
-eq
0
]
;
then
echo
Helm already installed
else
curl https://baltocdn.com/helm/signing.asc | gpg
--dearmor
|
sudo tee
/usr/share/keyrings/helm.gpg
>
/dev/null
sudo
apt-get
install
apt-transport-https
--yes
echo
"deb [arch=
$(
dpkg
--print-architecture
)
signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main"
|
sudo tee
/etc/apt/sources.list.d/helm-stable-debian.list
sudo
apt-get update
sudo
apt-get
install
helm
fi
#Wait for availability of Linkerd-CRDs in the cluster
counter
=
1
retries
=
10
sleeptime
=
10
while
[
$counter
-le
$retries
]
do
((
counter++
))
kubectl get serviceprofiles
if
[
$?
-eq
0
]
;
then
break
else
if
[
$counter
-eq
$retries
]
;
then
echo
CRDs are not yet available, please
install
helm-chart manually
exit
1
fi
echo
CRDs not yet ready, retrying
in
$sleeptime
seconds
sleep
$sleeptime
fi
done
#Install Helm-Chart
helm
install
helm-msa
$SCRIPT_DIR
/helm/helm-msa
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