Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inconsequent labels in deployments #160

Open
genofire opened this issue Mar 22, 2023 · 2 comments
Open

inconsequent labels in deployments #160

genofire opened this issue Mar 22, 2023 · 2 comments
Labels
Category:Enhancement Add new functionality Priority:p3-medium Normal priority

Comments

@genofire
Copy link

genofire commented Mar 22, 2023

in selector should be the helper be used

  • e.g. if you like to run multiple helm charts in the same namespace.
  • clean labeling like from helm introduced: helm create
 {{- $_ := set . "appName" "users" -}}
 {{- $_ := set . "resources" (default (default (dict)  .Values.resources) .Values.services.users.resources) -}}
 apiVersion: apps/v1
 kind: Deployment
 metadata:
   name: {{ .appName }}
   namespace: {{ template "ocis.namespace" . }}
   labels:
     {{- include "ocis.labels" . | nindent 4 }}
 spec:
   selector:
     matchLabels:
       app: {{ .appName }}
+      {{- include "ocis.selectorLabels" . | nindent 8 }}
   {{- if and (not .Values.autoscaling.enabled) (.Values.replicas) }}
   replicas: {{ .Values.replicas }}
   {{- end }}
   {{- if .Values.deploymentStrategy }}
   strategy: {{ toYaml .Values.deploymentStrategy | nindent 4 }}
   {{ end }}
   template:
     metadata:
       labels:
         app: {{ .appName }}
-        {{- include "ocis.labels" . | nindent 8 }}
+        {{- include "ocis.selectorLabels" . | nindent 8 }}
@wkloucek wkloucek added the Category:Enhancement Add new functionality label Mar 22, 2023
@wkloucek
Copy link
Contributor

Thanks for opening this issue!

@d7oc d7oc self-assigned this Mar 23, 2023
@genofire
Copy link
Author

  1. Oh yeah, thanks for writting that issue.
  2. podLabel maybe are there from interesting too (we use it for special networkpolicies - e.g. from prometheues reachable)

@wkloucek wkloucek added the Priority:p3-medium Normal priority label May 9, 2023
@Excds Excds assigned Excds and unassigned Excds May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:Enhancement Add new functionality Priority:p3-medium Normal priority
Projects
None yet
Development

No branches or pull requests

4 participants