UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects

SKIP UPGRADE Pipeline Refactor

Merged Branden Cobb requested to merge bcobb-pipelinetest into master
Compare and
69 files
+ 533
3447
Compare changes
  • Side-by-side
  • Inline
Files
69
.k8s-util:
image: registry.dso.mil/platform-one/big-bang/pipeline-templates/pipeline-templates/k8s-ci:v1.20.4-bb.3
.dind-runner:
tags:
- bigbang
- umbrella
- privileged
- dogfood
# In cluster k3s using K3D with the docker daemon as a sidecar
#
# This will connect to a remote docker daemon over tls tcp (defined at installation of gitlab runners) and create
# a k3d cluster in a custom built docker bridge network.
#
.k3d-ci:
extends:
- .k8s-util
- .dind-runner
# services:
# # Added in through gitlab ci configuration, left in incase some poor soul needs to come debug this later
# - name: docker:20.10.5-dind
variables:
DOCKER_HOST: tcp://localhost:2376
DOCKER_TLS_CERTDIR: "/certs"
DOCKER_TLS_VERIFY: 1
DOCKER_CERT_PATH: "$DOCKER_TLS_CERTDIR/client"
DOCKER_DRIVER: overlay2
before_script:
- echo -e "\e[0Ksection_start:`date +%s`:k3d_up[collapsed=true]\r\e[0K\e[33;1mK3D Cluster Create\e[37m"
# Give docker-in-docker time to come alive
- i=0; while [ "$i" -lt 12 ]; do docker info &>/dev/null && break; sleep 5; i=$(( i + 1 )) ; done
- docker network create ${CI_JOB_ID} --driver=bridge -o "com.docker.network.driver.mtu"="1450" --subnet=172.20.0.0/16
- chmod +x tests/ci/k3d/deploy_k3d.sh; echo "Executing tests/ci/k3d/deploy_k3d.sh..."; ./tests/ci/k3d/deploy_k3d.sh
- until kubectl get deployment coredns -n kube-system -o go-template='{{.status.availableReplicas}}' | grep -v -e '<no value>'; do sleep 1s; done
- chmod +x tests/ci/k3d/metallb/install_metallb.sh; echo "Executing tests/ci/k3d/metallb/install_metallb.sh..."; ./tests/ci/k3d/metallb/install_metallb.sh
- kubectl get all -A
- echo -e "\e[0Ksection_end:`date +%s`:k3d_up\r\e[0K"
after_script:
- echo -e "\e[0Ksection_start:`date +%s`:k3d_down[collapsed=true]\r\e[0K\e[33;1mK3D Cluster Delete\e[37m"
- kubectl get all -A
- echo -e "\e[0Ksection_start:`date +%s`:show_event_log[collapsed=true]\r\e[0K\e[33;1mCluster event log:\e[37m"
- kubectl get events -A
- echo -e "\e[0Ksection_end:`date +%s`:show_event_log\r\e[0K"
- kubectl get gitrepository,helmrelease,kustomizations -A
- k3d cluster delete ${CI_JOB_ID}
- docker network rm ${CI_JOB_ID}
- echo -e "\e[0Ksection_end:`date +%s`:k3d_down\r\e[0K"
\ No newline at end of file
Loading