-
Notifications
You must be signed in to change notification settings - Fork 5
/
adservice.yaml
79 lines (79 loc) · 3.11 KB
/
adservice.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{{- if .Values.extensions.adservice.enabled -}}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "otel-demo.name" . }}-adservice
labels:
{{- include "otel-demo.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
app.kubernetes.io/component: adservice
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/name: {{ .Release.Name }}-adservice
template:
metadata:
labels:
opentelemetry.io/name: {{ .Release.Name }}-adservice
app.kubernetes.io/component: adservice
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/name: {{ .Release.Name }}-adservice
{{- if .Values.global.opentelemetryDemo.istioSidecar.enabled }}
sidecar.istio.io/inject: "true"
{{- end }}
{{- if .Values.extensions.adservice.podAnnotations }}
annotations:
{{- toYaml .Values.extensions.adservice.podAnnotations | nindent 8 }}
{{- end }}
spec:
containers:
- name: adservice
image: "{{ .Values.extensions.adservice.image.registry }}/{{ .Values.extensions.adservice.image.repository }}:{{ .Values.extensions.adservice.image.tag }}"
imagePullPolicy: {{ .Values.extensions.adservice.image.pullPolicy }}
{{- if .Values.extensions.adservice.ports }}
ports:
{{- range $port := .Values.extensions.adservice.ports }}
- name: {{ $port.name}}
containerPort: {{ $port.containerPort }}
protocol: {{ $port.protocol }}
{{- end }}
{{- end }}
env:
{{- with .Values.extensions.adservice.env }}
{{- . | toYaml | nindent 12 }}
{{- end }}
- name: JAVA_OPTS
value: '{{ include "java.adservice.opt" . }}'
- name: DATA_SERVICE_ADDR
value: '{{ include "otel-demo.name" . }}-dataservice:8080'
- name: OTEL_RESOURCE_ATTRIBUTES
value: k8s.namespace.name=$(K8S_NAMESPACE),k8s.node.name=$(OTEL_RESOURCE_ATTRIBUTES_NODE_NAME),k8s.pod.name=$(OTEL_RESOURCE_ATTRIBUTES_POD_NAME),k8s.pod.uid=$(OTEL_RESOURCE_ATTRIBUTES_POD_UID),skoala.registry={{ .Values.global.microservices.nacos.registryName }},nacos.namespaceid={{ .Values.global.microservices.nacos.registryNamespace }},nacos.groupname={{ .Values.global.microservices.nacos.registryServiceGroup }}
resources:
requests:
cpu: "0.2"
memory: 100Mi
limits:
cpu: "1"
memory: 1024Mi
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "otel-demo.name" . }}-adservice
labels:
{{- include "otel-demo.labels" . | nindent 4 }}
spec:
type: {{ .Values.extensions.adservice.servcie.type | default "ClusterIP" }}
{{- if .Values.extensions.adservice.ports }}
ports:
{{- range $port := .Values.extensions.adservice.ports }}
- name: {{ $port.name}}
port: {{ $port.containerPort }}
protocol: {{ $port.protocol }}
targetPort: {{ $port.containerPort }}
{{- end }}
{{- end }}
selector:
app.kubernetes.io/name: {{ .Release.Name }}-adservice
{{- end }}