Skip to content

Commit

Permalink
ci: add local gitlab at localhost:8080 (#24)
Browse files Browse the repository at this point in the history
* ci: add gitlab local support

* ci: add gitlab local support

* ci: add gitlab local support

* ci: fix e2e test
  • Loading branch information
GoshaDo authored Nov 10, 2024
1 parent 7f09e56 commit fa7656a
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 1 deletion.
52 changes: 52 additions & 0 deletions gitlab.values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
gitlab:
toolbox:
enabled: false
gitlab-shell:
enabled: false
gitlab-pages:
enabled: false
gitlab-exporter:
enabled: false
kas:
minReplicas: 1
webservice:
minReplicas: 1
ingress:
requireBasePath: false
global:
hosts:
domain: localhost
https: false
gitlab:
name: localhost
https: false
ingress:
enabled: true
configureCertmanager: false
tls:
enabled: false
redis:
install: false
traefik:
enabled: false
gitlab-runner:
install: false
registry:
enabled: false
prometheus:
install: false
certmanager:
installCRDs: false
install: false

nginx-ingress:
controller:
ingressClassResource:
name: gitlab-nginx
controllerValue: "k8s.io/ingress-nginx-gitlab"
replicaCount: 1
minAavailable: 1
service:
type: NodePort
nodePorts:
http: 32080
4 changes: 4 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ init-argo-workflows: init-kind
init-piper: init-kind local-build
sh ./scripts/init-piper.sh

.PHONY: init-gitlab
init-gitlab: init-kind
sh ./scripts/init-gitlab.sh

.PHONY: deploy
deploy: init-kind init-nginx init-argo-workflows local-build local-push init-piper

Expand Down
29 changes: 29 additions & 0 deletions scripts/init-argo-workflows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,32 @@ if [ -z "$(helm list -n workflows | grep argo-workflow)" ]; then
else
echo "Workflows release exists, skipping installation"
fi


cat <<EOF | kubectl apply -n workflows -f -
apiVersion: v1
kind: ServiceAccount
metadata:
name: argo-workflows-sa
automountServiceAccountToken: true
---
apiVersion: v1
kind: Secret
metadata:
name: argo-workflows-sa.service-account-token
annotations:
kubernetes.io/service-account.name: argo-workflows-sa
type: kubernetes.io/service-account-token
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: argo-workflows-sa
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: argo-workflow-argo-workflows-workflow
subjects:
- kind: ServiceAccount
name: argo-workflows-sa
EOF
10 changes: 10 additions & 0 deletions scripts/init-gitlab.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
set -o errexit

if [ -z "$(helm list -n gitlab | grep gitlab)" ]; then
# 8. Install gitlab
helm repo add gitlab https://charts.gitlab.io/
helm upgrade --install gitlab --create-namespace -n gitlab gitlab/gitlab -f gitlab.values.yaml
else
echo "Gitlab release exists, skipping installation"
fi
3 changes: 3 additions & 0 deletions scripts/init-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ nodes:
- containerPort: 443
hostPort: 443
protocol: TCP
- containerPort: 32080
hostPort: 8080
listenAddress: "0.0.0.0"
containerdConfigPatches:
- |-
[plugins."io.containerd.grpc.v1.cri".registry]
Expand Down
6 changes: 5 additions & 1 deletion workflows.values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
controller:
workflowNamespaces:
- workflows
workflowDefaults:
spec:
serviceAccountName: argo-workflows-sa
server:
baseHref: /argo/
serviceAccount:
Expand All @@ -15,4 +18,5 @@ server:
nginx.ingress.kubernetes.io/backend-protocol: HTTP
paths:
- /argo/(.*)
- /argo
- /argo
pathType: ImplementationSpecific

0 comments on commit fa7656a

Please sign in to comment.