summaryrefslogtreecommitdiff
path: root/astroshop-helm/email
diff options
context:
space:
mode:
Diffstat (limited to 'astroshop-helm/email')
-rw-r--r--astroshop-helm/email/.helmignore23
-rw-r--r--astroshop-helm/email/Chart.yaml22
-rw-r--r--astroshop-helm/email/templates/_helpers.tpl62
-rw-r--r--astroshop-helm/email/templates/deployment.yaml66
-rw-r--r--astroshop-helm/email/templates/service.yaml16
-rw-r--r--astroshop-helm/email/values.yaml31
6 files changed, 220 insertions, 0 deletions
diff --git a/astroshop-helm/email/.helmignore b/astroshop-helm/email/.helmignore
new file mode 100644
index 0000000..0e8a0eb
--- /dev/null
+++ b/astroshop-helm/email/.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/astroshop-helm/email/Chart.yaml b/astroshop-helm/email/Chart.yaml
new file mode 100644
index 0000000..0676c83
--- /dev/null
+++ b/astroshop-helm/email/Chart.yaml
@@ -0,0 +1,22 @@
+apiVersion: v2
+name: email
+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: "2.1.3"
+namespace: opentelemetry-demo \ No newline at end of file
diff --git a/astroshop-helm/email/templates/_helpers.tpl b/astroshop-helm/email/templates/_helpers.tpl
new file mode 100644
index 0000000..9742d31
--- /dev/null
+++ b/astroshop-helm/email/templates/_helpers.tpl
@@ -0,0 +1,62 @@
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "email.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 "email.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 "email.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Common labels
+*/}}
+{{- define "email.labels" -}}
+helm.sh/chart: {{ include "email.chart" . }}
+{{ include "email.selectorLabels" . }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end }}
+
+{{/*
+Selector labels
+*/}}
+{{- define "email.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "email.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end }}
+
+{{/*
+Create the name of the service account to use
+*/}}
+{{- define "email.serviceAccountName" -}}
+{{- if .Values.serviceAccount.create }}
+{{- default (include "email.fullname" .) .Values.serviceAccount.name }}
+{{- else }}
+{{- default "default" .Values.serviceAccount.name }}
+{{- end }}
+{{- end }}
diff --git a/astroshop-helm/email/templates/deployment.yaml b/astroshop-helm/email/templates/deployment.yaml
new file mode 100644
index 0000000..3bfcc8e
--- /dev/null
+++ b/astroshop-helm/email/templates/deployment.yaml
@@ -0,0 +1,66 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ namespace: {{ .Values.namespace }}
+ name: {{ include "email.fullname" . }}
+ labels:
+ app.kubernetes.io/component: emailservice
+ app.kubernetes.io/part-of: opentelemetry-demo
+ opentelemetry.io/name: {{ .Values.namespace }}-{{ include "email.fullname" . }}
+ {{- include "email.labels" . | nindent 4 }}
+spec:
+ replicas: {{ .Values.opentelemetryDemoEmailservice.replicas }}
+ revisionHistoryLimit: {{ .Values.opentelemetryDemoEmailservice.revisionHistoryLimit
+ }}
+ selector:
+ matchLabels:
+ opentelemetry.io/name: {{ .Values.namespace }}-{{ include "email.fullname" . }}
+ {{- include "email.selectorLabels" . | nindent 6 }}
+ template:
+ metadata:
+ labels:
+ app.kubernetes.io/component: emailservice
+ app.kubernetes.io/instance: opentelemetry-demo
+ app.kubernetes.io/name: {{ .Values.namespace }}-{{ include "email.fullname" . }}
+ opentelemetry.io/name: {{ .Values.namespace }}-{{ include "email.fullname" . }}
+ {{- include "email.selectorLabels" . | nindent 8 }}
+ spec:
+ containers:
+ - env:
+ - name: OTEL_SERVICE_NAME
+ valueFrom:
+ fieldRef:
+ apiVersion: v1
+ fieldPath: metadata.labels['app.kubernetes.io/component']
+ - name: OTEL_COLLECTOR_NAME
+ value: {{ quote .Values.opentelemetryDemoEmailservice.emailservice.env.otelCollectorName
+ }}
+ - name: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
+ value: {{ quote .Values.opentelemetryDemoEmailservice.emailservice.env.otelExporterOtlpMetricsTemporalityPreference
+ }}
+ - name: EMAIL_PORT
+ value: {{ quote .Values.opentelemetryDemoEmailservice.emailservice.env.emailServicePort
+ }}
+ - name: APP_ENV
+ value: {{ quote .Values.opentelemetryDemoEmailservice.emailservice.env.appEnv
+ }}
+ - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
+ value: {{ quote .Values.opentelemetryDemoEmailservice.emailservice.env.otelExporterOtlpTracesEndpoint
+ }}
+ - name: OTEL_RESOURCE_ATTRIBUTES
+ value: {{ quote .Values.opentelemetryDemoEmailservice.emailservice.env.otelResourceAttributes
+ }}
+ - name: KUBERNETES_CLUSTER_DOMAIN
+ value: {{ quote .Values.kubernetesClusterDomain }}
+ image: '{{ .Values.opentelemetryDemoEmailservice.emailservice.image.repository }}:{{
+ .Values.opentelemetryDemoEmailservice.emailservice.image.tag | default .Chart.AppVersion
+ }}'
+ imagePullPolicy: {{ .Values.opentelemetryDemoEmailservice.emailservice.imagePullPolicy
+ }}
+ name: emailservice
+ ports:
+ - containerPort: 8080
+ name: service
+ resources: {{- toYaml .Values.opentelemetryDemoEmailservice.emailservice.resources
+ | nindent 10 }}
+ serviceAccountName: {{ .Values.serviceAccount.name }}
diff --git a/astroshop-helm/email/templates/service.yaml b/astroshop-helm/email/templates/service.yaml
new file mode 100644
index 0000000..a32ae65
--- /dev/null
+++ b/astroshop-helm/email/templates/service.yaml
@@ -0,0 +1,16 @@
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ .Values.namespace }}-{{ include "email.fullname" . }}
+ labels:
+ app.kubernetes.io/component: emailservice
+ app.kubernetes.io/part-of: opentelemetry-demo
+ opentelemetry.io/name: {{ .Values.namespace }}-{{ include "email.fullname" . }}
+ {{- include "email.labels" . | nindent 4 }}
+spec:
+ type: {{ .Values.opentelemetryDemoEmailservice.type }}
+ selector:
+ opentelemetry.io/name: {{ .Values.namespace }}-{{ include "email.fullname" . }}
+ {{- include "email.selectorLabels" . | nindent 4 }}
+ ports:
+ {{- .Values.opentelemetryDemoEmailservice.ports | toYaml | nindent 2 }}
diff --git a/astroshop-helm/email/values.yaml b/astroshop-helm/email/values.yaml
new file mode 100644
index 0000000..5d2422e
--- /dev/null
+++ b/astroshop-helm/email/values.yaml
@@ -0,0 +1,31 @@
+namespace: opentelemetry-demo
+kubernetesClusterDomain: cluster.local
+
+serviceAccount:
+ name: opentelemetry-demo
+ version: ">=1.32.0-0"
+ partOf: opentelemetry-demo
+
+opentelemetryDemoEmailservice:
+ emailservice:
+ env:
+ appEnv: production
+ emailServicePort: "8080"
+ otelCollectorName: opentelemetry-demo-otelcol
+ otelExporterOtlpMetricsTemporalityPreference: cumulative
+ otelExporterOtlpTracesEndpoint: http://$(OTEL_COLLECTOR_NAME):4318/v1/traces
+ otelResourceAttributes: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=2.1.3
+ image:
+ repository: ghcr.io/open-telemetry/demo
+ tag: 2.1.3-email
+ imagePullPolicy: IfNotPresent
+ resources:
+ limits:
+ memory: 100Mi
+ ports:
+ - name: tcp-service
+ port: 8080
+ targetPort: 8080
+ replicas: 1
+ revisionHistoryLimit: 10
+ type: ClusterIP