Skip to content

Commit

Permalink
Merge pull request #223 from OT-CONTAINER-KIT/ms-deployment-strategy
Browse files Browse the repository at this point in the history
Ms deployment strategy
  • Loading branch information
ashwani-opstree authored Jul 29, 2024
2 parents 555b0ee + 7f4e354 commit eb04127
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
7 changes: 3 additions & 4 deletions charts/microservice/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ apiVersion: v2
name: microservice
description: Basic helm chart for deploying microservices on kubernetes with best practices
type: application
version: 0.1.3
version: 0.1.4
appVersion: "0.1.2"
maintainers:
- name: Ashwani Singh
email: [email protected]
- name: Shikha Tripathi
- name: ashwani-opstree
- name: tripathishikha1
21 changes: 16 additions & 5 deletions charts/microservice/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,34 @@ kind: Deployment
metadata:
name: {{ include "microservice.fullname" . }}-app
namespace: {{ .Values.global.namespace | quote }}
{{- if .Values.annotations }}
{{- if .Values.deployment.annotations }}
annotations:
{{- range $key, $value := .Values.annotations }}
{{- range $key, $value := .Values.deployment.annotations }}
{{ $key }}: {{ $value }}
{{- end }}
{{- end }}
labels:
{{- include "microservice.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.global.replicaCount }}
{{- if .Values.deployment.strategy }}
strategy:
{{- toYaml .Values.deployment.strategy | nindent 4 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds }}
selector:
matchLabels:
{{- include "microservice.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "microservice.selectorLabels" . | nindent 8 }}
{{- if .Values.deployment.podAnnotations }}
annotations:
{{- range $key, $value := .Values.deployment.podAnnotations }}
{{ $key }}: {{ $value }}
{{- end }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down Expand Up @@ -51,11 +62,11 @@ spec:
value: {{ $value | quote }}
{{- end }}
{{- end }}
{{- if .Values.deployment.livenessProbe }}
{{- if and .Values.deployment.healthProbes.enabled .Values.deployment.livenessProbe }}
livenessProbe:
{{- toYaml .Values.deployment.livenessProbe | nindent 12 }}
{{- end }}
{{- if .Values.deployment.readinessProbe }}
{{- if and .Values.deployment.healthProbes.enabled .Values.deployment.readinessProbe }}
readinessProbe:
{{- toYaml .Values.deployment.readinessProbe | nindent 12 }}
{{- end }}
Expand Down Expand Up @@ -96,4 +107,4 @@ spec:
{{- with .Values.deployment.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
10 changes: 9 additions & 1 deletion charts/microservice/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,23 @@ deployment:
tag: ""
pullPolicy: IfNotPresent

strategy: {}

# Annotation for the Deployment
annotations: {}
podAnnotations: {}

terminationGracePeriodSeconds: 30

healthProbes:
enabled: true

# livenessProbe: {}
livenessProbe:
# httpGet:
# path: "/"
# port: http
initialDelaySeconds: 250
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
successThreshold: 1
Expand Down

0 comments on commit eb04127

Please sign in to comment.