Open pierreblais opened 4 weeks ago
The Node Agent svc used a wrong label selector so there are no pods exposed.
svc
Kubescape-operator helm chart: 1.21.2
1.21.2
I'm expecting the node-agent SVC to expose Node Agent DaemonSet pods.
node-agent
The SVC expose no pods
charts/kubescape-operator/templates/node-agent/daemonset.yaml
spec: template: metadata: ... SCOPE... labels: {{- include "kubescape-operator.labels" (dict "Chart" .Chart "Release" .Release "Values" .Values "app" .Values.nodeAgent.name "tier" .Values.global.namespaceTier) | nindent 8 }} kubescape.io/tier: "core" ...SCOPE...
And the kubescape-operator.labels are:
kubescape-operator.labels
charts/kubescape-operator/templates/_helpers.tpl
{{- define "kubescape-operator.labels" -}} helm.sh/chart: {{ include "kubescape-operator.chart" . }} {{ include "kubescape-operator.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} app: {{ .app }} tier: {{ .tier }} kubescape.io/ignore: "true" {{- end }} ... {{/* Selector labels */}} {{- define "kubescape-operator.selectorLabels" -}} app.kubernetes.io/name: {{ include "kubescape-operator.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: {{ .app }} {{- end }}
charts/kubescape-operator/templates/node-agent/service.yaml
...SCOPE... selector: app.kubernetes.io/name: {{ .Values.nodeAgent.name }} ...SCOPE...
app.kubernetes.io/name: {{ include "kubescape-operator.name" . }}
app.kubernetes.io/name: {{ .Values.nodeAgent.name }}
I think label selector should be app: {{ .Values.nodeAgent.name }}.
app: {{ .Values.nodeAgent.name }}
Correct, do you want to work on this too?
Description
The Node Agent
svc
used a wrong label selector so there are no pods exposed.Environment
Kubescape-operator helm chart:
1.21.2
Expected behavior
I'm expecting the
node-agent
SVC to expose Node Agent DaemonSet pods.Actual Behavior
The SVC expose no pods
Additional context
charts/kubescape-operator/templates/node-agent/daemonset.yaml
And the
kubescape-operator.labels
are:charts/kubescape-operator/templates/_helpers.tpl
charts/kubescape-operator/templates/node-agent/service.yaml
app.kubernetes.io/name: {{ include "kubescape-operator.name" . }}
!=app.kubernetes.io/name: {{ .Values.nodeAgent.name }}
I think label selector should be
app: {{ .Values.nodeAgent.name }}
.