diff --git a/helm-charts/cogstack-cohorter-helm/templates/_helpers.tpl b/helm-charts/cogstack-cohorter-helm/templates/_helpers.tpl index 2967786..89a8920 100644 --- a/helm-charts/cogstack-cohorter-helm/templates/_helpers.tpl +++ b/helm-charts/cogstack-cohorter-helm/templates/_helpers.tpl @@ -43,13 +43,27 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} {{/* -Selector labels +Selector labels (release-scoped — shared base, do not use directly as pod selectors) */}} {{- define "cogstack-cohorter-helm.selectorLabels" -}} app.kubernetes.io/name: {{ include "cogstack-cohorter-helm.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} +{{/* +Component-scoped selector labels — use these in Deployment matchLabels and Service selectors +so that each service only targets its own pods. +*/}} +{{- define "cogstack-cohorter-helm.webappSelectorLabels" -}} +{{ include "cogstack-cohorter-helm.selectorLabels" . }} +app.kubernetes.io/component: webapp +{{- end }} + +{{- define "cogstack-cohorter-helm.nl2dslSelectorLabels" -}} +{{ include "cogstack-cohorter-helm.selectorLabels" . }} +app.kubernetes.io/component: nl2dsl +{{- end }} + {{/* Create the name of the service account to use */}} diff --git a/helm-charts/cogstack-cohorter-helm/templates/nl2dsl-deployment.yaml b/helm-charts/cogstack-cohorter-helm/templates/nl2dsl-deployment.yaml index 421e281..49a0273 100644 --- a/helm-charts/cogstack-cohorter-helm/templates/nl2dsl-deployment.yaml +++ b/helm-charts/cogstack-cohorter-helm/templates/nl2dsl-deployment.yaml @@ -9,7 +9,7 @@ spec: replicas: {{ .Values.nl2dsl.replicaCount }} selector: matchLabels: - {{- include "cogstack-cohorter-helm.selectorLabels" . | nindent 6 }} + {{- include "cogstack-cohorter-helm.nl2dslSelectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} @@ -18,6 +18,7 @@ spec: {{- end }} labels: {{- include "cogstack-cohorter-helm.labels" . | nindent 8 }} + app.kubernetes.io/component: nl2dsl {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/helm-charts/cogstack-cohorter-helm/templates/nl2dsl-service.yaml b/helm-charts/cogstack-cohorter-helm/templates/nl2dsl-service.yaml index 376c5bb..d24f107 100644 --- a/helm-charts/cogstack-cohorter-helm/templates/nl2dsl-service.yaml +++ b/helm-charts/cogstack-cohorter-helm/templates/nl2dsl-service.yaml @@ -13,5 +13,5 @@ spec: protocol: TCP name: http selector: - {{- include "cogstack-cohorter-helm.selectorLabels" . | nindent 4 }} + {{- include "cogstack-cohorter-helm.nl2dslSelectorLabels" . | nindent 4 }} {{- end }} diff --git a/helm-charts/cogstack-cohorter-helm/templates/webapp-deployment.yaml b/helm-charts/cogstack-cohorter-helm/templates/webapp-deployment.yaml index 7c72f46..ad4759d 100644 --- a/helm-charts/cogstack-cohorter-helm/templates/webapp-deployment.yaml +++ b/helm-charts/cogstack-cohorter-helm/templates/webapp-deployment.yaml @@ -12,7 +12,7 @@ spec: {{- end }} selector: matchLabels: - {{- include "cogstack-cohorter-helm.selectorLabels" . | nindent 6 }} + {{- include "cogstack-cohorter-helm.webappSelectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} @@ -21,6 +21,7 @@ spec: {{- end }} labels: {{- include "cogstack-cohorter-helm.labels" . | nindent 8 }} + app.kubernetes.io/component: webapp {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/helm-charts/cogstack-cohorter-helm/templates/webapp-service.yaml b/helm-charts/cogstack-cohorter-helm/templates/webapp-service.yaml index 403a915..eadb720 100644 --- a/helm-charts/cogstack-cohorter-helm/templates/webapp-service.yaml +++ b/helm-charts/cogstack-cohorter-helm/templates/webapp-service.yaml @@ -13,5 +13,5 @@ spec: protocol: TCP name: http selector: - {{- include "cogstack-cohorter-helm.selectorLabels" . | nindent 4 }} + {{- include "cogstack-cohorter-helm.webappSelectorLabels" . | nindent 4 }} {{- end }} diff --git a/helm-charts/cogstack-cohorter-helm/values.yaml b/helm-charts/cogstack-cohorter-helm/values.yaml index 158b96d..d44e308 100644 --- a/helm-charts/cogstack-cohorter-helm/values.yaml +++ b/helm-charts/cogstack-cohorter-helm/values.yaml @@ -109,7 +109,7 @@ webapp: image: repository: cogstacksystems/cogstack-cohorter-webapp tag: latest - pullPolicy: IfNotPresent + pullPolicy: Always # Environment variables injected into the webapp container. # NL2DSL_SERVER is set automatically from nl2dsl.service.port. @@ -182,7 +182,7 @@ nl2dsl: image: repository: cogstacksystems/cogstack-cohorter-nl2dsl tag: latest - pullPolicy: IfNotPresent + pullPolicy: Always # Environment variables injected into the nl2dsl container. # OLLAMA_URL and MEDCAT_URL are set automatically from subchart service names.