Files
charts/bitnami/wavefront/templates/proxy-deployment.yaml
Carlos Rodríguez Hernández 4bca8a5de4 Remove Java args (#8421)
Signed-off-by: Carlos Rodriguez Hernandez <carlosrh@vmware.com>
2021-12-15 11:14:51 +01:00

205 lines
11 KiB
YAML

{{- if .Values.proxy.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: proxy
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
name: {{ template "common.names.fullname" . }}-proxy
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if .Values.proxy.updateStrategy }}
strategy: {{- toYaml .Values.proxy.updateStrategy | nindent 4 }}
{{- end }}
replicas: {{ .Values.proxy.replicas }}
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
app.kubernetes.io/component: proxy
template:
metadata:
{{- if .Values.proxy.podAnnotations }}
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.proxy.podAnnotations "context" $) | nindent 8 }}
{{- end }}
labels: {{- include "common.labels.standard" . | nindent 8 }}
app.kubernetes.io/component: proxy
{{- if .Values.proxy.podLabels }}
{{- include "common.tplvalues.render" (dict "value" .Values.proxy.podLabels "context" $) | nindent 8 }}
{{- end }}
spec:
{{- include "wavefront.imagePullSecrets" . | nindent 6 }}
{{- if .Values.proxy.hostAliases }}
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.proxy.hostAliases "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.proxy.affinity }}
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.proxy.affinity "context" $) | nindent 8 }}
{{- else }}
affinity:
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.proxy.podAffinityPreset "component" "proxy" "context" $) | nindent 10 }}
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.proxy.podAntiAffinityPreset "component" "proxy" "context" $) | nindent 10 }}
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.proxy.nodeAffinityPreset.type "key" .Values.proxy.nodeAffinityPreset.key "values" .Values.proxy.nodeAffinityPreset.values) | nindent 10 }}
{{- end }}
{{- if .Values.proxy.nodeSelector }}
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.proxy.nodeSelector "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.proxy.tolerations }}
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.proxy.tolerations "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.proxy.priorityClassName }}
priorityClassName: {{ .Values.proxy.priorityClassName | quote }}
{{- end }}
{{- if .Values.proxy.podSecurityContext.enabled }}
securityContext:
fsGroup: {{ .Values.proxy.podSecurityContext.fsGroup }}
{{- end }}
{{- if .Values.proxy.initContainers }}
initContainers: {{- include "common.tplvalues.render" (dict "value" .Values.proxy.initContainers "context" $) | nindent 8 }}
{{- end }}
containers:
- name: wavefront-proxy
image: {{ template "wavefront.proxy.image" . }}
imagePullPolicy: {{ .Values.proxy.image.pullPolicy }}
{{- if .Values.proxy.lifecycleHooks }}
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.proxy.lifecycleHooks "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.proxy.containerSecurityContext.enabled }}
securityContext:
runAsUser: {{ .Values.proxy.containerSecurityContext.runAsUser }}
runAsNonRoot: {{ .Values.proxy.containerSecurityContext.runAsNonRoot }}
{{- end }}
env:
- name: WAVEFRONT_URL
value: {{ .Values.wavefront.url }}/api
- name: WAVEFRONT_TOKEN
valueFrom:
secretKeyRef:
name: {{ include "wavefront.token.secretName" . }}
key: api-token
- name: WAVEFRONT_PROXY_ARGS
value: {{ .Values.proxy.args }}
{{- if .Values.proxy.tracePort }} --traceListenerPorts {{ .Values.proxy.tracePort }}{{- end -}}
{{- if .Values.proxy.jaegerPort }} --traceJaegerListenerPorts {{ .Values.proxy.jaegerPort }}{{- end -}}
{{- if .Values.proxy.traceJaegerHttpListenerPort }} --traceJaegerHttpListenerPorts {{ .Values.proxy.traceJaegerHttpListenerPort }}{{- end -}}
{{- if .Values.proxy.traceJaegerGrpcListenerPort }} --traceJaegerGrpcListenerPorts {{ .Values.proxy.traceJaegerGrpcListenerPort }}{{- end -}}
{{- if .Values.proxy.zipkinPort }} --traceZipkinListenerPorts {{ .Values.proxy.zipkinPort }}{{- end -}}
{{- if .Values.proxy.traceSamplingRate }} --traceSamplingRate {{ .Values.proxy.traceSamplingRate }}{{- end -}}
{{- if .Values.proxy.traceSamplingDuration }} --traceSamplingDuration {{ .Values.proxy.traceSamplingDuration }}{{- end -}}
{{- if .Values.proxy.traceJaegerApplicationName }} --traceJaegerApplicationName {{ .Values.proxy.traceJaegerApplicationName }}{{- end -}}
{{- if .Values.proxy.traceZipkinApplicationName }} --traceZipkinApplicationName {{ .Values.proxy.traceZipkinApplicationName }}{{- end -}}
{{- if .Values.proxy.histogramPort }} --histogramDistListenerPorts {{ .Values.proxy.histogramPort }}{{- end -}}
{{- if .Values.proxy.histogramMinutePort }} --histogramMinuteListenerPorts {{ .Values.proxy.histogramMinutePort }}{{- end -}}
{{- if .Values.proxy.histogramHourPort }} --histogramHourListenerPorts {{ .Values.proxy.histogramHourPort }}{{- end -}}
{{- if .Values.proxy.histogramDayPort }} --histogramDayListenerPorts {{ .Values.proxy.histogramDayPort }}{{- end -}}
{{- if .Values.proxy.deltaCounterPort }} --deltaCounterPorts {{ .Values.proxy.deltaCounterPort }}{{- end -}}
{{- if .Values.proxy.preprocessor }} --preprocessorConfigFile /etc/wavefront/wavefront-proxy/preprocessor/rules.yaml{{- end -}}
{{- if .Values.proxy.heap }}
- name: JAVA_HEAP_USAGE
value: {{ .Values.proxy.heap | quote }}
{{- end }}
{{- if .Values.proxy.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.proxy.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
envFrom:
{{- if .Values.proxy.extraEnvVarsCM }}
- configMapRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.proxy.extraEnvVarsCM "context" $) }}
{{- end }}
{{- if .Values.proxy.extraEnvVarsSecret }}
- secretRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.proxy.extraEnvVarsSecret "context" $) }}
{{- end }}
ports:
- containerPort: {{ .Values.proxy.port }}
protocol: TCP
{{- if .Values.proxy.tracePort }}
- containerPort: {{ .Values.proxy.tracePort }}
protocol: TCP
{{- end }}
{{- if .Values.proxy.jaegerPort }}
- containerPort: {{ .Values.proxy.jaegerPort }}
protocol: TCP
{{- end }}
{{- if .Values.proxy.traceJaegerHttpListenerPort }}
- containerPort: {{ .Values.proxy.traceJaegerHttpListenerPort }}
protocol: TCP
{{- end }}
{{- if .Values.proxy.traceJaegerGrpcListenerPort }}
- containerPort: {{ .Values.proxy.traceJaegerGrpcListenerPort }}
protocol: TCP
{{- end }}
{{- if .Values.proxy.zipkinPort }}
- containerPort: {{ .Values.proxy.zipkinPort }}
protocol: TCP
{{- end }}
{{- if .Values.proxy.histogramPort }}
- containerPort: {{ .Values.proxy.histogramPort }}
protocol: TCP
{{- end }}
{{- if .Values.proxy.histogramMinutePort }}
- containerPort: {{ .Values.proxy.histogramMinutePort }}
protocol: TCP
{{- end }}
{{- if .Values.proxy.histogramHourPort }}
- containerPort: {{ .Values.proxy.histogramHourPort }}
protocol: TCP
{{- end }}
{{- if .Values.proxy.histogramDayPort }}
- containerPort: {{ .Values.proxy.histogramDayPort }}
protocol: TCP
{{- end }}
{{- if .Values.proxy.deltaCounterPort }}
- containerPort: {{ .Values.proxy.deltaCounterPort }}
protocol: TCP
{{- end }}
{{- if .Values.proxy.resources }}
resources: {{- toYaml .Values.proxy.resources | nindent 12 }}
{{- end }}
{{- if .Values.proxy.livenessProbe.enabled }}
livenessProbe:
tcpSocket:
port: {{ .Values.proxy.port }}
initialDelaySeconds: {{ .Values.proxy.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.proxy.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.proxy.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.proxy.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.proxy.livenessProbe.failureThreshold }}
{{- else if .Values.proxy.customLivenessProbe }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.proxy.customLivenessProbe "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.proxy.readinessProbe.enabled }}
readinessProbe:
tcpSocket:
port: {{ .Values.proxy.port }}
initialDelaySeconds: {{ .Values.proxy.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.proxy.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.proxy.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.proxy.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.proxy.readinessProbe.failureThreshold }}
{{- else if .Values.proxy.customReadinessProbe }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.proxy.customReadinessProbe "context" $) | nindent 12 }}
{{- end }}
volumeMounts:
{{- if .Values.proxy.preprocessor }}
- name: preprocessor
mountPath: /etc/wavefront/wavefront-proxy/preprocessor
{{- end }}
{{- if .Values.proxy.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.proxy.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.proxy.sidecars }}
{{- include "common.tplvalues.render" ( dict "value" .Values.proxy.sidecars "context" $) | nindent 8 }}
{{- end }}
volumes:
{{- if .Values.proxy.preprocessor }}
- name: preprocessor
configMap:
name: {{ include "wavefront.proxy.configmapName" . }}
{{- end }}
{{- if .Values.proxy.extraVolumes }}
{{- include "common.tplvalues.render" (dict "value" .Values.proxy.extraVolumes "context" $) | nindent 8 }}
{{- end }}
{{- end }}