Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
k8s-ingress
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
uplex-varnish
k8s-ingress
Commits
1e7d2d7b
Commit
1e7d2d7b
authored
Apr 24, 2020
by
Tim Leers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build images, create kind cluster and run e2e for CI
parent
e9c89446
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
108 additions
and
22 deletions
+108
-22
.gitlab-ci.yml
.gitlab-ci.yml
+76
-22
.kind-gitlab.yaml
.kind-gitlab.yaml
+17
-0
e2e.gitlab.sh
test/e2e.gitlab.sh
+15
-0
No files found.
.gitlab-ci.yml
View file @
1e7d2d7b
image
:
golang:1.11.6
cache
:
paths
:
-
/apt-cache
-
/go/bin
-
/go/pkg
-
/go/src/code.uplex.de
-
/go/src/github.com
-
/go/src/golang.org
-
/go/src/google.golang.org
-
/go/src/gopkg.in
-
/go/src/k8s.io
stages
:
-
e2e
-
test
before_script
:
-
go get -u golang.org/x/lint/golint
-
go get -d -v github.com/slimhazard/gogitversion
-
go mod download
-
pushd /go/pkg/mod/github.com/slimhazard/gogitversion*
-
make install
-
popd
-
build
test
:
image
:
golang:1.11.6
stage
:
test
cache
:
paths
:
-
/apt-cache
-
/go/bin
-
/go/pkg
-
/go/src/code.uplex.de
-
/go/src/github.com
-
/go/src/golang.org
-
/go/src/google.golang.org
-
/go/src/gopkg.in
-
/go/src/k8s.io
before_script
:
-
GO111MODULE=off go get -d github.com/slimhazard/gogitversion
-
pushd $GOPATH/src/github.com/slimhazard/gogitversion*
-
make install
-
popd
-
go get -u golang.org/x/lint/golint
-
go mod download
script
:
-
make check
build:controller
:
stage
:
build
image
:
docker:19.03.8
services
:
-
docker:19.03.8-dind
variables
:
DOCKER_TLS_CERTDIR
:
"
/certs"
CI_REGISTRY_IMAGE
:
varnish-controller
script
:
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
-
docker pull $CI_REGISTRY/timleers/k8s-ingress/$CI_REGISTRY_IMAGE:latest ||
true
-
docker build --cache-from $CI_REGISTRY/timleers/k8s-ingress/$CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA --tag $CI_REGISTRY_IMAGE:latest -f container/Dockerfile.controller .
-
docker tag $CI_REGISTRY_IMAGE:latest $CI_REGISTRY/timleers/k8s-ingress/$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
-
docker tag $CI_REGISTRY_IMAGE:latest $CI_REGISTRY/timleers/k8s-ingress/$CI_REGISTRY_IMAGE:latest
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
-
docker push $CI_REGISTRY/timleers/k8s-ingress/$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
-
docker push $CI_REGISTRY/timleers/k8s-ingress/$CI_REGISTRY_IMAGE:latest
# integration
:
# stage: e2e
# image: tiltdev/tilt
# services:
# - docker:19.03.8-dind
# variables:
# DOCKER_HOST: "tcp://docker:2375"
# script:
# - apt install make
# - test/e2e.gitlab.sh
integration
:
stage
:
e2e
image
:
docker:19.03.8
services
:
-
docker:19.03.8-dind
variables
:
KUBECTL
:
v1.17.0
KIND
:
v0.7.0
before_script
:
-
apk add -U wget
-
apk add -U varnish
-
apk add -U make
-
apk add -U bash
-
wget -O /usr/local/bin/kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND}/kind-linux-amd64
-
chmod +x /usr/local/bin/kind
-
wget -O /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${KUBECTL}/bin/linux/amd64/kubectl
-
chmod +x /usr/local/bin/kubectl
-
kind create cluster --config=.kind-gitlab.yaml
-
sed -i -E -e 's/localhost|0\.0\.0\.0/docker/g' "$HOME/.kube/config"
-
kubectl get nodes -o wide
-
kubectl get pods --all-namespaces -o wide
-
kubectl get services --all-namespaces -o wide
script
:
-
test/e2e.gitlab.sh
.kind-gitlab.yaml
0 → 100644
View file @
1e7d2d7b
apiVersion
:
kind.x-k8s.io/v1alpha4
kind
:
Cluster
networking
:
apiServerAddress
:
"
0.0.0.0"
# add to the apiServer certSANs the name of the docker (dind) service in order to be able to reach the cluster through it
kubeadmConfigPatchesJSON6902
:
-
group
:
kubeadm.k8s.io
version
:
v1beta2
kind
:
ClusterConfiguration
patch
:
|
- op: add
path: /apiServer/certSANs/-
value: docker
nodes
:
-
role
:
control-plane
-
role
:
worker
test/e2e.gitlab.sh
0 → 100755
View file @
1e7d2d7b
#!/bin/bash
#
# Make sure the Kind local registry works as expected.
set
-ex
cd
$(
dirname
$0
)
cd
../container
make all
kind load docker-image varnish-ingress/varnish
kind load docker-image varnish-ingress/controller
../test/e2e.sh
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