Skip to content

Spiderfoot - commonAnnotations and commonLabels only applied to PV, PVC and not to other resouces #91

@thamudi

Description

@thamudi

Description
The commonLabels and commonAnnotations defined in values.yaml are only being applied to PersistentVolume and PersistentVolumeClaim resources, but are missing from other critical resources like Service, Deployment, ServiceAccount, and Ingress. This breaks consistency and causes issues with service discovery, monitoring, and integration with external tools like Teleport that rely on these labels and annotations across all resources.

Current Behavior
When setting the following in values.yaml:

commonLabels:
  app.kubernetes.io/name: spiderfoot
  cloud.josa.ngo/release: spiderfoot

commonAnnotations:
  teleport.dev/name: "spiderfoot"

PersistentVolumeClaim (works correctly):

metadata:
  labels:
     app.kubernetes.io/name: spiderfoot
     cloud.josa.ngo/release: spiderfoot
  annotations:
    teleport.dev/name: spiderfoot

Service (not working):

yamlmetadata:
  labels:
    # Only default Helm labels, commonLabels missing ✗
  # annotations section completely missing ✗

Proposed Solution
Update all resource templates to include commonLabels and commonAnnotations:

Example for templates/service.yaml:

apiVersion: v1
kind: Service
metadata:
  name: {{ include "spiderfoot.fullname" . }}
  labels:
    {{- include "spiderfoot.labels" . | nindent 4 }}
    {{- with .Values.commonLabels }}
    {{- toYaml . | nindent 4 }}
    {{- end }}
  {{- if or .Values.service.annotations .Values.commonAnnotations }}
  annotations:
    {{- with .Values.service.annotations }}
    {{- toYaml . | nindent 4 }}
    {{- end }}
    {{- with .Values.commonAnnotations }}
    {{- toYaml . | nindent 4 }}
    {{- end }}
  {{- end }}
spec:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions