Generated by sbs
(a YAMLScript program).
|
|
|
{{/*
Expand the name of the chart.
*/}}
{{- define "ys-test-chart.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 "ys-test-chart.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 "ys-test-chart.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "ys-test-chart.labels" -}}
helm.sh/chart: {{ include "ys-test-chart.chart" . }}
{{ include "ys-test-chart.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "ys-test-chart.selectorLabels" -}}
app.kubernetes.io/name: {{ include "ys-test-chart.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "ys-test-chart.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "ys-test-chart.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }} |
|
|
HELMYS: true
Name: {{ default .Release.Name }}
Service: Helm |
|
|
|
apiVersion: v1
kind: ServiceAccount
metadata:
name:: serviceAccountName
labels:: common-labels()
:when+ Values.serviceAccount.annotations.?::
annotations:: _
automountServiceAccountToken::
Values.serviceAccount.automount
|
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "ys-test-chart.serviceAccountName" . }}
labels:
{{- include "ys-test-chart.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
{{- end }} |
|
|
apiVersion: v1
kind: Service
metadata:
name:: chart-fullname
labels:: common-labels()
spec:
type:: Values.service.type
ports:
- port:: Values.service.port
targetPort: http
protocol: TCP
name: http
selector:: selectorLabels()
|
apiVersion: v1
kind: Service
metadata:
name: {{ include "ys-test-chart.fullname" . }}
labels:
{{- include "ys-test-chart.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "ys-test-chart.selectorLabels" . | nindent 4 }} |
|
|
apiVersion: apps/v1
kind: Deployment
metadata:
name:: chart-fullname
labels:: common-labels()
spec:
:when-not Values.autoscaling.enabled.?::
replicas:: Values.replicaCount
selector:
matchLabels:: selectorLabels()
template:
metadata:
:when+ Values.podAnnotations.?::
annotations:: _
labels:: common-labels()
spec:
:when+ Values.imagePullSecrets.?::
imagePullSecrets:: _
serviceAccountName:: serviceAccountName
securityContext:: Values.podSecurityContext
containers:
- name:: Chart.name
securityContext:: Values.securityContext
image:: "$(Values.image.repository):\
$(Values.image.tag ||| Chart.appVersion)"
imagePullPolicy:: Values.image.pullPolicy
ports:
- name: http
containerPort:: Values.service.port
protocol: TCP
livenessProbe:: Values.livenessProbe
readinessProbe:: Values.readinessProbe
resources:: Values.resources
:when+ Values.volumeMounts.?:: {volumeMounts:: _}
:when+ Values.volumes.?:: {volumes:: _}
:when+ Values.nodeSelector.?:: {nodeSelector:: _}
:when+ Values.affinity.?:: {affinity:: _}
:when+ Values.tolerations.?:: {tolerations:: _}
|
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "ys-test-chart.fullname" . }}
labels:
{{- include "ys-test-chart.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "ys-test-chart.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "ys-test-chart.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "ys-test-chart.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: {{ .Values.service.port }}
protocol: TCP
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }} |