diff --git a/init.groovy.d/configure-quiet-period.groovy b/init.groovy.d/configure-quiet-period.groovy new file mode 100644 index 0000000..0754c1d --- /dev/null +++ b/init.groovy.d/configure-quiet-period.groovy @@ -0,0 +1,9 @@ +#!/usr/bin/env groovy +/* + * Set the global quiet period to zero to avoid any delays in provisioning + * infrastructure or executing Pipelines + */ + +import jenkins.model.Jenkins + +Jenkins.instance.quietPeriod = 0 diff --git a/k8s/jenkins.yaml.template b/k8s/jenkins.yaml.template index 5042a0b..fdb09d6 100644 --- a/k8s/jenkins.yaml.template +++ b/k8s/jenkins.yaml.template @@ -76,8 +76,9 @@ items: template: metadata: labels: - app: 'jenkins' + app: 'jenkins-@@USER@@' owner: '@@USER@@' + kind: 'master' annotations: spec: securityContext: diff --git a/scripts/rolling-update-canary b/scripts/rolling-update-canary index bd05d2f..8657a0e 100755 --- a/scripts/rolling-update-canary +++ b/scripts/rolling-update-canary @@ -1,3 +1,9 @@ #!/bin/sh -exec kubectl rolling-update canary --image=rtyler/codevalet-canary:latest --image-pull-policy=Always --update-period=10s +NAMESPACE=canary +for pod in $(kubectl get pods --namespace=${NAMESPACE} -l app=canary -o name); do + echo ">> Terminating ${pod}" + kubectl delete --namespace=${NAMESPACE} ${pod} + # Sleep to allow Kubernetes to pull the latest image + sleep 5 +done; diff --git a/scripts/rolling-update-masters b/scripts/rolling-update-masters index aac4b30..a5cfaf3 100755 --- a/scripts/rolling-update-masters +++ b/scripts/rolling-update-masters @@ -1,7 +1,6 @@ #!/bin/sh -REPO_DIR=$(realpath $(dirname $0)/../) -for monkey in $(cat $REPO_DIR/monkeys.txt); do - kubectl rolling-update jenkins-${monkey} --image=rtyler/codevalet-master:latest --image-pull-policy=Always --update-period=10s +for pod in $(kubectl get pods --all-namespaces -o name -l kind=master); do + echo $pod; done; diff --git a/scripts/rolling-update-nginx b/scripts/rolling-update-nginx deleted file mode 100755 index eb98b26..0000000 --- a/scripts/rolling-update-nginx +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -exec kubectl rolling-update nginx --image=rtyler/codevalet-proxy:latest --image-pull-policy=Always --update-period=10s diff --git a/scripts/rolling-update-webapp b/scripts/rolling-update-webapp index 71d9b0b..c95dc8f 100755 --- a/scripts/rolling-update-webapp +++ b/scripts/rolling-update-webapp @@ -1,7 +1,8 @@ #!/bin/sh -POD=$(kubectl get pods --namespace=webapp -l app=webapp | tail -n 1 | awk '{ print $1 }') - -echo ">> Killing ${POD}" - -exec kubectl delete pod --namespace=webapp ${POD} +NAMESPACE=webapp +for pod in $(kubectl get pods --namespace=${NAMESPACE} -l app=webapp -o name); do + echo ">> Terminating ${pod}" + kubectl delete --namespace=${NAMESPACE} ${pod} + # Sleep to allow Kubernetes to pull the latest image +done;