Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Demo Infra Nexus
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
demo
Demo Infra Nexus
Commits
e35d7100
Commit
e35d7100
authored
Apr 17, 2020
by
João Lino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade docker image version and add some initialization scripts.
parent
a4bae91e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
18 deletions
+44
-18
demo-infra-nexus-install.sh
demo-infra-nexus-install.sh
+32
-12
demo-infra-nexus-uninstall.sh
demo-infra-nexus-uninstall.sh
+5
-1
values.yaml
values.yaml
+7
-5
No files found.
demo-infra-nexus-install.sh
View file @
e35d7100
#!/bin/sh
#!/bin/sh
__is_pod_ready
()
{
__is_pod_ready
()
{
POD_STATUS
=
"False"
POD_STATUS
=
"False"
while
[
"
$POD_STATUS
"
!=
"True"
]
;
while
[
"
$POD_STATUS
"
!=
"True"
]
;
do
do
echo
"waiting for pod..."
echo
"waiting for pod..."
sleep
5
sleep
5
POD_STATUS
=
$(
kubectl get pods
--namespace
demo-infra
-l
"app
.kubernetes.io/component=jenkins-master"
-l
"app.kubernetes.io/instance=demo-infra
-nexus"
-o
jsonpath
=
'{..status.conditions[?(@.type=="Ready")].status}'
)
POD_STATUS
=
$(
kubectl get pods
--namespace
demo-infra
-l
"app
=sonatype
-nexus"
-o
jsonpath
=
'{..status.conditions[?(@.type=="Ready")].status}'
)
done
done
}
}
# install nexus
__expose_pod
()
{
helm
install
-f
values.yaml
--namespace
demo-infra
--kubeconfig
~/.kube/config demo-infra-nexus oteemo.github.io/charts/sonatype-nexus
# kill any previous proxy
kill
$(
ps aux |
grep
'8280[:]8080'
|
awk
'{print $2}'
)
kill
$(
ps aux |
grep
'8281[:]8081'
|
awk
'{print $2}'
)
# print admin password
echo
"HOST: http://192.168.1.194:8280 USERNAME: admin PASSWORD: admin123"
# expose
export
POD_NAME
=
$(
kubectl get pods
--namespace
demo-infra
-l
"app=sonatype-nexus"
-o
jsonpath
=
"{.items[0].metadata.name}"
)
kubectl
--namespace
demo-infra port-forward
$POD_NAME
8280:8080
--address
0.0.0.0 &
kubectl
--namespace
demo-infra port-forward
$POD_NAME
8281:8081
--address
0.0.0.0 &
}
POD_STATUS
=
$(
kubectl get pods
--namespace
demo-infra
-l
"app=sonatype-nexus"
-o
jsonpath
=
'{..status.conditions[?(@.type=="Ready")].status}'
)
if
[
"
$POD_STATUS
"
=
'True'
]
;
then
echo
"pod already installed, exposing it..."
# create proxy into the pod
__expose_pod
else
echo
"pod missing, installing it..."
# install nexus
helm
install
-f
values.yaml
--namespace
demo-infra
--kubeconfig
~/.kube/config demo-infra-nexus ./
# wait for it to become ready
# wait for it to become ready
__is_pod_ready
__is_pod_ready
# print admin password
# create proxy into the pod
#export JENKINS_PASS=$(kubectl get secret --namespace demo-infra demo-infra-jenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode)
__expose_pod
echo
"HOST: http://192.168.1.194:8180 USERNAME: admin PASSWORD: admin123"
# expose
fi
export
POD_NAME
=
$(
kubectl get pods
--namespace
demo-infra
-l
"app.kubernetes.io/component=jenkins-master"
-l
"app.kubernetes.io/instance=demo-infra-jenkins"
-o
jsonpath
=
"{.items[0].metadata.name}"
)
kubectl
--namespace
demo-infra port-forward
$POD_NAME
8180:8080
--address
0.0.0.0 &
demo-infra-nexus-uninstall.sh
View file @
e35d7100
#!/bin/sh
#!/bin/sh
# remove proxy
kill
$(
ps aux |
grep
'8280[:]8080'
|
awk
'{print $2}'
)
kill
$(
ps aux |
grep
'8281[:]8081'
|
awk
'{print $2}'
)
# use helm for uninstall
# use helm for uninstall
helm uninstall
--namespace
demo-infra
--kubeconfig
~/.kube/config demo-infra-
jenkin
s
helm uninstall
--namespace
demo-infra
--kubeconfig
~/.kube/config demo-infra-
nexu
s
values.yaml
View file @
e35d7100
...
@@ -10,7 +10,7 @@ deploymentStrategy: {}
...
@@ -10,7 +10,7 @@ deploymentStrategy: {}
nexus
:
nexus
:
imageName
:
quay.io/travelaudience/docker-nexus
imageName
:
quay.io/travelaudience/docker-nexus
imageTag
:
3.2
1.2-03
imageTag
:
3.2
2.0-02
imagePullPolicy
:
IfNotPresent
imagePullPolicy
:
IfNotPresent
# Uncomment this to scheduler pods on priority
# Uncomment this to scheduler pods on priority
# priorityClassName: "high-priority"
# priorityClassName: "high-priority"
...
@@ -19,6 +19,8 @@ nexus:
...
@@ -19,6 +19,8 @@ nexus:
value
:
"
-Xms1200M
-Xmx1200M
-XX:MaxDirectMemorySize=2G
-XX:+UnlockExperimentalVMOptions
-XX:+UseCGroupMemoryLimitForHeap"
value
:
"
-Xms1200M
-Xmx1200M
-XX:MaxDirectMemorySize=2G
-XX:+UnlockExperimentalVMOptions
-XX:+UseCGroupMemoryLimitForHeap"
-
name
:
NEXUS_SECURITY_RANDOMPASSWORD
-
name
:
NEXUS_SECURITY_RANDOMPASSWORD
value
:
"
false"
value
:
"
false"
-
name
:
NEXUS_CONTEXT
value
:
"
nexus"
# nodeSelector:
# nodeSelector:
# cloud.google.com/gke-nodepool: default-pool
# cloud.google.com/gke-nodepool: default-pool
resources
:
{}
resources
:
{}
...
@@ -59,13 +61,13 @@ nexus:
...
@@ -59,13 +61,13 @@ nexus:
periodSeconds
:
30
periodSeconds
:
30
failureThreshold
:
6
failureThreshold
:
6
# timeoutSeconds: 10
# timeoutSeconds: 10
path
:
/
path
:
/
nexus
readinessProbe
:
readinessProbe
:
initialDelaySeconds
:
30
initialDelaySeconds
:
30
periodSeconds
:
30
periodSeconds
:
30
failureThreshold
:
6
failureThreshold
:
6
# timeoutSeconds: 10
# timeoutSeconds: 10
path
:
/
path
:
/
nexus
# hostAliases allows the modification of the hosts file inside a container
# hostAliases allows the modification of the hosts file inside a container
hostAliases
:
[]
hostAliases
:
[]
# - ip: "192.168.1.10"
# - ip: "192.168.1.10"
...
@@ -92,7 +94,7 @@ nexusProxy:
...
@@ -92,7 +94,7 @@ nexusProxy:
# labels: {}
# labels: {}
env
:
env
:
nexusDockerHost
:
nexusDockerHost
:
nexusHttpHost
:
nexusHttpHost
:
www.joaolino.com
enforceHttps
:
false
enforceHttps
:
false
cloudIamAuthEnabled
:
false
cloudIamAuthEnabled
:
false
## If cloudIamAuthEnabled is set to true uncomment the variables below and remove this line
## If cloudIamAuthEnabled is set to true uncomment the variables below and remove this line
...
@@ -113,7 +115,7 @@ nexusProxy:
...
@@ -113,7 +115,7 @@ nexusProxy:
# memory: 512Mi
# memory: 512Mi
nexusProxyRoute
:
nexusProxyRoute
:
enabled
:
tru
e
enabled
:
fals
e
labels
:
labels
:
annotations
:
annotations
:
path
:
/nexus
path
:
/nexus
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment