Commit e35d7100 authored by João Lino's avatar João Lino

Upgrade docker image version and add some initialization scripts.

parent a4bae91e
#!/bin/sh
__is_pod_ready() {
POD_STATUS="False"
while [ "$POD_STATUS" != "True" ];
do
echo "waiting for pod..."
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
}
# install nexus
helm install -f values.yaml --namespace demo-infra --kubeconfig ~/.kube/config demo-infra-nexus oteemo.github.io/charts/sonatype-nexus
__expose_pod() {
# 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
__is_pod_ready
# wait for it to become ready
__is_pod_ready
# print admin password
#export JENKINS_PASS=$(kubectl get secret --namespace demo-infra demo-infra-jenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode)
echo "HOST: http://192.168.1.194:8180 USERNAME: admin PASSWORD: admin123"
# create proxy into the pod
__expose_pod
# expose
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 &
fi
#!/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
helm uninstall --namespace demo-infra --kubeconfig ~/.kube/config demo-infra-jenkins
helm uninstall --namespace demo-infra --kubeconfig ~/.kube/config demo-infra-nexus
......@@ -10,7 +10,7 @@ deploymentStrategy: {}
nexus:
imageName: quay.io/travelaudience/docker-nexus
imageTag: 3.21.2-03
imageTag: 3.22.0-02
imagePullPolicy: IfNotPresent
# Uncomment this to scheduler pods on priority
# priorityClassName: "high-priority"
......@@ -19,6 +19,8 @@ nexus:
value: "-Xms1200M -Xmx1200M -XX:MaxDirectMemorySize=2G -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
- name: NEXUS_SECURITY_RANDOMPASSWORD
value: "false"
- name: NEXUS_CONTEXT
value: "nexus"
# nodeSelector:
# cloud.google.com/gke-nodepool: default-pool
resources: {}
......@@ -59,13 +61,13 @@ nexus:
periodSeconds: 30
failureThreshold: 6
# timeoutSeconds: 10
path: /
path: /nexus
readinessProbe:
initialDelaySeconds: 30
periodSeconds: 30
failureThreshold: 6
# timeoutSeconds: 10
path: /
path: /nexus
# hostAliases allows the modification of the hosts file inside a container
hostAliases: []
# - ip: "192.168.1.10"
......@@ -92,7 +94,7 @@ nexusProxy:
# labels: {}
env:
nexusDockerHost:
nexusHttpHost:
nexusHttpHost: www.joaolino.com
enforceHttps: false
cloudIamAuthEnabled: false
## If cloudIamAuthEnabled is set to true uncomment the variables below and remove this line
......@@ -113,7 +115,7 @@ nexusProxy:
# memory: 512Mi
nexusProxyRoute:
enabled: true
enabled: false
labels:
annotations:
path: /nexus
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment