Removing gitlab submodule charts/gitlab/gitlab/charts/gitlab-zoekt

pull/771/head
Nefi Munoz 2023-05-30 08:48:50 -06:00
parent dcf16e91d7
commit c8b7f4790f
14 changed files with 0 additions and 532 deletions

View File

@ -1 +0,0 @@
.DS_Store

View File

@ -1,54 +0,0 @@
include:
- template: Workflows/MergeRequest-Pipelines.gitlab-ci.yml
stages:
- test
- publish
variables:
HELM_INSTALL_IMAGE: registry.gitlab.com/gitlab-org/cluster-integration/helm-install-image:helm-3.10.2-kube-1.24.8-alpine-3.15
lint:helm:
image: $HELM_INSTALL_IMAGE
script:
- helm lint
publish:
stage: publish
script:
- chart_clone_subpath=${CI_PROJECT_PATH#"gitlab-org/"} # Strip leading gitlab-org/
- curl --request POST
--form "token=${CHARTS_TRIGGER_TOKEN}"
--form ref=master
--form "variables[CHART_NAME]=${CI_PROJECT_NAME}"
--form "variables[RELEASE_REF]=${CI_COMMIT_REF_NAME}"
--form "variables[CHART_CLONE_SUBPATH]=${chart_clone_subpath}"
https://gitlab.com/api/v4/projects/2860651/trigger/pipeline
rules:
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$/ && $CI_PROJECT_URL == "https://gitlab.com/gitlab-org/cloud-native/charts/gitlab-zoekt"'
test:install:
extends: .k3s
script:
- helm install gitlab-zoekt . --wait
- kubectl exec gitlab-zoekt-0 -- curl --fail -XPOST -d '{"CloneUrl":"https://gitlab.com/gitlab-org/gitlab-development-kit.git","RepoId":74823}' 'http://127.0.0.1:6060/index' | tee /dev/stderr | grep '"Success":true'
- kubectl exec gitlab-zoekt-0 -- curl --fail -XPOST -d '{"Q":"gitaly"}' 'http://127.0.0.1:6070/api/search' | tee /dev/stderr | grep "LineStart" # Some random thing that should appear when there are results
test:upgrade:
extends: .k3s
script:
- helm install gitlab-zoekt . --wait
- helm upgrade gitlab-zoekt . --wait --reuse-values
.k3s:
stage: test
image: $HELM_INSTALL_IMAGE
services:
- name: registry.gitlab.com/gitlab-org/cluster-integration/test-utils/k3s-gitlab-ci/releases/v1.26.0-k3s1
alias: k3s
before_script:
- apk add -u curl
- curl -f k3s:8081 > k3s.yaml
- export KUBECONFIG=$(pwd)/k3s.yaml
- kubectl version
- kubectl cluster-info

View File

@ -1,6 +0,0 @@
apiVersion: v2
appVersion: 0.0.1
description: A Helm chart for deploying Zoekt as a search engine for GitLab
name: gitlab-zoekt
type: application
version: 0.3.0

View File

@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2018-2019 GitLab B.V.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -1,15 +0,0 @@
# GitLab Zoekt Helm Chart
For deploying Zoekt as a code search engine to support [GitLab exact code search](https://docs.gitlab.com/ee/user/search/exact_code_search.html).
## Install the chart
```
helm install gitlab-zoekt .
```
## Enable Lefthook
```shell
lefthook install
```

View File

@ -1,6 +0,0 @@
pre-push:
parallel: true
commands:
helm_lint:
files: git diff --name-only --diff-filter=d $(git merge-base origin/main HEAD)..HEAD
run: helm lint

View File

@ -1,23 +0,0 @@
1. Index a repo:
```
kubectl exec gitlab-zoekt-0 -- curl -XPOST -d '{"CloneUrl":"https://gitlab.com/gitlab-org/gitlab-development-kit.git","RepoId":74823}' 'http://127.0.0.1:6060/index'
```
2. Search:
```
kubectl exec gitlab-zoekt-0 -- curl -XPOST -d '{"Q":"gitaly"}' 'http://127.0.0.1:6070/api/search'
```
3. Services are exposed for port 6060 (indexserver), 6070 (webserver) for each replica (where the replica number is part of the DNS name) so you can connect from any other pod to index and search:
```
kubectl exec <some-pod> -- curl -XPOST -d '{"Q":"gitaly"}' 'http://gitlab-zoekt-0.gitlab-zoekt.default.svc.cluster.local:6070/api/search'
```
{{- if .Values.ingress.enabled }}
4. Get the IP of the ingress by running these commands:
```
kubectl get ingress gitlab-zoekt
```
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
5. Then do a search via the Ingress
```
curl -H 'Host: gitlab-zoekt.local' -XPOST -d '{"Q":"gitaly"}' 'http://<IP_ADDRESS>/api/search'
```
{{- end }}

View File

@ -1,73 +0,0 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "gitlab-zoekt.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "gitlab-zoekt.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "gitlab-zoekt.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "gitlab-zoekt.labels" -}}
helm.sh/chart: {{ include "gitlab-zoekt.chart" . }}
{{ include "gitlab-zoekt.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "gitlab-zoekt.selectorLabels" -}}
app.kubernetes.io/name: {{ include "gitlab-zoekt.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "gitlab-zoekt.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "gitlab-zoekt.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{/*
Placeholder label definitions.
These are overridden when this chart is used as a sub-chart of gitlab/gitlab
*/}}
{{- define "gitlab.standardLabels" -}}
{{- end -}}
{{- define "gitlab.commonLabels" -}}
{{- end -}}
{{- define "gitlab.serviceLabels" -}}
{{- end -}}

View File

@ -1,47 +0,0 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "gitlab-zoekt.fullname" . -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "gitlab-zoekt.labels" . | nindent 4 }}
{{- include "gitlab.standardLabels" . | nindent 4 }}
{{- include "gitlab.commonLabels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
- host: {{ .Values.ingress.host | quote }}
http:
paths:
- path: /api
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
number: {{ .Values.webserver.listen.port }}
- path: /
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
number: {{ .Values.dynamicIndexserver.listen.port }}
{{- end }}

View File

@ -1,31 +0,0 @@
{{- if .Values.networkpolicy.enabled -}}
{{- $fullName := include "gitlab-zoekt.fullname" . -}}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ $fullName }}
namespace: {{ $.Release.Namespace }}
labels:
{{- include "gitlab-zoekt.labels" . | nindent 4 }}
annotations:
{{ toYaml .Values.networkpolicy.annotations | nindent 4 }}
spec:
podSelector:
matchLabels:
{{- include "gitlab-zoekt.selectorLabels" . | nindent 6 }}
policyTypes:
{{- if .Values.networkpolicy.egress.enabled }}
- Egress
{{- end }}
{{- if .Values.networkpolicy.ingress.enabled }}
- Ingress
{{- end }}
{{- if .Values.networkpolicy.ingress.enabled }}
ingress:
{{ toYaml .Values.networkpolicy.ingress.rules | nindent 4 }}
{{- end -}}
{{- if .Values.networkpolicy.egress.enabled }}
egress:
{{ toYaml .Values.networkpolicy.egress.rules | nindent 4 }}
{{- end -}}
{{- end -}}

View File

@ -1,28 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "gitlab-zoekt.fullname" . }}
labels:
{{- include "gitlab-zoekt.labels" . | nindent 4 }}
{{- include "gitlab.standardLabels" . | nindent 4 }}
{{- include "gitlab.commonLabels" . | nindent 4 }}
{{- include "gitlab.serviceLabels" . | nindent 4 }}
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.service.type }}
{{- if (and (eq .Values.service.type "ClusterIP") (not (empty .Values.service.clusterIP))) }}
clusterIP: {{ .Values.service.clusterIP }}
{{- end }}
{{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }}
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
{{- end }}
ports:
- port: {{ .Values.webserver.listen.port }}
name: webserver
- port: {{ .Values.dynamicIndexserver.listen.port }}
name: indexserver
selector:
{{- include "gitlab-zoekt.selectorLabels" . | nindent 4 }}

View File

@ -1,14 +0,0 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "gitlab-zoekt.serviceAccountName" . }}
labels:
{{- include "gitlab-zoekt.labels" . | nindent 4 }}
{{- include "gitlab.standardLabels" . | nindent 4 }}
{{- include "gitlab.commonLabels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

View File

@ -1,105 +0,0 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "gitlab-zoekt.fullname" . }}
labels:
{{- include "gitlab-zoekt.labels" . | nindent 4 }}
{{- include "gitlab.standardLabels" . | nindent 4 }}
{{- include "gitlab.commonLabels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "gitlab-zoekt.selectorLabels" . | nindent 6 }}
serviceName: {{ include "gitlab-zoekt.fullname" . }}
replicas: 1 # See https://gitlab.com/gitlab-org/gitlab-build-images/-/issues/118
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "gitlab-zoekt.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "gitlab-zoekt.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
terminationGracePeriodSeconds: 60
containers:
- name: zoekt-dynamic-indexserver
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: {{ .Values.dynamicIndexserver.image.repository }}:{{ .Values.dynamicIndexserver.image.tag | default "latest" }}
imagePullPolicy: {{ coalesce .Values.dynamicIndexserver.image.pullPolicy .Values.image.pullPolicy }}
ports:
- containerPort: {{ .Values.dynamicIndexserver.listen.port }}
name: indexserver
livenessProbe:
httpGet:
path: /
port: {{ .Values.dynamicIndexserver.listen.port }}
readinessProbe:
httpGet:
path: /
port: {{ .Values.dynamicIndexserver.listen.port }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: zoekt-data
mountPath: /data/repos
- name: zoekt-index
mountPath: /data/index
- name: zoekt-webserver
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: {{ .Values.webserver.image.repository }}:{{ .Values.webserver.image.tag | default "latest" }}
imagePullPolicy: {{ coalesce .Values.webserver.image.pullPolicy .Values.image.pullPolicy }}
ports:
- containerPort: {{ .Values.webserver.listen.port }}
name: webserver
livenessProbe:
httpGet:
path: /
port: {{ .Values.webserver.listen.port }}
readinessProbe:
httpGet:
path: /
port: {{ .Values.webserver.listen.port }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: zoekt-index
mountPath: /data/index
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumeClaimTemplates:
- metadata:
name: zoekt-data
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ .Values.bareRepoStorageClassName }}
resources:
requests:
storage: {{ .Values.bareRepoStorage }}
- metadata:
name: zoekt-index
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ .Values.indexStorageClassName }}
resources:
requests:
storage: {{ .Values.indexStorage }}

View File

@ -1,108 +0,0 @@
# -- The size of storage mounted to the zoekt-dynamic-indexserver that will be used to store bare repos.<br>
# The bare repos are stored as an intermediate step in calculating the
# resulting index and treated like a cache as they will be refetched if
# missing.
# @raw
bareRepoStorage: 5Gi
bareRepoStorageClassName: ""
# -- The size of storage mounted to the zoekt-dynamic-indexserver and zoekt-webserver that will be used to store index files.<br>
# The index files are those with the `.zoekt` extension and used to serve
# search results.
# @raw
indexStorage: 2Gi
indexStorageClassName: ""
image:
pullPolicy: IfNotPresent
dynamicIndexserver:
image:
repository: registry.gitlab.com/gitlab-org/build/cng/gitlab-zoekt-dynamic-indexserver
tag: v0.0.1-5f25b
# pullPolicy:
listen:
port: 6060
webserver:
image:
repository: registry.gitlab.com/gitlab-org/build/cng/gitlab-zoekt-webserver
tag: v0.0.1-5f25b
# pullPolicy:
listen:
port: 6070
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
podAnnotations: {}
podSecurityContext:
fsGroup: 1000
securityContext:
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
service:
type: ClusterIP
clusterIP: None
annotations: {}
# cloud.google.com/load-balancer-type: Internal
# networking.gke.io/internal-load-balancer-allow-global-access: "true"
# loadBalancerIP: 123.123.123.123
resources:
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
nodeSelector: {}
tolerations: []
affinity: {}
ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
# kubernetes.io/ingress.regional-static-ip-name: "gitlab-zoekt"
# kubernetes.io/ingress.class: "gce-internal"
host: gitlab-zoekt.local
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
networkpolicy:
enabled: false
egress:
enabled: false
rules: []
ingress:
enabled: false
rules: []
annotations: {}