helm config for deployment

This commit is contained in:
ivan_chuvakhin 2021-07-02 17:54:40 +03:00
parent cb54b4b85e
commit 845b84c404
5 changed files with 40 additions and 145 deletions

View file

@ -21,4 +21,4 @@ version: 0.1.0
# incremented each time you make changes to the application. Versions are not expected to # incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using. # follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes. # It is recommended to use it with quotes.
appVersion: "1.16.0" appVersion: 1.16.0

View file

@ -1,8 +1,8 @@
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: petclinic-configmap name: {{ .Values.petclinic.configmap.name }}
data: data:
application.yml: | {{ .Values.petclinic.configmap.application.properties.name }}: |
server: server:
port: 8081 port: {{ .Values.petclinic.server.port }}

View file

@ -1,61 +1,30 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ include "spring-petclinic.fullname" . }} name: petclinic-deployment-{{ .Chart.AppVersion }}
labels:
{{- include "spring-petclinic.labels" . | nindent 4 }}
spec: spec:
{{- if not .Values.autoscaling.enabled }} replicas: 1
replicas: {{ .Values.replicaCount }}
{{- end }}
selector: selector:
matchLabels: matchLabels:
{{- include "spring-petclinic.selectorLabels" . | nindent 6 }} app: {{ .Values.petclinic.label }}
template: template:
metadata: metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels: labels:
{{- include "spring-petclinic.selectorLabels" . | nindent 8 }} app: {{ .Values.petclinic.label }}
spec: spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "spring-petclinic.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers: containers:
- name: {{ .Chart.Name }} - name: petclinic
securityContext: image: {{ .Values.petclinic.image }}
{{- toYaml .Values.securityContext | nindent 12 }} imagePullPolicy: Never
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports: ports:
- name: http - containerPort: {{ .Values.petclinic.server.port }}
containerPort: 80 name: "http"
protocol: TCP volumeMounts:
livenessProbe: - name: app-config
httpGet: mountPath: /application.yml
path: / subPath: {{ .Values.petclinic.configmap.application.properties.name }}
port: http readOnly: true
readinessProbe: volumes:
httpGet: - name: app-config
path: / configMap:
port: http name: {{ .Values.petclinic.configmap.name }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

View file

@ -1,15 +1,13 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ include "spring-petclinic.fullname" . }} name: petclinic-service
labels:
{{- include "spring-petclinic.labels" . | nindent 4 }}
spec: spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector: selector:
{{- include "spring-petclinic.selectorLabels" . | nindent 4 }} app: {{ .Values.petclinic.label }}
ports:
- name: http
protocol: TCP
port: {{ .Values.petclinic.server.port }}
targetPort: {{ .Values.petclinic.server.port }}
type: NodePort

View file

@ -1,82 +1,10 @@
# Default values for spring-petclinic. petclinic:
# This is a YAML-formatted file. server:
# Declare variables to be passed into your templates. port: 8081
image: spring-petclinic
replicaCount: 1 configmap:
name: petclinic-configmap
image: application:
repository: nginx properties:
pullPolicy: IfNotPresent name: application.yml
# Overrides the image tag whose default is the chart appVersion. label: petclinic
tag: ""
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
type: ClusterIP
port: 80
ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
nodeSelector: {}
tolerations: []
affinity: {}