Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
TFS
controller
Commits
afb690d3
Commit
afb690d3
authored
1 year ago
by
Lluis Gifre Renom
Browse files
Options
Downloads
Patches
Plain Diff
Deploy scripts:
- Added conditions to skip unneeded steps
parent
98857f48
No related branches found
No related tags found
1 merge request
!142
Release TeraFlowSDN 2.1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
deploy/expose_dashboard.sh
+12
-5
12 additions, 5 deletions
deploy/expose_dashboard.sh
deploy/tfs.sh
+6
-1
6 additions, 1 deletion
deploy/tfs.sh
with
18 additions
and
6 deletions
deploy/expose_dashboard.sh
+
12
−
5
View file @
afb690d3
...
@@ -29,11 +29,13 @@ export GRAF_EXT_PORT_HTTP=${GRAF_EXT_PORT_HTTP:-"3000"}
...
@@ -29,11 +29,13 @@ export GRAF_EXT_PORT_HTTP=${GRAF_EXT_PORT_HTTP:-"3000"}
# Automated steps start here
# Automated steps start here
########################################################################################################################
########################################################################################################################
MONITORING_NAMESPACE
=
"monitoring"
function
expose_dashboard
()
{
function
expose_dashboard
()
{
echo
"Prometheus Port Mapping"
echo
"Prometheus Port Mapping"
echo
">>> Expose Prometheus HTTP Mgmt GUI port (9090->
${
PROM_EXT_PORT_HTTP
}
)"
echo
">>> Expose Prometheus HTTP Mgmt GUI port (9090->
${
PROM_EXT_PORT_HTTP
}
)"
PROM_PORT_HTTP
=
$(
kubectl
--namespace
monitoring
get service prometheus-k8s
-o
'jsonpath={.spec.ports[?(@.name=="web")].port}'
)
PROM_PORT_HTTP
=
$(
kubectl
--namespace
${
MONITORING_NAMESPACE
}
get service prometheus-k8s
-o
'jsonpath={.spec.ports[?(@.name=="web")].port}'
)
PATCH
=
'{"data": {"'
${
PROM_EXT_PORT_HTTP
}
'": "
monitoring
/prometheus-k8s:'
${
PROM_PORT_HTTP
}
'"}}'
PATCH
=
'{"data": {"'
${
PROM_EXT_PORT_HTTP
}
'": "
'
${
MONITORING_NAMESPACE
}
'
/prometheus-k8s:'
${
PROM_PORT_HTTP
}
'"}}'
kubectl patch configmap nginx-ingress-tcp-microk8s-conf
--namespace
ingress
--patch
"
${
PATCH
}
"
kubectl patch configmap nginx-ingress-tcp-microk8s-conf
--namespace
ingress
--patch
"
${
PATCH
}
"
PORT_MAP
=
'{"containerPort": '
${
PROM_EXT_PORT_HTTP
}
', "hostPort": '
${
PROM_EXT_PORT_HTTP
}
'}'
PORT_MAP
=
'{"containerPort": '
${
PROM_EXT_PORT_HTTP
}
', "hostPort": '
${
PROM_EXT_PORT_HTTP
}
'}'
...
@@ -44,8 +46,8 @@ function expose_dashboard() {
...
@@ -44,8 +46,8 @@ function expose_dashboard() {
echo
"Grafana Port Mapping"
echo
"Grafana Port Mapping"
echo
">>> Expose Grafana HTTP Mgmt GUI port (3000->
${
GRAF_EXT_PORT_HTTP
}
)"
echo
">>> Expose Grafana HTTP Mgmt GUI port (3000->
${
GRAF_EXT_PORT_HTTP
}
)"
GRAF_PORT_HTTP
=
$(
kubectl
--namespace
monitoring
get service grafana
-o
'jsonpath={.spec.ports[?(@.name=="http")].port}'
)
GRAF_PORT_HTTP
=
$(
kubectl
--namespace
${
MONITORING_NAMESPACE
}
get service grafana
-o
'jsonpath={.spec.ports[?(@.name=="http")].port}'
)
PATCH
=
'{"data": {"'
${
GRAF_EXT_PORT_HTTP
}
'": "
monitoring
/grafana:'
${
GRAF_PORT_HTTP
}
'"}}'
PATCH
=
'{"data": {"'
${
GRAF_EXT_PORT_HTTP
}
'": "
'
${
MONITORING_NAMESPACE
}
'
/grafana:'
${
GRAF_PORT_HTTP
}
'"}}'
kubectl patch configmap nginx-ingress-tcp-microk8s-conf
--namespace
ingress
--patch
"
${
PATCH
}
"
kubectl patch configmap nginx-ingress-tcp-microk8s-conf
--namespace
ingress
--patch
"
${
PATCH
}
"
PORT_MAP
=
'{"containerPort": '
${
GRAF_EXT_PORT_HTTP
}
', "hostPort": '
${
GRAF_EXT_PORT_HTTP
}
'}'
PORT_MAP
=
'{"containerPort": '
${
GRAF_EXT_PORT_HTTP
}
', "hostPort": '
${
GRAF_EXT_PORT_HTTP
}
'}'
...
@@ -55,4 +57,9 @@ function expose_dashboard() {
...
@@ -55,4 +57,9 @@ function expose_dashboard() {
echo
echo
}
}
expose_dashboard
if
kubectl get namespace
${
MONITORING_NAMESPACE
}
&> /dev/null
;
then
echo
">>> Namespace
${
MONITORING_NAMESPACE
}
is present, exposing dashboard..."
expose_dashboard
else
echo
">>> Namespace
${
MONITORING_NAMESPACE
}
is NOT present, skipping expose dashboard..."
fi
This diff is collapsed.
Click to expand it.
deploy/tfs.sh
+
6
−
1
View file @
afb690d3
...
@@ -327,7 +327,12 @@ echo "Deploying extra manifests..."
...
@@ -327,7 +327,12 @@ echo "Deploying extra manifests..."
for
EXTRA_MANIFEST
in
$TFS_EXTRA_MANIFESTS
;
do
for
EXTRA_MANIFEST
in
$TFS_EXTRA_MANIFESTS
;
do
echo
"Processing manifest '
$EXTRA_MANIFEST
'..."
echo
"Processing manifest '
$EXTRA_MANIFEST
'..."
if
[[
"
$EXTRA_MANIFEST
"
==
*
"servicemonitor"
*
]]
;
then
if
[[
"
$EXTRA_MANIFEST
"
==
*
"servicemonitor"
*
]]
;
then
kubectl apply
-f
$EXTRA_MANIFEST
if
kubectl get namespace monitoring &> /dev/null
;
then
echo
">>> Namespace monitoring is present, applying service monitors..."
kubectl apply
-f
$EXTRA_MANIFEST
else
echo
">>> Namespace monitoring is NOT present, skipping service monitors..."
fi
else
else
kubectl
--namespace
$TFS_K8S_NAMESPACE
apply
-f
$EXTRA_MANIFEST
kubectl
--namespace
$TFS_K8S_NAMESPACE
apply
-f
$EXTRA_MANIFEST
fi
fi
...
...
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