diff options
Diffstat (limited to 'helm/netconf/templates')
-rw-r--r-- | helm/netconf/templates/_helpers.tpl | 53 | ||||
-rw-r--r-- | helm/netconf/templates/deployment.yaml | 56 | ||||
-rw-r--r-- | helm/netconf/templates/service.yaml | 16 |
3 files changed, 125 insertions, 0 deletions
diff --git a/helm/netconf/templates/_helpers.tpl b/helm/netconf/templates/_helpers.tpl new file mode 100644 index 0000000..1b0ef5c --- /dev/null +++ b/helm/netconf/templates/_helpers.tpl @@ -0,0 +1,53 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "netconf-server.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 "netconf-server.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 "netconf-server.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "netconf-server.labels" -}} +helm.sh/chart: {{ include "netconf-server.chart" . }} +{{ include "netconf-server.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "netconf-server.selectorLabels" -}} +app.kubernetes.io/name: {{ include "netconf-server.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + diff --git a/helm/netconf/templates/deployment.yaml b/helm/netconf/templates/deployment.yaml new file mode 100644 index 0000000..15785cd --- /dev/null +++ b/helm/netconf/templates/deployment.yaml @@ -0,0 +1,56 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "netconf-server.fullname" . }} + labels: + {{- include "netconf-server.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "netconf-server.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "netconf-server.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - env: + - name: KAFKA_HOST_NAME + value: {{ .Values.config.kafka_hostname | 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 }} + livenessProbe: + httpGet: + path: /healthcheck + port: {{ .Values.service.port }} + readinessProbe: + httpGet: + path: /readiness + port: {{ .Values.service.port }} + {{- 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/netconf/templates/service.yaml b/helm/netconf/templates/service.yaml new file mode 100644 index 0000000..e359b81 --- /dev/null +++ b/helm/netconf/templates/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "netconf-server.fullname" . }} + labels: + {{- include "netconf-server.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: {{ .Values.service.port }} + nodePort: {{ .Values.service.nodePort }} + protocol: TCP + name: {{ .Values.service.port | quote }} + selector: + {{- include "netconf-server.selectorLabels" . | nindent 4 }} |