Skip to content

Commit

Permalink
use single layout and conf file for all dcache pods
Browse files Browse the repository at this point in the history
  • Loading branch information
kofemann committed Oct 21, 2023
1 parent db672d9 commit 75f6855
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 51 deletions.
32 changes: 32 additions & 0 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,36 @@ Add CA certs and generate host certificate
chown 994:1000 *.pem;
/usr/sbin/fetch-crl;

{{- end }}

{{/*
dCache config volume mounts
*/}}
{{- define "dcache.conf.mounts" }}
- name: dcache-config
mountPath: /opt/dcache/etc/dcache.conf
subPath: dcache.conf
readOnly: true
- name: dcache-layout
mountPath: /opt/dcache/etc/layouts/dcache-k8s.conf
subPath: dcache-k8s.conf
readOnly: true
{{- end }}

{{/*
dCache conf and layout config map
*/}}
{{- define "dcache.conf.volume" }}
- name: dcache-config
configMap:
name: {{ .Release.Name }}-configmap
items:
- key: "dcache.conf"
path: "dcache.conf"
- name: dcache-layout
configMap:
name: {{ .Release.Name }}-configmap
items:
- key: "dcache-k8s-door"
path: "dcache-k8s.conf"
{{- end }}
18 changes: 7 additions & 11 deletions templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@ metadata:
name: {{ .Release.Name }}-configmap
data:
dcache-k8s-door: |-
[door-svc]
dcache.broker.scheme = core
chimerashell.db.host = ${chimera.db.host}
chimerashell.db.user = ${chimera.db.user}
chimerashell.db.password = ${chimera.db.password}
chimerashell.db.name = ${chimera.db.name}
dcache.java.options.extra=-Dorg.dcache.net.localaddresses={{ $.Release.Name }}-door-svc.{{ $.Release.Namespace }}.svc.cluster.local
[door-svc]
[door-svc/poolmanager]
[door-svc/pnfsmanager]
Expand Down Expand Up @@ -96,15 +90,12 @@ data:
spacemanager.authz.link-group-file-name=/opt/dcache/etc/linkgroupauthz.conf
{{- range .Values.dcache.pools }}
config-pool-{{ . }}: |-
dcache.broker.scheme = satellite

[pool-{{ . }}-svc]
pool.tags=hostname=${host.name}
pool.mover.xrootd.security.tls.mode=OFF
dcache.java.options.extra=-Dorg.dcache.net.localaddresses={{ $.Release.Name }}-pool-{{ . }}-svc.{{ $.Release.Namespace }}.svc.cluster.local

[pool-{{ . }}-svc]
[pool-{{ . }}-svc/pool]
pool.name=pool-{{ . }}
pool.path=/pool
Expand Down Expand Up @@ -133,6 +124,11 @@ data:
pinmanager.db.name=chimera
spacemanager.db.name = chimera
chimerashell.db.host = ${chimera.db.host}
chimerashell.db.user = ${chimera.db.user}
chimerashell.db.password = ${chimera.db.password}
chimerashell.db.name = ${chimera.db.name}
dcache.zookeeper.connection=cells-zookeeper:2181
dcache.kafka.bootstrap-servers=billing-kafka:9092
dcache.enable.kafka = true
Expand Down
22 changes: 2 additions & 20 deletions templates/door.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,7 @@ spec:
initialDelaySeconds: 20
timeoutSeconds: 5
volumeMounts:
- name: dcache-config
mountPath: /opt/dcache/etc/dcache.conf
subPath: dcache.conf
readOnly: true
- name: dcache-layout
mountPath: /opt/dcache/etc/layouts/dcache-k8s.conf
subPath: dcache-k8s.conf
readOnly: true
{{ include "dcache.conf.mounts" . | indent 8 }}
- name: init-scripts
mountPath: /dcache.init.d/00-init.sh
subPath: 00-init.sh
Expand Down Expand Up @@ -79,21 +72,10 @@ spec:
- mountPath: /etc/grid-security
name: certs
volumes:
{{ include "dcache.conf.volume" . | indent 6 }}
- name: certs
persistentVolumeClaim:
claimName: {{ $.Release.Name }}-door-certs-store
- name: dcache-config
configMap:
name: {{ $.Release.Name }}-configmap
items:
- key: "dcache.conf"
path: "dcache.conf"
- name: dcache-layout
configMap:
name: {{ $.Release.Name }}-configmap
items:
- key: "dcache-k8s-door"
path: "dcache-k8s.conf"
- name: init-scripts
configMap:
name: {{ $.Release.Name }}-configmap
Expand Down
22 changes: 2 additions & 20 deletions templates/pool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,7 @@ spec:
initialDelaySeconds: 20
timeoutSeconds: 5
volumeMounts:
- name: dcache-config
mountPath: /opt/dcache/etc/dcache.conf
subPath: dcache.conf
readOnly: true
- name: dcache-layout
mountPath: /opt/dcache/etc/layouts/dcache-k8s.conf
subPath: dcache.conf
readOnly: true
{{ include "dcache.conf.mounts" . | indent 8 }}
- name: certs-store-{{ . }}
mountPath: /etc/grid-security
readOnly: true
Expand All @@ -51,20 +44,9 @@ spec:
image: busybox:1.28
command: ['sh', '-c', "until nc -z -v {{ $.Release.Name }}-door-svc.{{ $.Release.Namespace }}.svc.cluster.local {{ $.Values.cell.tunnel }}; do echo waiting for core to start; sleep 2; done"]
volumes:
{{ include "dcache.conf.volume" $ | indent 6 }}
- name: certs-store-{{ . }}
persistentVolumeClaim:
claimName: {{ $.Release.Name }}-pool-{{ . }}-certs-store
- name: dcache-config
configMap:
name: {{ $.Release.Name }}-configmap
items:
- key: "dcache.conf"
path: "dcache.conf"
- name: dcache-layout
configMap:
name: {{ $.Release.Name }}-configmap
items:
- key: "config-pool-{{ . }}"
path: "dcache.conf"
---
{{- end }}

0 comments on commit 75f6855

Please sign in to comment.