소스 검색

Add common methods for deployment metadata

Waqar Ahmed 4 년 전
부모
커밋
1e7b184520
1개의 변경된 파일30개의 추가작업 그리고 0개의 파일을 삭제
  1. 30 0
      library/common/2101.0.0/templates/lib/deployments/_utils

+ 30 - 0
library/common/2101.0.0/templates/lib/deployments/_utils

@@ -0,0 +1,30 @@
+{{/*
+Retrieve deployment metadata
+*/}}
+{{- define "common.deployment.metadata" -}}
+metadata:
+  name: {{ template "common.names.fullname" . }}
+  labels: {{ include "common.labels.selectorLabels" . | nindent 4 }}
+{{- end -}}
+
+
+{{/*
+Retrieve replicas/strategy/selector
+*/}}
+{{- define "common.deployment.common_spec" -}}
+replicas: {{ (default 1 .Values.replicas) }}
+strategy:
+  type: {{ (default "Recreate" .Values.strategyType ) }}
+selector:
+  matchLabels: {{ include "common.labels.selectorLabels" . | nindent 4 }}
+{{- end -}}
+
+
+{{/*
+Retrieve deployment pod's metadata
+*/}}
+{{- define "common.deployment.pod.metadata" -}}
+metadata:
+  labels: {{ include "common.labels.selectorLabels" . | nindent 4 }}
+  annotations: {{ include "common.annotations" . | nindent 4 }}
+{{- end -}}