Files
deprecated-helm-charts/stable/anchore-engine/templates/analyzer_deployment.yaml
T
Gabor Kozma 2733615628 [stable/anchore-engine] Small improvement about secret end env (#12996)
* extraEnv vars change

Signed-off-by: Gabor Kozma <gabo@kozmagabor.com>

* bump version

Signed-off-by: Gabor Kozma <gabo@kozmagabor.com>

* add existing secret support

Signed-off-by: Gabor Kozma <gabo@kozmagabor.com>

* extraEnv map to array in values.yaml

Signed-off-by: Gabor Kozma <gabo@kozmagabor.com>
2019-04-22 10:39:46 -07:00

113 lines
3.9 KiB
YAML

{{- $component := "analyzer" -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ template "anchore-engine.analyzer.fullname" . }}"
labels:
app: "{{ template "anchore-engine.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
component: {{ $component }}
spec:
selector:
matchLabels:
app: "{{ template "anchore-engine.fullname" . }}"
component: {{ $component }}
replicas: {{ .Values.anchoreAnalyzer.replicaCount }}
template:
metadata:
labels:
app: "{{ template "anchore-engine.fullname" . }}"
component: {{ $component }}
{{- if .Values.anchoreAnalyzer.annotations }}
annotations:
{{ toYaml .Values.anchoreAnalyzer.annotations | indent 8 }}
{{- end }}
spec:
containers:
{{- if .Values.cloudsql.enabled }}
- name: cloudsql-proxy
image: {{ .Values.cloudsql.image.repository }}:{{ .Values.cloudsql.image.tag }}
imagePullPolicy: {{ .Values.cloudsql.image.pullPolicy }}
command: ["/cloud_sql_proxy"]
args: ["-instances={{ .Values.cloudsql.instance }}=tcp:5432"]
{{- end }}
- name: {{ .Chart.Name }}-{{ $component }}
image: {{ .Values.anchoreGlobal.image }}
imagePullPolicy: {{ .Values.anchoreGlobal.imagePullPolicy }}
command: ["/usr/local/bin/anchore-manager"]
args: ["service", "start", "analyzer"]
envFrom:
- secretRef:
name: {{ default (include "anchore-engine.fullname" .) .Values.anchoreGlobal.existingSecret }}
- configMapRef:
name: {{ template "anchore-engine.fullname" . }}
env:
{{- with .Values.anchoreGlobal.extraEnv }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.anchoreAnalyzer.extraEnv }}
{{- toYaml . | nindent 8 }}
{{- end }}
- name: ANCHORE_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
ports:
- name: analyzer-api
containerPort: {{ .Values.anchoreAnalyzer.containerPort }}
volumeMounts:
- name: config-volume
mountPath: /config/config.yaml
subPath: config.yaml
{{- if .Values.anchoreGlobal.internalServicesSslEnabled }}
- name: certs
mountPath: {{ default "/certs" .Values.anchoreGlobal.internalServicesSsl.certDir }}
readOnly: true
{{- end }}
- name: analysis-scratch
mountPath: {{ .Values.anchoreAnalyzer.scratchVolume.mountPath }}
livenessProbe:
httpGet:
path: /health
port: analyzer-api
initialDelaySeconds: 120
timeoutSeconds: 10
periodSeconds: 10
failureThreshold: 6
successThreshold: 1
readinessProbe:
httpGet:
path: /health
port: analyzer-api
timeoutSeconds: 10
periodSeconds: 10
failureThreshold: 3
successThreshold: 1
resources:
{{ toYaml .Values.anchoreAnalyzer.resources | indent 10 }}
volumes:
- name: config-volume
configMap:
name: {{ template "anchore-engine.fullname" .}}
{{- if .Values.anchoreGlobal.internalServicesSslEnabled }}
- name: certs
secret:
secretName: {{ .Values.anchoreGlobal.internalServicesSsl.certSecret }}
{{- end }}
- name: analysis-scratch
{{ toYaml .Values.anchoreAnalyzer.scratchVolume.details | indent 10 }}
{{- if .Values.anchoreAnalyzer.nodeSelector }}
nodeSelector:
{{ toYaml .Values.anchoreAnalyzer.nodeSelector | indent 8 }}
{{- end }}
{{- with .Values.anchoreAnalyzer.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.anchoreAnalyzer.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}