From cb54b4b85e99e0224e30fdb5a09f64d2c858e7f1 Mon Sep 17 00:00:00 2001 From: ivan_chuvakhin Date: Fri, 2 Jul 2021 17:22:33 +0300 Subject: [PATCH] default help config --- spring-petclinic/.helmignore | 23 ++++++ spring-petclinic/Chart.yaml | 24 +++++++ spring-petclinic/templates/configmap.yaml | 8 +++ spring-petclinic/templates/deployment.yaml | 61 ++++++++++++++++ spring-petclinic/templates/service.yaml | 15 ++++ spring-petclinic/values.yaml | 82 ++++++++++++++++++++++ 6 files changed, 213 insertions(+) create mode 100644 spring-petclinic/.helmignore create mode 100644 spring-petclinic/Chart.yaml create mode 100644 spring-petclinic/templates/configmap.yaml create mode 100644 spring-petclinic/templates/deployment.yaml create mode 100644 spring-petclinic/templates/service.yaml create mode 100644 spring-petclinic/values.yaml diff --git a/spring-petclinic/.helmignore b/spring-petclinic/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/spring-petclinic/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/spring-petclinic/Chart.yaml b/spring-petclinic/Chart.yaml new file mode 100644 index 000000000..39fab970f --- /dev/null +++ b/spring-petclinic/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: spring-petclinic +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# 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. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/spring-petclinic/templates/configmap.yaml b/spring-petclinic/templates/configmap.yaml new file mode 100644 index 000000000..1c3ca4aeb --- /dev/null +++ b/spring-petclinic/templates/configmap.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: petclinic-configmap +data: + application.yml: | + server: + port: 8081 diff --git a/spring-petclinic/templates/deployment.yaml b/spring-petclinic/templates/deployment.yaml new file mode 100644 index 000000000..bec7cf314 --- /dev/null +++ b/spring-petclinic/templates/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "spring-petclinic.fullname" . }} + labels: + {{- include "spring-petclinic.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "spring-petclinic.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "spring-petclinic.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "spring-petclinic.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + 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 }} diff --git a/spring-petclinic/templates/service.yaml b/spring-petclinic/templates/service.yaml new file mode 100644 index 000000000..91b122cfa --- /dev/null +++ b/spring-petclinic/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "spring-petclinic.fullname" . }} + labels: + {{- include "spring-petclinic.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "spring-petclinic.selectorLabels" . | nindent 4 }} diff --git a/spring-petclinic/values.yaml b/spring-petclinic/values.yaml new file mode 100644 index 000000000..49182eb97 --- /dev/null +++ b/spring-petclinic/values.yaml @@ -0,0 +1,82 @@ +# Default values for spring-petclinic. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + 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: {}