Added YaCy chart

This commit is contained in:
Ultradesu
2026-02-04 14:34:08 +02:00
commit 9bb0855939
17 changed files with 1194 additions and 0 deletions

76
yacy/templates/NOTES.txt Normal file
View File

@@ -0,0 +1,76 @@
╔════════════════════════════════════════════════════════════════╗
║ YaCy Search Server Deployed! ║
╚════════════════════════════════════════════════════════════════╝
Thank you for installing {{ .Chart.Name }} v{{ .Chart.Version }}.
YaCy is a decentralized search engine that can be used for both public P2P search
and private intranet search scenarios.
GETTING STARTED
==============================================================================
1. Access YaCy Interface:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "yacy.fullname" . }}
# Then access:
http://<any-node-ip>:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
# It may take a few minutes for the LoadBalancer IP to be available
kubectl get --namespace {{ .Release.Namespace }} svc {{ include "yacy.fullname" . }}
# Then access:
http://<EXTERNAL-IP>:{{ .Values.service.httpPort }}
{{- else if contains "ClusterIP" .Values.service.type }}
# Port forward to access YaCy (for development/testing):
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "yacy.fullname" . }} 8090:{{ .Values.service.httpPort }}
# Then access:
http://127.0.0.1:8090
{{- end }}
2. Login using these credentials:
• Username: admin
• Password: {{ .Values.yacy.adminPassword | default "yacy" }}
IMPORTANT: Change the default password via ConfigAccounts_p.html
3. Check deployment status:
kubectl get pods -n {{ .Release.Namespace }} -l "app.kubernetes.io/instance={{ .Release.Name }}"
DATA PERSISTENCE
==============================================================================
{{- if .Values.persistence.enabled }}
• YaCy data is stored in a persistent volume:
- PVC: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ include "yacy.fullname" . }}-data{{- end }}
- Size: {{ .Values.persistence.size }}
- Mode: {{ .Values.persistence.accessMode }}
{{- else }}
• WARNING: Persistence is disabled! Data will be lost when pods are terminated.
To enable persistence, set persistence.enabled=true
{{- end }}
IMPORTANT NOTES
==============================================================================
{{- if eq (.Values.replicaCount | int) 1 }}
• YaCy is running with a single replica.
For production environments, consider enabling:
- Multiple replicas with proper shared storage
- Ingress with TLS
- Resource limits appropriate for your workload
{{- else }}
• YaCy is running with {{ .Values.replicaCount }} replicas.
{{- end }}
RESOURCES
==============================================================================
• Documentation: https://yacy.net/
• Community: https://community.searchlab.eu/
• Support: https://github.com/yacy/yacy_search_server/issues
• Helm Chart README: See charts/README.md

View File

@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "yacy.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 "yacy.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 "yacy.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "yacy.labels" -}}
helm.sh/chart: {{ include "yacy.chart" . }}
{{ include "yacy.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "yacy.selectorLabels" -}}
app.kubernetes.io/name: {{ include "yacy.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "yacy.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "yacy.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,11 @@
{{- if .Values.yacy.configFile }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "yacy.fullname" . }}-config
labels:
{{- include "yacy.labels" . | nindent 4 }}
data:
yacy.conf: |-
{{- .Values.yacy.configFile | nindent 4 }}
{{- end }}

View File

@@ -0,0 +1,122 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "yacy.fullname" . }}
labels:
{{- include "yacy.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "yacy.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "yacy.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "yacy.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- if .Values.image.useLocal }}
image: "{{ .Values.image.localRepository }}:{{ .Values.image.localTag }}"
imagePullPolicy: Never
{{- else }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- end }}
env:
- name: YACY_ADMINACCOUNT_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "yacy.fullname" . }}
key: admin-password
{{- range $key, $value := .Values.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
{{- if .Values.yacy.settings.maxMemory }}
- name: YACY_JAVASTART_XMXMINIT
value: {{ .Values.yacy.settings.maxMemory | quote }}
{{- end }}
{{- if (not .Values.yacy.settings.joinP2PNetwork) }}
- name: YACY_NETWORK_UNIT_INTRANET
value: "true"
{{- end }}
ports:
- name: http
containerPort: 8090
protocol: TCP
- name: https
containerPort: 8443
protocol: TCP
startupProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 12
livenessProbe:
httpGet:
path: /api/status_p.xml
port: http
initialDelaySeconds: 90
periodSeconds: 20
timeoutSeconds: 10
failureThreshold: 6
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: data
mountPath: /opt/yacy_search_server/DATA
{{- if .Values.yacy.configFile }}
- name: config
mountPath: /opt/yacy_search_server/defaults/yacy.conf
subPath: yacy.conf
{{- end }}
volumes:
- name: data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ include "yacy.fullname" . }}-data{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
{{- if .Values.yacy.configFile }}
- name: config
configMap:
name: {{ include "yacy.fullname" . }}-config
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

32
yacy/templates/hpa.yaml Normal file
View File

@@ -0,0 +1,32 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "yacy.fullname" . }}
labels:
{{- include "yacy.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "yacy.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,61 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "yacy.fullname" . -}}
{{- $svcPort := .Values.service.httpPort -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "yacy.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,26 @@
{{- if .Values.networkPolicy.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ include "yacy.fullname" . }}
labels:
{{- include "yacy.labels" . | nindent 4 }}
spec:
podSelector:
matchLabels:
{{- include "yacy.selectorLabels" . | nindent 6 }}
policyTypes:
- Ingress
ingress:
- from:
{{- if .Values.networkPolicy.ingressFrom }}
{{- toYaml .Values.networkPolicy.ingressFrom | nindent 8 }}
{{- else }}
- podSelector: {} # Allow from all pods in the same namespace
{{- end }}
ports:
- protocol: TCP
port: 8090
- protocol: TCP
port: 8443
{{- end }}

13
yacy/templates/pdb.yaml Normal file
View File

@@ -0,0 +1,13 @@
{{- if gt .Values.replicaCount 1.0 }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "yacy.fullname" . }}
labels:
{{- include "yacy.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "yacy.selectorLabels" . | nindent 6 }}
minAvailable: 1
{{- end }}

25
yacy/templates/pvc.yaml Normal file
View File

@@ -0,0 +1,25 @@
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ include "yacy.fullname" . }}-data
labels:
{{- include "yacy.labels" . | nindent 4 }}
{{- with .Values.persistence.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- if .Values.persistence.storageClass }}
{{- if (eq "-" .Values.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.storageClass }}"
{{- end }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,13 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ include "yacy.fullname" . }}
labels:
{{- include "yacy.labels" . | nindent 4 }}
type: Opaque
data:
{{- if .Values.yacy.adminPassword }}
admin-password: {{ .Values.yacy.adminPassword | b64enc | quote }}
{{- else }}
admin-password: {{ "yacy" | b64enc | quote }}
{{- end }}

View File

@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "yacy.fullname" . }}
labels:
{{- include "yacy.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.httpPort }}
targetPort: http
protocol: TCP
name: http
- port: {{ .Values.service.httpsPort }}
targetPort: https
protocol: TCP
name: https
selector:
{{- include "yacy.selectorLabels" . | nindent 4 }}

View File

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

View File

@@ -0,0 +1,26 @@
{{- if .Values.metrics.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "yacy.fullname" . }}
{{- if .Values.metrics.serviceMonitor.namespace }}
namespace: {{ .Values.metrics.serviceMonitor.namespace }}
{{- end }}
labels:
{{- include "yacy.labels" . | nindent 4 }}
{{- with .Values.metrics.serviceMonitor.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: http
path: {{ .Values.metrics.path }}
interval: {{ .Values.metrics.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "yacy.selectorLabels" . | nindent 6 }}
{{- end }}