Skip to content

Commit

Permalink
fix: helm name (#780)
Browse files Browse the repository at this point in the history
* fix: helm name

* docs: mark s3 & minIO deprecated
  • Loading branch information
hengfeiyang committed Feb 24, 2023
1 parent bce72e4 commit 4dbba50
Show file tree
Hide file tree
Showing 16 changed files with 66 additions and 66 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -38,7 +38,7 @@ Note: Do not store sensitive data on this server as its available to everyone on
4. Compatibility with Elasticsearch APIs for ingestion of data (single record and bulk API)
5. Out of the box authentication
6. Schema less - No need to define schema upfront and different documents in the same index can have different fields.
7. Index storage in disk (default), s3 or minio (experimental)
7. Index storage in disk (default), s3 or minio (deprecated)
8. aggregation support

# How to get support
Expand Down
8 changes: 0 additions & 8 deletions helm/zinc/Chart.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions helm/zinc/templates/tests/test-connection.yaml

This file was deleted.

File renamed without changes.
8 changes: 8 additions & 0 deletions helm/zincsearch/Chart.yaml
@@ -0,0 +1,8 @@
apiVersion: v2
name: zincsearch
description: ZincSearch is a search engine that does full text indexing. It is a lightweight alternative to Elasticsearch and runs in less than 100 MB of RAM.
type: application
version: 0.1.0
appVersion: v0.4.0
sources:
- https://github.com/zinclabs/zincsearch
Expand Up @@ -6,16 +6,16 @@
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "zinc.fullname" . }})
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "zincsearch.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "zinc.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "zinc.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "zincsearch.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "zincsearch.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "zinc.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "zincsearch.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
Expand Down
@@ -1,7 +1,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "zinc.name" -}}
{{- define "zincsearch.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

Expand All @@ -10,7 +10,7 @@ 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 "zinc.fullname" -}}
{{- define "zincsearch.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "zinc.chart" -}}
{{- define "zincsearch.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "zinc.labels" -}}
helm.sh/chart: {{ include "zinc.chart" . }}
{{ include "zinc.selectorLabels" . }}
{{- define "zincsearch.labels" -}}
helm.sh/chart: {{ include "zincsearch.chart" . }}
{{ include "zincsearch.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "zinc.selectorLabels" -}}
app.kubernetes.io/name: {{ include "zinc.name" . }}
{{- define "zincsearch.selectorLabels" -}}
app.kubernetes.io/name: {{ include "zincsearch.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "zinc.serviceAccountName" -}}
{{- define "zincsearch.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "zinc.fullname" .) .Values.serviceAccount.name }}
{{- default (include "zincsearch.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
Expand Down
@@ -1,5 +1,5 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "zinc.fullname" . -}}
{{- $fullName := include "zincsearch.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
Expand All @@ -17,7 +17,7 @@ kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "zinc.labels" . | nindent 4 }}
{{- include "zincsearch.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ include "zinc.fullname" . }}
name: {{ include "zincsearch.fullname" . }}
labels:
{{- include "zinc.labels" . | nindent 4 }}
{{- include "zincsearch.labels" . | nindent 4 }}
type: Opaque
stringData:
username: "{{ .Values.auth.username }}"
Expand Down
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "zinc.fullname" . }}-headless
name: {{ include "zincsearch.fullname" . }}-headless
labels:
{{- include "zinc.labels" . | nindent 4 }}
{{- include "zincsearch.labels" . | nindent 4 }}
spec:
clusterIP: None
ports:
Expand All @@ -12,4 +12,4 @@ spec:
protocol: TCP
name: http
selector:
{{- include "zinc.selectorLabels" . | nindent 4 }}
{{- include "zincsearch.selectorLabels" . | nindent 4 }}
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "zinc.fullname" . }}
name: {{ include "zincsearch.fullname" . }}
labels:
{{- include "zinc.labels" . | nindent 4 }}
{{- include "zincsearch.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
Expand All @@ -12,4 +12,4 @@ spec:
protocol: TCP
name: http
selector:
{{- include "zinc.selectorLabels" . | nindent 4 }}
{{- include "zincsearch.selectorLabels" . | nindent 4 }}
Expand Up @@ -2,9 +2,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "zinc.serviceAccountName" . }}
name: {{ include "zincsearch.serviceAccountName" . }}
labels:
{{- include "zinc.labels" . | nindent 4 }}
{{- include "zincsearch.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
@@ -1,38 +1,38 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "zinc.fullname" . }}
name: {{ include "zincsearch.fullname" . }}
labels:
{{- include "zinc.labels" . | nindent 4 }}
{{- include "zincsearch.labels" . | nindent 4 }}
spec:
serviceName: {{ include "zinc.fullname" . }}-headless
# Until Zinc is not HA
serviceName: {{ include "zincsearch.fullname" . }}-headless
# Until zincsearch is not HA
replicas: 1
selector:
matchLabels:
{{- include "zinc.selectorLabels" . | nindent 6 }}
{{- include "zincsearch.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "zinc.selectorLabels" . | nindent 8 }}
{{- include "zincsearch.selectorLabels" . | nindent 8 }}
spec:
securityContext:
{{- toYaml .Values.securityContext | nindent 8 }}
containers:
- name: zinc
- name: zincsearch
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: ZINC_FIRST_ADMIN_USER
valueFrom:
secretKeyRef:
key: "username"
name: {{ include "zinc.fullname" . }}
name: {{ include "zincsearch.fullname" . }}
- name: ZINC_FIRST_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
key: "password"
name: {{ include "zinc.fullname" . }}
name: {{ include "zincsearch.fullname" . }}
- name: ZINC_DATA_PATH
value: /go/bin/data
# command: ["/bin/bash", "-c", "while true; do sleep 1; done"]
Expand Down
15 changes: 15 additions & 0 deletions helm/zincsearch/templates/tests/test-connection.yaml
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "zincsearch.fullname" . }}-test-connection"
labels:
{{- include "zincsearch.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "zincsearch.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never
12 changes: 6 additions & 6 deletions helm/zinc/values.yaml → helm/zincsearch/values.yaml
@@ -1,4 +1,4 @@
# Default values for Zinc.
# Default values for ZincSearch.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

Expand All @@ -9,7 +9,7 @@ image:
tag: "latest"

imagePullSecrets: []
fullnameOverride: "zinc"
fullnameOverride: "zincsearch"

serviceAccount:
# Specifies whether a service account should be created
Expand All @@ -26,11 +26,11 @@ auth:
password: "Complexpass#123"

persistence:
# Enable Zinc data persistence using PVC, otherwise empty-dir is used
# Enable ZincSearch data persistence using PVC, otherwise empty-dir is used
enabled: true
# PVC Storage Class for Zinc data volume, if empty - default storage class is used
# PVC Storage Class for ZincSearch data volume, if empty - default storage class is used
storageClass: ""
# PVC Storage Request for Zinc data volume
# PVC Storage Request for ZincSearch data volume
size: "10Gi"

securityContext:
Expand All @@ -50,7 +50,7 @@ ingress:
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: zinc.example.local
- host: zincsearch.example.local
paths:
- /
tls: []
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/index/AddUpdateIndex.vue
Expand Up @@ -156,7 +156,7 @@ export default defineComponent({
const disableColor = ref("");
const disableBtn = ref(false);
const indexData = ref(defaultValue());
const storageTypes = ["disk", "s3", "minio"];
const storageTypes = ["disk"];
return {
step: ref(1),
Expand Down

0 comments on commit 4dbba50

Please sign in to comment.