Commit a038064a authored by Radu Carpa's avatar Radu Carpa
Browse files

daemons: rework the app label

Many kubernetes helper tools use this label to distinguish between
applications. Until now, all pods in the rucio-daemons chart where
assigned the same "app: rucio-daemons" label.

This is also problematic, and surprising that everything worked
correctly, because the deployment pod selector was the same for all
deployments, which is explicitly discouraged in the documentation:
https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#selector

The new app label includes the daemon name: `rucio-daemons-conveyor-poller`
for example. The label `app-group` will now contain the old content of the
'app' label.
parent cf845285
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
name: rucio-daemons
version: 1.29.0
version: 1.29.1
apiVersion: v1
description: A Helm chart to deploy daemons for Rucio
keywords:
+13 −9
Original line number Diff line number Diff line
{{- if gt .Values.abacusAccountCount 0.0 -}}
{{- $rucio_daemon := "abacus-account" }}
{{- $app_label := printf "%s-%s" (include "rucio.name" .) $rucio_daemon }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "rucio.fullname" . }}.config.abacus-account.yaml
  name: {{ template "rucio.fullname" . }}.config.{{ $rucio_daemon }}.yaml
  labels:
    app: {{ template "rucio.name" . }}
    app: {{ $app_label }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
@@ -18,9 +20,10 @@ data:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Release.Name }}-abacus-account
  name: {{ .Release.Name }}-{{ $rucio_daemon }}
  labels:
    app: {{ template "rucio.name" . }}
    app: {{ $app_label }}
    app-group: {{ template "rucio.name" . }}
    chart: {{ template "rucio.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
@@ -28,7 +31,7 @@ spec:
  replicas: {{ .Values.abacusAccountCount }}
  selector:
    matchLabels:
      app: {{ template "rucio.name" . }}
      app: {{ $app_label }}
      release: {{ .Release.Name }}
  strategy:
    type: {{ .Values.strategy.type }}
@@ -42,9 +45,10 @@ spec:
  template:
    metadata:
      labels:
        app: {{ template "rucio.name" . }}
        app: {{ $app_label }}
        app-group: {{ template "rucio.name" . }}
        release: {{ .Release.Name }}
        rucio-daemon: abacus-account
        rucio-daemon: {{ $rucio_daemon }}
    {{- with .Values.podLabels }}
        {{- toYaml . | nindent 8 }}
    {{- end }}
@@ -63,7 +67,7 @@ spec:
      volumes:
      - name: config
        secret:
          secretName: {{ template "rucio.fullname" . }}.config.abacus-account.yaml
          secretName: {{ template "rucio.fullname" . }}.config.{{ $rucio_daemon }}.yaml
      - name: proxy-volume
        secret:
          secretName: {{ .Release.Name }}-rucio-x509up
@@ -112,7 +116,7 @@ spec:
            - name: RUCIO_OVERRIDE_CONFIGS
              value: "/opt/rucio/etc/rucio.config.common.json /opt/rucio/etc/rucio.config.component.json"
            - name: RUCIO_DAEMON
              value: "abacus-account"
              value: "{{ $rucio_daemon }}"
            - name: RUCIO_DAEMON_ARGS
              value: "--threads {{ .Values.abacusAccount.threads }}"
{{- with .Values.abacusAccount.resources }}
+13 −9
Original line number Diff line number Diff line
{{- if gt .Values.abacusCollectionReplicaCount 0.0 -}}
{{- $rucio_daemon := "abacus-collection-replica" }}
{{- $app_label := printf "%s-%s" (include "rucio.name" .) $rucio_daemon }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "rucio.fullname" . }}.config.abacus-collection-replica.yaml
  name: {{ template "rucio.fullname" . }}.config.{{ $rucio_daemon }}.yaml
  labels:
    app: {{ template "rucio.name" . }}
    app: {{ $app_label }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
@@ -18,9 +20,10 @@ data:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Release.Name }}-abacus-collection-replica
  name: {{ .Release.Name }}-{{ $rucio_daemon }}
  labels:
    app: {{ template "rucio.name" . }}
    app: {{ $app_label }}
    app-group: {{ template "rucio.name" . }}
    chart: {{ template "rucio.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
@@ -28,7 +31,7 @@ spec:
  replicas: {{ .Values.abacusCollectionReplicaCount }}
  selector:
    matchLabels:
      app: {{ template "rucio.name" . }}
      app: {{ $app_label }}
      release: {{ .Release.Name }}
  strategy:
    type: {{ .Values.strategy.type }}
@@ -42,9 +45,10 @@ spec:
  template:
    metadata:
      labels:
        app: {{ template "rucio.name" . }}
        app: {{ $app_label }}
        app-group: {{ template "rucio.name" . }}
        release: {{ .Release.Name }}
        rucio-daemon: abacus-collection-replica
        rucio-daemon: {{ $rucio_daemon }}
    {{- with .Values.podLabels }}
        {{- toYaml . | nindent 8 }}
    {{- end }}
@@ -63,7 +67,7 @@ spec:
      volumes:
      - name: config
        secret:
          secretName: {{ template "rucio.fullname" . }}.config.abacus-collection-replica.yaml
          secretName: {{ template "rucio.fullname" . }}.config.{{ $rucio_daemon }}.yaml
      - name: proxy-volume
        secret:
          secretName: {{ .Release.Name }}-rucio-x509up
@@ -112,7 +116,7 @@ spec:
            - name: RUCIO_OVERRIDE_CONFIGS
              value: "/opt/rucio/etc/rucio.config.common.json /opt/rucio/etc/rucio.config.component.json"
            - name: RUCIO_DAEMON
              value: "abacus-collection-replica"
              value: "{{ $rucio_daemon }}"
            - name: RUCIO_DAEMON_ARGS
              value: "--threads {{ .Values.abacusCollectionReplica.threads }}"
{{- with .Values.abacusCollectionReplica.resources }}
+13 −9
Original line number Diff line number Diff line
{{- if gt .Values.abacusRseCount 0.0 -}}
{{- $rucio_daemon := "abacus-rse" }}
{{- $app_label := printf "%s-%s" (include "rucio.name" .) $rucio_daemon }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "rucio.fullname" . }}.config.abacus-rse.yaml
  name: {{ template "rucio.fullname" . }}.config.{{ $rucio_daemon }}.yaml
  labels:
    app: {{ template "rucio.name" . }}
    app: {{ $app_label }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
@@ -18,9 +20,10 @@ data:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Release.Name }}-abacus-rse
  name: {{ .Release.Name }}-{{ $rucio_daemon }}
  labels:
    app: {{ template "rucio.name" . }}
    app: {{ $app_label }}
    app-group: {{ template "rucio.name" . }}
    chart: {{ template "rucio.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
@@ -28,7 +31,7 @@ spec:
  replicas: {{ .Values.abacusRseCount }}
  selector:
    matchLabels:
      app: {{ template "rucio.name" . }}
      app: {{ $app_label }}
      release: {{ .Release.Name }}
  strategy:
    type: {{ .Values.strategy.type }}
@@ -42,9 +45,10 @@ spec:
  template:
    metadata:
      labels:
        app: {{ template "rucio.name" . }}
        app: {{ $app_label }}
        app-group: {{ template "rucio.name" . }}
        release: {{ .Release.Name }}
        rucio-daemon: abacus-rse
        rucio-daemon: {{ $rucio_daemon }}
    {{- with .Values.podLabels }}
        {{- toYaml . | nindent 8 }}
    {{- end }}
@@ -63,7 +67,7 @@ spec:
      volumes:
      - name: config
        secret:
          secretName: {{ template "rucio.fullname" . }}.config.abacus-rse.yaml
          secretName: {{ template "rucio.fullname" . }}.config.{{ $rucio_daemon }}.yaml
      - name: proxy-volume
        secret:
          secretName: {{ .Release.Name }}-rucio-x509up
@@ -112,7 +116,7 @@ spec:
            - name: RUCIO_OVERRIDE_CONFIGS
              value: "/opt/rucio/etc/rucio.config.common.json /opt/rucio/etc/rucio.config.component.json"
            - name: RUCIO_DAEMON
              value: "abacus-rse"
              value: "{{ $rucio_daemon }}"
            - name: RUCIO_DAEMON_ARGS
              value: "{{- if .Values.abacusRse.fillHistoryTable }}--enable-history {{ end }}--threads {{ .Values.abacusRse.threads }}"
{{- with .Values.abacusRse.resources }}
+13 −9
Original line number Diff line number Diff line
{{- if gt .Values.automatixCount 0.0 -}}
{{- $rucio_daemon := "automatix" }}
{{- $app_label := printf "%s-%s" (include "rucio.name" .) $rucio_daemon }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "rucio.fullname" . }}.config.automatix.yaml
  name: {{ template "rucio.fullname" . }}.config.{{ $rucio_daemon }}.yaml
  labels:
    app: {{ template "rucio.name" . }}
    app: {{ $app_label }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
@@ -18,9 +20,10 @@ data:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Release.Name }}-automatix
  name: {{ .Release.Name }}-{{ $rucio_daemon }}
  labels:
    app: {{ template "rucio.name" . }}
    app: {{ $app_label }}
    app-group: {{ template "rucio.name" . }}
    chart: {{ template "rucio.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
@@ -28,7 +31,7 @@ spec:
  replicas: {{ .Values.automatixCount }}
  selector:
    matchLabels:
      app: {{ template "rucio.name" . }}
      app: {{ $app_label }}
      release: {{ .Release.Name }}
  strategy:
    type: {{ .Values.strategy.type }}
@@ -42,9 +45,10 @@ spec:
  template:
    metadata:
      labels:
        app: {{ template "rucio.name" . }}
        app: {{ $app_label }}
        app-group: {{ template "rucio.name" . }}
        release: {{ .Release.Name }}
        rucio-daemon: automatix
        rucio-daemon: {{ $rucio_daemon }}
    {{- with .Values.podLabels }}
        {{- toYaml . | nindent 8 }}
    {{- end }}
@@ -63,7 +67,7 @@ spec:
      volumes:
      - name: config
        secret:
          secretName: {{ template "rucio.fullname" . }}.config.automatix.yaml
          secretName: {{ template "rucio.fullname" . }}.config.{{ $rucio_daemon }}.yaml
      - name: proxy-volume
        secret:
          secretName: {{ .Release.Name }}-rucio-x509up
@@ -121,7 +125,7 @@ spec:
            - name: RUCIO_OVERRIDE_CONFIGS
              value: "/opt/rucio/etc/rucio.config.common.json /opt/rucio/etc/rucio.config.component.json"
            - name: RUCIO_DAEMON
              value: "automatix"
              value: "{{ $rucio_daemon }}"
            - name: RUCIO_DAEMON_ARGS
              value: "{{- if .Values.automatix.threads }} --threads-per-process {{ .Values.automatix.threads }}{{ end }} {{- if .Values.automatix.inputFile }} --input-file {{ .Values.automatix.inputFile }}{{ end }} {{- if .Values.automatix.sleepTime }} --sleep-time {{ .Values.automatix.sleepTime }}{{ end }}"
            - name: X509_USER_PROXY
Loading