Skip to content

Commit

Permalink
Merge pull request #28 from quickwit-oss/fmassot--add-control-plane-d…
Browse files Browse the repository at this point in the history
…eployment

Add control plane deployment.
  • Loading branch information
fmassot authored Mar 17, 2023
2 parents 92e89c5 + adb134e commit f90cd99
Show file tree
Hide file tree
Showing 7 changed files with 163 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/quickwit/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: quickwit
description: Open-Source & Cloud-Native Log Management at any scale.
type: application
version: 0.2.0
version: 0.2.1
appVersion: "v0.4.0"
keywords:
- quickwit
Expand Down
8 changes: 8 additions & 0 deletions charts/quickwit/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ Metastore Selector labels
app.kubernetes.io/component: metastore
{{- end }}

{{/*
Control Plane Selector labels
*/}}
{{- define "quickwit.control_plane.selectorLabels" -}}
{{ include "quickwit.selectorLabels" . }}
app.kubernetes.io/component: control-plane
{{- end }}

{{/*
Indexer Selector labels
*/}}
Expand Down
82 changes: 82 additions & 0 deletions charts/quickwit/templates/control-plane-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{{- if .Values.control_plane.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "quickwit.fullname" . }}-control-plane
labels:
{{- include "quickwit.labels" . | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "quickwit.control_plane.selectorLabels" . | nindent 6 }}
strategy:
{{- toYaml .Values.control_plane.updateStrategy | nindent 4 }}
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "quickwit.control_plane.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "quickwit.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: ["run", "--service", "control_plane"]
env:
{{- include "quickwit.environment" . | nindent 12 }}
{{- range $key, $value := .Values.control_plane.extraEnv }}
- name: "{{ $key }}"
value: "{{ $value }}"
{{- end }}
ports:
{{- include "quickwit.ports" . | nindent 12 }}
startupProbe:
{{- toYaml .Values.control_plane.startupProbe | nindent 12 }}
livenessProbe:
{{- toYaml .Values.control_plane.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .Values.control_plane.readinessProbe | nindent 12 }}
volumeMounts:
- name: config
mountPath: /quickwit/node.yaml
subPath: node.yaml
- name: data
mountPath: /quickwit/qwdata
resources:
{{- toYaml .Values.control_plane.resources | nindent 14 }}
volumes:
- name: config
configMap:
name: {{ template "quickwit.fullname" . }}
items:
- key: node.yaml
path: node.yaml
- name: data
emptyDir: {}
{{- with .Values.control_plane.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.control_plane.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.control_plane.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
4 changes: 3 additions & 1 deletion charts/quickwit/templates/job-create-indices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ spec:
{{- toYaml $.Values.securityContext | nindent 10 }}
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag | default $.Chart.AppVersion }}"
imagePullPolicy: {{ $.Values.image.pullPolicy }}
command: ["/bin/bash","-c","quickwit index describe --index {{ .index_id }} || quickwit index create --index-config {{ .index_id }}.yaml "]
command: ["/bin/bash","-c","quickwit index describe --index {{ .index_id }} --endpoint ${QW_CLUSTER_ENDPOINT} || quickwit index create --index-config {{ .index_id }}.yaml --endpoint ${QW_CLUSTER_ENDPOINT}"]
env:
- name: QW_CLUSTER_ENDPOINT
value: http://{{ include "quickwit.fullname" $ }}-metastore.{{ $.Release.Namespace }}.svc.cluster.local:7280
{{- include "quickwit.metastore.environment" $ | nindent 10 }}
{{- range $key, $value := $.Values.bootstrap.extraEnv }}
- name: "{{ $key }}"
Expand Down
4 changes: 3 additions & 1 deletion charts/quickwit/templates/job-create-sources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ spec:
{{- toYaml $.Values.securityContext | nindent 10 }}
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag | default $.Chart.AppVersion }}"
imagePullPolicy: {{ $.Values.image.pullPolicy }}
command: ["/bin/bash","-c","quickwit source describe --index {{ .index }} --source {{ .source.source_id }} || quickwit source create --index {{ .index }} --source-config {{ .source.source_id }}.yaml"]
command: ["/bin/bash","-c","quickwit source describe --index {{ .index }} --source {{ .source.source_id }} --endpoint ${QW_CLUSTER_ENDPOINT}|| quickwit source create --index {{ .index }} --source-config {{ .source.source_id }}.yaml --endpoint ${QW_CLUSTER_ENDPOINT}"]
env:
- name: QW_CLUSTER_ENDPOINT
value: http://{{ include "quickwit.fullname" $ }}-metastore.{{ $.Release.Namespace }}.svc.cluster.local:7280
{{- include "quickwit.metastore.environment" $ | nindent 10 }}
{{- range $key, $value := $.Values.bootstrap.extraEnv }}
- name: "{{ $key }}"
Expand Down
23 changes: 21 additions & 2 deletions charts/quickwit/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
name: rest
- port: 7281
targetPort: grpc
name: grpc
name: grpc
selector:
{{- include "quickwit.searcher.selectorLabels" . | nindent 4 }}
---
Expand Down Expand Up @@ -49,7 +49,26 @@ spec:
name: rest
- port: 7281
targetPort: grpc
name: grpc
name: grpc
selector:
{{- include "quickwit.indexer.selectorLabels" . | nindent 4 }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "quickwit.fullname" . }}-metastore
labels:
{{- include "quickwit.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: 7280
targetPort: rest
protocol: TCP
name: rest
- port: 7281
targetPort: grpc
name: grpc
selector:
{{- include "quickwit.metastore.selectorLabels" . | nindent 4 }}

45 changes: 45 additions & 0 deletions charts/quickwit/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,51 @@ metastore:

affinity: {}

control_plane:
replicaCount: 1

# Extra env for controle plane
extraEnv: {}
# KEY: VALUE

resources: {}
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

## Pod distruption budget
podDisruptionBudget: {}
# maxUnavailable: 1
# minAvailable: 2

updateStrategy: {}
# type: RollingUpdate

startupProbe:
httpGet:
path: /health/livez
port: rest
failureThreshold: 12
periodSeconds: 5

livenessProbe:
httpGet:
path: /health/livez
port: rest

readinessProbe:
httpGet:
path: /health/readyz
port: rest

nodeSelector: {}

tolerations: []

affinity: {}

janitor:
# Enable Janitor service
Expand Down

0 comments on commit f90cd99

Please sign in to comment.