diff options
Diffstat (limited to 'astroshop-helm/currency')
| -rw-r--r-- | astroshop-helm/currency/.helmignore | 23 | ||||
| -rw-r--r-- | astroshop-helm/currency/Chart.yaml | 22 | ||||
| -rw-r--r-- | astroshop-helm/currency/templates/_helpers.tpl | 62 | ||||
| -rw-r--r-- | astroshop-helm/currency/templates/deployment.yaml | 66 | ||||
| -rw-r--r-- | astroshop-helm/currency/templates/service.yaml | 16 | ||||
| -rw-r--r-- | astroshop-helm/currency/values.yaml | 31 |
6 files changed, 220 insertions, 0 deletions
diff --git a/astroshop-helm/currency/.helmignore b/astroshop-helm/currency/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/astroshop-helm/currency/.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/currency/Chart.yaml b/astroshop-helm/currency/Chart.yaml new file mode 100644 index 0000000..503686d --- /dev/null +++ b/astroshop-helm/currency/Chart.yaml @@ -0,0 +1,22 @@ +apiVersion: v2 +name: currency +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/currency/templates/_helpers.tpl b/astroshop-helm/currency/templates/_helpers.tpl new file mode 100644 index 0000000..0ac2377 --- /dev/null +++ b/astroshop-helm/currency/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "currency.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 "currency.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 "currency.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "currency.labels" -}} +helm.sh/chart: {{ include "currency.chart" . }} +{{ include "currency.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "currency.selectorLabels" -}} +app.kubernetes.io/name: {{ include "currency.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "currency.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "currency.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/astroshop-helm/currency/templates/deployment.yaml b/astroshop-helm/currency/templates/deployment.yaml new file mode 100644 index 0000000..6d950f1 --- /dev/null +++ b/astroshop-helm/currency/templates/deployment.yaml @@ -0,0 +1,66 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + namespace: {{ .Values.namespace }} + name: {{ include "currency.fullname" . }} + labels: + app.kubernetes.io/component: currencyservice + app.kubernetes.io/part-of: opentelemetry-demo + opentelemetry.io/name: {{ .Values.namespace }}-{{ include "currency.fullname" . }} + {{- include "currency.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.opentelemetryDemoCurrencyservice.replicas }} + revisionHistoryLimit: {{ .Values.opentelemetryDemoCurrencyservice.revisionHistoryLimit + }} + selector: + matchLabels: + opentelemetry.io/name: {{ .Values.namespace }}-{{ include "currency.fullname" . }} + {{- include "currency.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + app.kubernetes.io/component: currencyservice + app.kubernetes.io/instance: opentelemetry-demo + app.kubernetes.io/name: {{ .Values.namespace }}-{{ include "currency.fullname" . }} + opentelemetry.io/name: {{ .Values.namespace }}-{{ include "currency.fullname" . }} + {{- include "currency.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.opentelemetryDemoCurrencyservice.currencyservice.env.otelCollectorName + }} + - name: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + value: {{ quote .Values.opentelemetryDemoCurrencyservice.currencyservice.env.otelExporterOtlpMetricsTemporalityPreference + }} + - name: CURRENCY_PORT + value: {{ quote .Values.opentelemetryDemoCurrencyservice.currencyservice.env.currencyServicePort + }} + - name: OTEL_EXPORTER_OTLP_ENDPOINT + value: {{ quote .Values.opentelemetryDemoCurrencyservice.currencyservice.env.otelExporterOtlpEndpoint + }} + - name: VERSION + value: {{ quote .Values.opentelemetryDemoCurrencyservice.currencyservice.env.version + }} + - name: OTEL_RESOURCE_ATTRIBUTES + value: {{ quote .Values.opentelemetryDemoCurrencyservice.currencyservice.env.otelResourceAttributes + }} + - name: KUBERNETES_CLUSTER_DOMAIN + value: {{ quote .Values.kubernetesClusterDomain }} + image: '{{ .Values.opentelemetryDemoCurrencyservice.currencyservice.image.repository + }}:{{ .Values.opentelemetryDemoCurrencyservice.currencyservice.image.tag | default + .Chart.AppVersion }}' + imagePullPolicy: {{ .Values.opentelemetryDemoCurrencyservice.currencyservice.imagePullPolicy + }} + name: currencyservice + ports: + - containerPort: 8080 + name: service + resources: {{- toYaml .Values.opentelemetryDemoCurrencyservice.currencyservice.resources + | nindent 10 }} + serviceAccountName: {{ .Values.serviceAccount.name }} diff --git a/astroshop-helm/currency/templates/service.yaml b/astroshop-helm/currency/templates/service.yaml new file mode 100644 index 0000000..51363a4 --- /dev/null +++ b/astroshop-helm/currency/templates/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.namespace }}-{{ include "currency.fullname" . }} + labels: + app.kubernetes.io/component: currencyservice + app.kubernetes.io/part-of: opentelemetry-demo + opentelemetry.io/name: {{ .Values.namespace }}-{{ include "currency.fullname" . }} + {{- include "currency.labels" . | nindent 4 }} +spec: + type: {{ .Values.opentelemetryDemoCurrencyservice.type }} + selector: + opentelemetry.io/name: {{ .Values.namespace }}-{{ include "currency.fullname" . }} + {{- include "currency.selectorLabels" . | nindent 4 }} + ports: + {{- .Values.opentelemetryDemoCurrencyservice.ports | toYaml | nindent 2 }} diff --git a/astroshop-helm/currency/values.yaml b/astroshop-helm/currency/values.yaml new file mode 100644 index 0000000..4e82b50 --- /dev/null +++ b/astroshop-helm/currency/values.yaml @@ -0,0 +1,31 @@ +namespace: opentelemetry-demo +kubernetesClusterDomain: cluster.local + +serviceAccount: + name: opentelemetry-demo + version: ">=1.32.0-0" + partOf: opentelemetry-demo + +opentelemetryDemoCurrencyservice: + currencyservice: + env: + currencyServicePort: "8080" + otelCollectorName: opentelemetry-demo-otelcol + otelExporterOtlpEndpoint: http://$(OTEL_COLLECTOR_NAME):4317 + otelExporterOtlpMetricsTemporalityPreference: cumulative + otelResourceAttributes: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=2.1.3 + version: 2.1.3 + image: + repository: ghcr.io/open-telemetry/demo + tag: 2.1.3-currency + imagePullPolicy: IfNotPresent + resources: + limits: + memory: 20Mi + ports: + - name: tcp-service + port: 8080 + targetPort: 8080 + replicas: 1 + revisionHistoryLimit: 10 + type: ClusterIP |
