aboutsummaryrefslogtreecommitdiffstats
path: root/vnfs/DAaaS/deploy/collection/charts/prom-kafka-writer/templates
diff options
context:
space:
mode:
Diffstat (limited to 'vnfs/DAaaS/deploy/collection/charts/prom-kafka-writer/templates')
-rw-r--r--vnfs/DAaaS/deploy/collection/charts/prom-kafka-writer/templates/NOTES.txt15
-rw-r--r--vnfs/DAaaS/deploy/collection/charts/prom-kafka-writer/templates/_helpers.tpl32
-rw-r--r--vnfs/DAaaS/deploy/collection/charts/prom-kafka-writer/templates/deployment.yaml48
-rw-r--r--vnfs/DAaaS/deploy/collection/charts/prom-kafka-writer/templates/service.yaml23
4 files changed, 118 insertions, 0 deletions
diff --git a/vnfs/DAaaS/deploy/collection/charts/prom-kafka-writer/templates/NOTES.txt b/vnfs/DAaaS/deploy/collection/charts/prom-kafka-writer/templates/NOTES.txt
new file mode 100644
index 00000000..757b139c
--- /dev/null
+++ b/vnfs/DAaaS/deploy/collection/charts/prom-kafka-writer/templates/NOTES.txt
@@ -0,0 +1,15 @@
+1. Get the application URL by running these commands:
+{{- if contains "NodePort" .Values.service.type }}
+ export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "prom-kafka-writer.fullname" . }})
+ export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
+ echo http://$NODE_IP:$NODE_PORT
+{{- else if contains "LoadBalancer" .Values.service.type }}
+ NOTE: It may take a few minutes for the LoadBalancer IP to be available.
+ You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "prom-kafka-writer.fullname" . }}'
+ export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "prom-kafka-writer.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
+ echo http://$SERVICE_IP:{{ .Values.service.port }}
+{{- else if contains "ClusterIP" .Values.service.type }}
+ export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "prom-kafka-writer.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
+ echo "Visit http://127.0.0.1:8080 to use your application"
+ kubectl port-forward $POD_NAME 8080:80
+{{- end }}
diff --git a/vnfs/DAaaS/deploy/collection/charts/prom-kafka-writer/templates/_helpers.tpl b/vnfs/DAaaS/deploy/collection/charts/prom-kafka-writer/templates/_helpers.tpl
new file mode 100644
index 00000000..1213110f
--- /dev/null
+++ b/vnfs/DAaaS/deploy/collection/charts/prom-kafka-writer/templates/_helpers.tpl
@@ -0,0 +1,32 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "prom-kafka-writer.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 "prom-kafka-writer.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 "prom-kafka-writer.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
diff --git a/vnfs/DAaaS/deploy/collection/charts/prom-kafka-writer/templates/deployment.yaml b/vnfs/DAaaS/deploy/collection/charts/prom-kafka-writer/templates/deployment.yaml
new file mode 100644
index 00000000..a3b6be3e
--- /dev/null
+++ b/vnfs/DAaaS/deploy/collection/charts/prom-kafka-writer/templates/deployment.yaml
@@ -0,0 +1,48 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ include "prom-kafka-writer.fullname" . }}
+ labels:
+ app.kubernetes.io/name: {{ include "prom-kafka-writer.name" . }}
+ helm.sh/chart: {{ include "prom-kafka-writer.chart" . }}
+ app.kubernetes.io/instance: {{ .Release.Name }}
+ app.kubernetes.io/managed-by: {{ .Release.Service }}
+spec:
+ replicas: {{ .Values.replicaCount }}
+ selector:
+ matchLabels:
+ app.kubernetes.io/name: {{ include "prom-kafka-writer.name" . }}
+ app.kubernetes.io/instance: {{ .Release.Name }}
+ app: {{ include "prom-kafka-writer.name" . }}
+ template:
+ metadata:
+ labels:
+ app.kubernetes.io/name: {{ include "prom-kafka-writer.name" . }}
+ app.kubernetes.io/instance: {{ .Release.Name }}
+ app: {{ include "prom-kafka-writer.name" . }}
+ spec:
+ containers:
+ - name: {{ .Chart.Name }}
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
+ ports:
+ - name: http
+ containerPort: {{ .Values.service.port }}
+ protocol: TCP
+ env:
+ - name: PORT
+ value: {{ .Values.service.port | quote }}
+ 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/vnfs/DAaaS/deploy/collection/charts/prom-kafka-writer/templates/service.yaml b/vnfs/DAaaS/deploy/collection/charts/prom-kafka-writer/templates/service.yaml
new file mode 100644
index 00000000..abc874a1
--- /dev/null
+++ b/vnfs/DAaaS/deploy/collection/charts/prom-kafka-writer/templates/service.yaml
@@ -0,0 +1,23 @@
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "prom-kafka-writer.fullname" . }}
+ labels:
+ app.kubernetes.io/name: {{ include "prom-kafka-writer.name" . }}
+ helm.sh/chart: {{ include "prom-kafka-writer.chart" . }}
+ app.kubernetes.io/instance: {{ .Release.Name }}
+ app.kubernetes.io/managed-by: {{ .Release.Service }}
+spec:
+ type: {{ .Values.service.type }}
+ ports:
+ - port: {{ .Values.service.port }}
+ {{- if ( and (eq .Values.service.type "NodePort" ) (not (empty .Values.service.nodePort)) ) }}
+ nodePort: {{ .Values.service.nodePort }}
+ {{- end }}
+ targetPort: http
+ protocol: TCP
+ name: http
+ selector:
+ app.kubernetes.io/name: {{ include "prom-kafka-writer.name" . }}
+ app.kubernetes.io/instance: {{ .Release.Name }}
+ app: {{ include "prom-kafka-writer.name" . }}