-
Notifications
You must be signed in to change notification settings - Fork 201
/
job.yaml
149 lines (149 loc) · 5.2 KB
/
job.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
{{- if (include "newrelic-pixie.areValuesValid" .) }}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ template "newrelic-pixie.fullname" . }}
namespace: {{ template "newrelic-pixie.namespace" . }}
labels:
{{- include "newrelic-pixie.labels" . | nindent 4 }}
spec:
backoffLimit: 4
template:
metadata:
labels:
app.kubernetes.io/name: {{ template "newrelic-pixie.name" . }}
release: {{.Release.Name }}
spec:
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{- toYaml .Values.image.pullSecrets | nindent 8 }}
{{- end }}
restartPolicy: Never
initContainers:
- name: cluster-registration-wait
image: gcr.io/pixie-oss/pixie-dev-public/curl:1.0
command: ['sh', '-c', 'set -x;
URL="https://${SERVICE_NAME}:${SERVICE_PORT}/readyz";
until [ $(curl -m 0.5 -s -o /dev/null -w "%{http_code}" -k ${URL}) -eq 200 ]; do
echo "Waiting for cluster registration. If this takes too long check the vizier-cloud-connector logs."
sleep 2;
done;
']
env:
# The name of the Pixie service which connects to Pixie Cloud for cluster registration.
- name: SERVICE_NAME
value: "vizier-cloud-connector-svc"
- name: SERVICE_PORT
value: "50800"
containers:
- name: {{ template "newrelic-pixie.name" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
env:
- name: CLUSTER_NAME
value: {{ template "newrelic-pixie.cluster" . }}
- name: NR_LICENSE_KEY
valueFrom:
secretKeyRef:
{{- if (include "newrelic-pixie.licenseKey" .) }}
name: {{ template "newrelic-pixie.fullname" . }}-secrets
key: newrelicLicenseKey
{{- else }}
name: {{ include "newrelic-pixie.customSecretName" . }}
key: {{ include "newrelic-pixie.customSecretLicenseKey" . }}
{{- end }}
- name: PIXIE_API_KEY
valueFrom:
secretKeyRef:
{{- if (include "newrelic-pixie.apiKey" .) }}
name: {{ template "newrelic-pixie.fullname" . }}-secrets
key: pixieApiKey
{{- else }}
name: {{ include "newrelic-pixie.customSecretApiKeyName" . }}
key: {{ include "newrelic-pixie.customSecretApiKeyKey" . }}
{{- end }}
- name: PIXIE_CLUSTER_ID
{{- if .Values.clusterId }}
value: {{ .Values.clusterId -}}
{{- else }}
valueFrom:
secretKeyRef:
key: cluster-id
name: pl-cluster-secrets
{{- end }}
{{- if .Values.verbose }}
- name: VERBOSE
value: "true"
{{- end }}
{{- if (include "newrelic-pixie.lowDataMode" .) }}
- name: COLLECT_INTERVAL_SEC
value: "15"
- name: HTTP_SPAN_LIMIT
value: "750"
- name: DB_SPAN_LIMIT
value: "250"
{{- else }}
- name: COLLECT_INTERVAL_SEC
value: "10"
- name: HTTP_SPAN_LIMIT
value: "1500"
- name: DB_SPAN_LIMIT
value: "500"
{{- end }}
{{- if (include "newrelic-pixie.nrStaging" .) }}
- name: NR_OTLP_HOST
value: "staging-otlp.nr-data.net:4317"
{{- end }}
{{- if or .Values.endpoint (include "newrelic-pixie.nrStaging" .) }}
- name: PIXIE_ENDPOINT
{{- if .Values.endpoint }}
value: {{ .Values.endpoint | quote }}
{{- else }}
value: "staging.withpixie.dev:443"
{{- end }}
{{- end }}
{{- if .Values.proxy }}
- name: HTTP_PROXY
value: {{ .Values.proxy | quote }}
- name: HTTPS_PROXY
value: {{ .Values.proxy | quote }}
{{- end }}
{{- if .Values.excludePodsRegex }}
- name: EXCLUDE_PODS_REGEX
value: {{ .Values.excludePodsRegex | quote }}
{{- end }}
{{- if .Values.excludeNamespacesRegex }}
- name: EXCLUDE_NAMESPACES_REGEX
value: {{ .Values.excludeNamespacesRegex | quote }}
{{- end }}
{{- if .Values.resources }}
resources:
{{- toYaml .Values.resources | nindent 10 }}
{{- end }}
{{- if or .Values.customScriptsConfigMap .Values.customScripts }}
volumeMounts:
- name: scripts
mountPath: "/scripts"
readOnly: true
volumes:
- name: scripts
configMap:
{{- if .Values.customScriptsConfigMap }}
name: {{ .Values.customScriptsConfigMap }}
{{- else }}
name: {{ template "newrelic-pixie.fullname" . }}-scripts
{{- end}}
{{- end }}
{{- if $.Values.nodeSelector }}
nodeSelector:
{{- toYaml $.Values.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{- toYaml .Values.tolerations | nindent 8 }}
{{- end }}
{{- if .Values.affinity }}
affinity:
{{- toYaml .Values.affinity | nindent 8 }}
{{- end }}
{{- end }}