Skip to content

Commit

Permalink
28 upgrade typesense images - take 2 (#31)
Browse files Browse the repository at this point in the history
* bump new images #28

* lowered job history limits, raised ts mem/r #28

* removed config map #28

* removed cm completely #28

* added health and readiness probe, changed selectors #28

* changed sts svc name #28

* fixed labels and nindent #28

* fixed labels and selectors #28

* added health volume and scraper sts endpoint #28

* change nodelist to nodeslist #28

* changed labels and selectors removed readiness probe #28

* removed busybox #28

* added delay to probes #28

* added pod disruption budget #28

* podManagementPolicy back to parallel #28

* remove parallel podManagementPolicy #28

* remove pdb #28

* removed pdb completely #28

* replaced env vars with cmd args #28

* removed liveness probe #28

* bump ts chart image #28
  • Loading branch information
akyriako authored Nov 18, 2024
1 parent e0bb740 commit ac5e242
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 57 deletions.
2 changes: 1 addition & 1 deletion charts/typesense/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.4.0
version: 0.4.1
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
Expand Down
8 changes: 4 additions & 4 deletions charts/typesense/templates/dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ kind: Deployment
metadata:
name: {{ include "typesense.fullname" . }}-dashboard
labels:
app: typesense-dashboard
app: {{ include "typesense.fullname" . }}-dashboard
{{- include "typesense.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.dashboard.replicas }}
selector:
matchLabels:
app: typesense-dashboard
app: {{ include "typesense.fullname" . }}-dashboard
{{- include "typesense.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
app: typesense-dashboard
app: {{ include "typesense.fullname" . }}-dashboard
{{- include "typesense.selectorLabels" . | nindent 8 }}
spec:
containers:
Expand All @@ -31,7 +31,7 @@ metadata:
spec:
type: ClusterIP
selector:
app: typesense-dashboard
app: {{ include "typesense.fullname" . }}-dashboard
{{- include "typesense.selectorLabels" . | nindent 4 }}
ports:
- name: http
Expand Down
8 changes: 4 additions & 4 deletions charts/typesense/templates/reverse-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ kind: Deployment
metadata:
name: {{ include "typesense.fullname" . }}-reverse-proxy
labels:
app: typesense-reverse-proxy
app: {{ include "typesense.fullname" . }}-reverse-proxy
spec:
replicas: {{ .Values.reverseProxy.replicas }}
selector:
matchLabels:
app: typesense-reverse-proxy
app: {{ include "typesense.fullname" . }}-reverse-proxy
template:
metadata:
labels:
app: typesense-reverse-proxy
app: {{ include "typesense.fullname" . }}-reverse-proxy
spec:
containers:
- name: typesense-reverse-proxy
Expand All @@ -60,7 +60,7 @@ metadata:
spec:
type: ClusterIP
selector:
app: typesense-reverse-proxy
app: {{ include "typesense.fullname" . }}-reverse-proxy
ports:
- protocol: TCP
port: 80
Expand Down
2 changes: 1 addition & 1 deletion charts/typesense/templates/scraper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
key: typesense-api-key
name: {{ include "typesense.fullname" . }}-api-keys
- name: TYPESENSE_HOST
value: {{ .Release.Name }}-svc.{{ .Release.Namespace }}.svc.cluster.local
value: {{ .Release.Name }}-sts-resolver.{{ .Release.Namespace }}.svc.cluster.local
- name: TYPESENSE_PORT
value: "8108"
- name: TYPESENSE_PROTOCOL
Expand Down
118 changes: 72 additions & 46 deletions charts/typesense/templates/typesense.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,11 @@ subjects:
name: {{ include "typesense.fullname" . }}-service-account
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "typesense.fullname" . }}-nodeslist
labels:
{{- include "typesense.labels" . | nindent 4 }}
data:
nodes: {{ .Release.Name }}-ts-0.{{ .Release.Name }}-svc.{{ .Release.Namespace }}.svc.cluster.local:8107:8108,{{ .Release.Name }}-ts-1.{{ .Release.Name }}-svc.{{ .Release.Namespace }}.svc.cluster.local:8107:8108,{{ .Release.Name }}-ts-2.{{ .Release.Name }}-svc.{{ .Release.Namespace }}.svc.cluster.local:8107:8108
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "typesense.fullname" . }}-api-keys
labels:
{{- include "typesense.labels" . | nindent 4 }}
{{- include "typesense.labels" . | nindent 4 }}
data:
typesense-api-key: {{ required "typesense.apiKey is required" .Values.typesense.apiKey
| b64enc | quote }}
Expand All @@ -52,66 +43,85 @@ kind: StatefulSet
metadata:
name: {{ include "typesense.fullname" . }}-ts
labels:
app: typesense
app: {{ include "typesense.fullname" . }}-sts
{{- include "typesense.labels" . | nindent 4 }}
spec:
serviceName: {{ include "typesense.fullname" . }}-svc
podManagementPolicy: Parallel
serviceName: {{ include "typesense.fullname" . }}-sts-resolver
# podManagementPolicy: Parallel
# updateStrategy: {}
replicas: 3
selector:
matchLabels:
app: typesense
app: {{ include "typesense.fullname" . }}-sts
template:
metadata:
labels:
app: typesense
app: {{ include "typesense.fullname" . }}-sts
spec:
containers:
- name: peer-resolver
image: quay.io/opentelekomcloud/typesense-peer-resolver:1.0.2
command:
- "/opt/tspr"
- "-namespace={{ .Release.Namespace }}"
- "-service={{ include "typesense.fullname" . }}-sts-resolver"
volumeMounts:
- name: nodeslist
mountPath: /usr/share/typesense
- name: typesense
image: typesense/typesense:27.1
command:
- "/opt/typesense-server"
- "--data-dir"
- "/usr/share/typesense/data"
- "--api-port"
- "8108"
- "--api-address"
- "0.0.0.0"
- "--peering-port"
- "8107"
- "--nodes"
- "/usr/share/typesense/nodes"
- "--enable-cors"
- "--cors-domains"
- "http://{{ .Values.docusaurus.externalUrl }},https://{{ .Values.docusaurus.externalUrl }},https://{{ .Values.reverseProxy.ingress.host }},http://{{ .Values.reverseProxy.ingress.host }}, http://localhost:9089"
- "--reset-peers-on-error"
env:
- name: TYPESENSE_API_KEY
valueFrom:
secretKeyRef:
key: typesense-api-key
name: {{ include "typesense.fullname" . }}-api-keys
- name: TYPESENSE_NODES
value: "/usr/share/typesense/nodes"
- name: TYPESENSE_DATA_DIR
value: "/usr/share/typesense/data"
- name: TYPESENSE_API_PORT
value: "8108"
- name: TYPESENSE_PEERING_PORT
value: "8107"
- name: TYPESENSE_ENABLE_CORS
value: "true"
- name: TYPESENSE_CORS_DOMAINS
value: "http://{{ .Values.docusaurus.externalUrl }},https://{{ .Values.docusaurus.externalUrl }},https://{{ .Values.reverseProxy.ingress.host }},http://{{ .Values.reverseProxy.ingress.host }}, http://localhost:9089"
- name: TYPESENSE_RESET_PEERS_ON_ERROR
value: "true"
ports:
- containerPort: 8108
name: http
protocol: TCP
# livenessProbe:
# httpGet:
# path: /health
# port: http
# initialDelaySeconds: 10
# periodSeconds: 5
# failureThreshold: 2
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 10
periodSeconds: 5
failureThreshold: 2
resources:
limits:
cpu: 1024m
memory: 512Mi
requests:
cpu: 128m
cpu: 256m
memory: 256Mi
volumeMounts:
- mountPath: /usr/share/typesense
name: nodeslist
- mountPath: /usr/share/typesense/data
name: data
- name: peer-resolver
image: quay.io/opentelekomcloud/typesense-peer-resolver:1.0.2
command:
- "/opt/tspr"
- "-namespace={{ .Release.Namespace }}"
- "-service={{ include "typesense.fullname" . }}-svc"
volumeMounts:
- name: nodeslist
mountPath: /usr/share/typesense
- name: data
mountPath: /usr/share/typesense/data
serviceAccountName: {{ include "typesense.fullname" . }}-service-account
securityContext:
fsGroup: 2000
Expand All @@ -122,7 +132,8 @@ spec:
volumes:
- name: nodeslist
emptyDir: {}
updateStrategy: {}
# - name: health
# emptyDir: {}
volumeClaimTemplates:
- metadata:
name: data
Expand All @@ -132,19 +143,34 @@ spec:
resources:
requests:
storage: {{ required "typesense.storage.size is required" .Values.typesense.storage.size }}
storageClassName: {{ required "typesense.storage.className is required" .Values.typesense.storage.className }}
storageClassName: {{ required "typesense.storage.storageClassName is required" .Values.typesense.storage.storageClassName }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "typesense.fullname" . }}-svc
name: {{ include "typesense.fullname" . }}-sts-resolver
labels:
{{- include "typesense.labels" . | nindent 4 }}
{{- include "typesense.labels" . | nindent 4 }}
spec:
clusterIP: None
publishNotReadyAddresses: true
selector:
app: typesense
app: {{ include "typesense.fullname" . }}-sts
ports:
- name: http
port: 8108
targetPort: 8108
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "typesense.fullname" . }}-svc
labels:
{{- include "typesense.labels" . | nindent 4 }}
spec:
type: ClusterIP
selector:
app: {{ include "typesense.fullname" . }}-sts
ports:
- name: http
port: 8108
Expand Down
2 changes: 1 addition & 1 deletion charts/typesense/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
typesense:
apiKey:
storage:
className: csi-disk
storageClassName: csi-disk
size: 40Gi
scraper:
schedule: '*/2 * * * *'
Expand Down

0 comments on commit ac5e242

Please sign in to comment.