Skip to content

Commit

Permalink
Merge pull request #82 from ericvaandering/add_cache_consumer
Browse files Browse the repository at this point in the history
Add a cache-consumer chart
  • Loading branch information
rcarpa authored Jan 11, 2022
2 parents 30b4025 + 5e539ea commit 70dcbcc
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/rucio-daemons/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: rucio-daemons
version: 1.27.2
version: 1.27.3
apiVersion: v1
description: A Helm chart to deploy daemons for Rucio
keywords:
Expand Down
128 changes: 128 additions & 0 deletions charts/rucio-daemons/templates/cache-consumer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{{- if gt .Values.cacheConsumerCount 0.0 -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "rucio.fullname" . }}.config.cache-consumer
labels:
app: {{ template "rucio.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
type: Opaque
data:
{{- $common_config := .Values.config | default dict | mustToPrettyJson | b64enc }}
{{- $component_config := .Values.cacheConsumer.config | default dict | mustToPrettyJson | b64enc }}
rucio.config.common.json: {{ $common_config | quote }}
rucio.config.component.json: {{ $component_config | quote }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-cache-consumer
labels:
app: {{ template "rucio.name" . }}
chart: {{ template "rucio.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.cacheConsumerCount }}
selector:
matchLabels:
app: {{ template "rucio.name" . }}
release: {{ .Release.Name }}
strategy:
type: {{ .Values.strategy.type }}
{{- if eq .Values.strategy.type "RollingUpdate" }}
{{- with .Values.strategy.rollingUpdate }}
rollingUpdate:
{{ toYaml . | trim | indent 6 }}
{{- end }}
{{- end }}
minReadySeconds: {{ .Values.minReadySeconds }}
template:
metadata:
labels:
app: {{ template "rucio.name" . }}
release: {{ .Release.Name }}
rucio-daemon: cache-consumer
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
checksum/config: {{ print "%s%s" $common_config $component_config | sha1sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.cacheConsumer.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if .Values.serviceAccountName }}
serviceAccountName: {{ .Values.serviceAccountName }}
{{- end }}
volumes:
- name: config
secret:
secretName: {{ template "rucio.fullname" . }}.config.cache-consumer
{{- range $key, $val := .Values.additionalSecrets }}
- name: {{ $key }}
secret:
secretName: {{ $.Release.Name }}-{{ $val.secretName }}
{{- end}}
{{- range $key, $val := .Values.persistentVolumes }}
- name: {{ $key }}
persistentVolumeClaim:
claimName: {{ $val.name }}
{{- end}}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: config
mountPath: /opt/rucio/etc/rucio.config.common.json
subPath: rucio.config.common.json
- name: config
mountPath: /opt/rucio/etc/rucio.config.component.json
subPath: rucio.config.component.json
{{- range $key, $val := .Values.additionalSecrets }}
- name: {{ $key }}
mountPath: {{ $val.mountPath }}
subPath: {{ $val.subPath }}
{{- end}}
{{- range $key, $val := .Values.persistentVolumes }}
- name: {{ $key }}
mountPath: {{ $val.mountPath }}
{{- end}}
ports:
- name: metrics
containerPort: 8080
protocol: TCP
env:
{{- range $key1, $val1 := .Values.optional_config }}
- name: {{ $key1 | upper }}
value: "{{ $val1 }}"
{{- end}}
- name: RUCIO_OVERRIDE_CONFIGS
value: "/opt/rucio/etc/rucio.config.common.json /opt/rucio/etc/rucio.config.component.json"
- name: RUCIO_DAEMON
value: "cache-consumer"
- name: RUCIO_DAEMON_ARGS
value: "{{- if .Values.cacheConsumer.threads }} --num-thread {{ .Values.cacheConsumer.threads }} {{ end }}"
{{- with .Values.cacheConsumer.resources }}
resources:
{{ toYaml . | trim | indent 12 }}
{{ end }}
{{- with .Values.cacheConsumer.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.cacheConsumer.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.cacheConsumer.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{ end }}
1 change: 1 addition & 0 deletions charts/rucio-daemons/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ abacusAccountCount: 0
abacusCollectionReplicaCount: 0
abacusRseCount: 0
automatixCount: 0
cacheConsumerCount: 0
conveyorTransferSubmitterCount: 0
conveyorPollerCount: 0
conveyorFinisherCount: 0
Expand Down

0 comments on commit 70dcbcc

Please sign in to comment.