diff options
Diffstat (limited to 'helm/ves-client/templates')
-rw-r--r-- | helm/ves-client/templates/_helpers.tpl | 53 | ||||
-rw-r--r-- | helm/ves-client/templates/configmap.yaml | 11 | ||||
-rw-r--r-- | helm/ves-client/templates/deployment.yaml | 63 | ||||
-rw-r--r-- | helm/ves-client/templates/service.yaml | 15 |
4 files changed, 142 insertions, 0 deletions
diff --git a/helm/ves-client/templates/_helpers.tpl b/helm/ves-client/templates/_helpers.tpl new file mode 100644 index 0000000..1d8fd9f --- /dev/null +++ b/helm/ves-client/templates/_helpers.tpl @@ -0,0 +1,53 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "ves-client.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "ves-client.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "ves-client.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "ves-client.labels" -}} +helm.sh/chart: {{ include "ves-client.chart" . }} +{{ include "ves-client.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "ves-client.selectorLabels" -}} +app.kubernetes.io/name: {{ include "ves-client.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + diff --git a/helm/ves-client/templates/configmap.yaml b/helm/ves-client/templates/configmap.yaml new file mode 100644 index 0000000..4717c38 --- /dev/null +++ b/helm/ves-client/templates/configmap.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Chart.Name }}-configmap +binaryData: + {{- $files := .Files }} + {{- range $key, $value := .Files }} + {{- if hasPrefix "resources/" $key }} + {{ $key | trimPrefix "resources/" }}: {{ $files.Get $key | b64enc | quote }} + {{- end }} + {{- end }} diff --git a/helm/ves-client/templates/deployment.yaml b/helm/ves-client/templates/deployment.yaml new file mode 100644 index 0000000..d635c69 --- /dev/null +++ b/helm/ves-client/templates/deployment.yaml @@ -0,0 +1,63 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "ves-client.fullname" . }} + labels: + {{- include "ves-client.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "ves-client.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "ves-client.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - env: + - name: MONGO_HOSTNAME + value: {{ .Values.config.mongoDbServer | quote }} + - name: USE_CERTIFICATE_FOR_AUTHORIZATION + value: {{ .Values.config.useCertForAuth | quote }} + name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: {{ include "repositoryGenerator.repository" . }}{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - containerPort: {{ .Values.config.containerPort }} + protocol: TCP + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - name: store-map + mountPath: {{ .Values.storeMap.directory }} + volumes: + - name: store-map + configMap: + name: {{ .Chart.Name }}-configmap + defaultMode: 0755 + {{- 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/helm/ves-client/templates/service.yaml b/helm/ves-client/templates/service.yaml new file mode 100644 index 0000000..ad67f9b --- /dev/null +++ b/helm/ves-client/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "ves-client.fullname" . }} + labels: + {{- include "ves-client.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: {{ .Values.service.port }} + protocol: TCP + name: {{ .Values.service.port | quote }} + selector: + {{- include "ves-client.selectorLabels" . | nindent 4 }} |