Skip to content

Commit fa7656a

Browse files
authored
ci: add local gitlab at localhost:8080 (#24)
* ci: add gitlab local support * ci: add gitlab local support * ci: add gitlab local support * ci: fix e2e test
1 parent 7f09e56 commit fa7656a

File tree

6 files changed

+103
-1
lines changed

6 files changed

+103
-1
lines changed

gitlab.values.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
gitlab:
2+
toolbox:
3+
enabled: false
4+
gitlab-shell:
5+
enabled: false
6+
gitlab-pages:
7+
enabled: false
8+
gitlab-exporter:
9+
enabled: false
10+
kas:
11+
minReplicas: 1
12+
webservice:
13+
minReplicas: 1
14+
ingress:
15+
requireBasePath: false
16+
global:
17+
hosts:
18+
domain: localhost
19+
https: false
20+
gitlab:
21+
name: localhost
22+
https: false
23+
ingress:
24+
enabled: true
25+
configureCertmanager: false
26+
tls:
27+
enabled: false
28+
redis:
29+
install: false
30+
traefik:
31+
enabled: false
32+
gitlab-runner:
33+
install: false
34+
registry:
35+
enabled: false
36+
prometheus:
37+
install: false
38+
certmanager:
39+
installCRDs: false
40+
install: false
41+
42+
nginx-ingress:
43+
controller:
44+
ingressClassResource:
45+
name: gitlab-nginx
46+
controllerValue: "k8s.io/ingress-nginx-gitlab"
47+
replicaCount: 1
48+
minAavailable: 1
49+
service:
50+
type: NodePort
51+
nodePorts:
52+
http: 32080

makefile

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ init-argo-workflows: init-kind
3434
init-piper: init-kind local-build
3535
sh ./scripts/init-piper.sh
3636

37+
.PHONY: init-gitlab
38+
init-gitlab: init-kind
39+
sh ./scripts/init-gitlab.sh
40+
3741
.PHONY: deploy
3842
deploy: init-kind init-nginx init-argo-workflows local-build local-push init-piper
3943

scripts/init-argo-workflows.sh

+29
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,32 @@ if [ -z "$(helm list -n workflows | grep argo-workflow)" ]; then
88
else
99
echo "Workflows release exists, skipping installation"
1010
fi
11+
12+
13+
cat <<EOF | kubectl apply -n workflows -f -
14+
apiVersion: v1
15+
kind: ServiceAccount
16+
metadata:
17+
name: argo-workflows-sa
18+
automountServiceAccountToken: true
19+
---
20+
apiVersion: v1
21+
kind: Secret
22+
metadata:
23+
name: argo-workflows-sa.service-account-token
24+
annotations:
25+
kubernetes.io/service-account.name: argo-workflows-sa
26+
type: kubernetes.io/service-account-token
27+
---
28+
apiVersion: rbac.authorization.k8s.io/v1
29+
kind: RoleBinding
30+
metadata:
31+
name: argo-workflows-sa
32+
roleRef:
33+
apiGroup: rbac.authorization.k8s.io
34+
kind: Role
35+
name: argo-workflow-argo-workflows-workflow
36+
subjects:
37+
- kind: ServiceAccount
38+
name: argo-workflows-sa
39+
EOF

scripts/init-gitlab.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
set -o errexit
3+
4+
if [ -z "$(helm list -n gitlab | grep gitlab)" ]; then
5+
# 8. Install gitlab
6+
helm repo add gitlab https://charts.gitlab.io/
7+
helm upgrade --install gitlab --create-namespace -n gitlab gitlab/gitlab -f gitlab.values.yaml
8+
else
9+
echo "Gitlab release exists, skipping installation"
10+
fi

scripts/init-kind.sh

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ nodes:
3131
- containerPort: 443
3232
hostPort: 443
3333
protocol: TCP
34+
- containerPort: 32080
35+
hostPort: 8080
36+
listenAddress: "0.0.0.0"
3437
containerdConfigPatches:
3538
- |-
3639
[plugins."io.containerd.grpc.v1.cri".registry]

workflows.values.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
controller:
22
workflowNamespaces:
33
- workflows
4+
workflowDefaults:
5+
spec:
6+
serviceAccountName: argo-workflows-sa
47
server:
58
baseHref: /argo/
69
serviceAccount:
@@ -15,4 +18,5 @@ server:
1518
nginx.ingress.kubernetes.io/backend-protocol: HTTP
1619
paths:
1720
- /argo/(.*)
18-
- /argo
21+
- /argo
22+
pathType: ImplementationSpecific

0 commit comments

Comments
 (0)