|
| 1 | + |
| 2 | +{{- if .Values.networkAnalyzer.enabled }} |
| 3 | +apiVersion: batch/v1 |
| 4 | +kind: Job |
| 5 | +metadata: |
| 6 | + {{- if .Values.networkAnalyzer.rollingUpdate }} |
| 7 | + name: "{{ .Values.networkAnalyzer.name }}-{{ now | unixEpoch }}" |
| 8 | + {{else}} |
| 9 | + name: "{{ .Values.networkAnalyzer.name }}" |
| 10 | + {{- end }} |
| 11 | + namespace: {{ .Release.Namespace | quote }} |
| 12 | + labels: |
| 13 | + {{- include "wiz-outpost-configuration.labels" . | nindent 4 }} |
| 14 | + annotations: |
| 15 | + "meta.helm.sh/release-name": "{{ .Release.Name }}" |
| 16 | + "meta.helm.sh/release-namespace": "{{ .Release.Namespace }}" |
| 17 | + "helm.sh/hook": "pre-install,pre-upgrade" |
| 18 | + "helm.sh/hook-delete-policy": "before-hook-creation" |
| 19 | +spec: |
| 20 | + ttlSecondsAfterFinished: 0 |
| 21 | + manualSelector: true |
| 22 | + selector: |
| 23 | + matchLabels: |
| 24 | + {{- include "wiz-outpost-configuration.selectorLabels" . | nindent 6 }} |
| 25 | + backoffLimit: 1 |
| 26 | + template: |
| 27 | + metadata: |
| 28 | + {{- with (coalesce .Values.podAnnotations) }} |
| 29 | + annotations: |
| 30 | + {{- toYaml . | nindent 8 }} |
| 31 | + {{- end }} |
| 32 | + labels: |
| 33 | + {{- include "wiz-outpost-configuration.labels" . | nindent 8 }} |
| 34 | + spec: |
| 35 | + {{- with .Values.imagePullSecrets }} |
| 36 | + imagePullSecrets: |
| 37 | + {{- toYaml . | nindent 8 }} |
| 38 | + {{- end }} |
| 39 | + serviceAccountName: {{ include "wiz-outpost-configuration.serviceAccountName" . | trim }} |
| 40 | + restartPolicy: "Never" |
| 41 | + securityContext: |
| 42 | + fsGroup: 1000 |
| 43 | + supplementalGroups: |
| 44 | + - 1000 |
| 45 | + containers: |
| 46 | + - name: wiz-network-analyzer |
| 47 | + securityContext: |
| 48 | + readOnlyRootFilesystem: true |
| 49 | + runAsNonRoot: true |
| 50 | + runAsUser: 1000 |
| 51 | + runAsGroup: 1000 |
| 52 | + privileged: false |
| 53 | + allowPrivilegeEscalation: false |
| 54 | + image: "{{ .Values.networkAnalyzer.image.repository }}/{{ .Values.networkAnalyzer.image.namePrefix}}:{{ .Values.networkAnalyzer.image.tag | default .Chart.AppVersion }}" |
| 55 | + imagePullPolicy: {{ .Values.networkAnalyzer.image.pullPolicy }} |
| 56 | + command: |
| 57 | + - "wiz-network-analyzer" |
| 58 | + args: |
| 59 | + - analyze |
| 60 | + - --output |
| 61 | + - /tmp |
| 62 | + {{- with .Values.networkAnalyzer.outpostId }} |
| 63 | + - --outpost-id |
| 64 | + - {{ . | quote }} |
| 65 | + {{- end }} |
| 66 | + - --region |
| 67 | + - {{ .Values.networkAnalyzer.wizRegion }} |
| 68 | + {{- with .Values.networkAnalyzer.forceHttp1 }} |
| 69 | + - --http1 |
| 70 | + {{- end }} |
| 71 | + env: |
| 72 | + - name: LOG_LEVEL |
| 73 | + value: "info" |
| 74 | + {{- with .Values.networkAnalyzer.env }} |
| 75 | + - name: ENV |
| 76 | + value: {{ . | quote }} |
| 77 | + {{- end}} |
| 78 | + {{- with .Values.networkAnalyzer.outpostId }} |
| 79 | + - name: WIZ_OUTPOST_ID |
| 80 | + value: {{ . | quote }} |
| 81 | + {{- end }} |
| 82 | + - name: WIZ_CLIENT_ID |
| 83 | + valueFrom: |
| 84 | + secretKeyRef: |
| 85 | + name: {{ .Values.agentCredsSecretName }} |
| 86 | + key: clientId |
| 87 | + - name: WIZ_CLIENT_SECRET |
| 88 | + valueFrom: |
| 89 | + secretKeyRef: |
| 90 | + name: {{ .Values.agentCredsSecretName }} |
| 91 | + key: clientSecret |
| 92 | + - name: WIZ_DATA_CENTER |
| 93 | + value: {{ .Values.networkAnalyzer.dataCenter | quote }} |
| 94 | + - name: http_proxy |
| 95 | + valueFrom: |
| 96 | + secretKeyRef: |
| 97 | + name: {{ .Values.httpProxyConfiguration.name | quote }} |
| 98 | + key: "httpProxy" |
| 99 | + optional: true |
| 100 | + - name: HTTP_PROXY |
| 101 | + valueFrom: |
| 102 | + secretKeyRef: |
| 103 | + name: {{ .Values.httpProxyConfiguration.name | quote }} |
| 104 | + key: "httpProxy" |
| 105 | + optional: true |
| 106 | + - name: https_proxy |
| 107 | + valueFrom: |
| 108 | + secretKeyRef: |
| 109 | + name: {{ .Values.httpProxyConfiguration.name | quote }} |
| 110 | + key: "httpsProxy" |
| 111 | + optional: true |
| 112 | + - name: HTTPS_PROXY |
| 113 | + valueFrom: |
| 114 | + secretKeyRef: |
| 115 | + name: {{ .Values.httpProxyConfiguration.name | quote }} |
| 116 | + key: "httpsProxy" |
| 117 | + optional: true |
| 118 | + - name: no_proxy |
| 119 | + valueFrom: |
| 120 | + secretKeyRef: |
| 121 | + name: {{ .Values.httpProxyConfiguration.name | quote }} |
| 122 | + key: "noProxyAddress" |
| 123 | + optional: true |
| 124 | + - name: NO_PROXY |
| 125 | + valueFrom: |
| 126 | + secretKeyRef: |
| 127 | + name: {{ .Values.httpProxyConfiguration.name | quote }} |
| 128 | + key: "noProxyAddress" |
| 129 | + optional: true |
| 130 | + - name: SSL_CERT_DIR |
| 131 | + value: "/usr/local/share/ca-certificates/:/certificates/" |
| 132 | + volumeMounts: |
| 133 | + - mountPath: /tmp |
| 134 | + name: tmp-dir |
| 135 | + {{- if not .Values.networkAnalyzer.outpostId }} |
| 136 | + - name: secrets |
| 137 | + mountPath: /mnt/secrets/ |
| 138 | + readOnly: true |
| 139 | + {{- end }} |
| 140 | + resources: |
| 141 | + {{- toYaml .Values.networkAnalyzer.resources | nindent 12 }} |
| 142 | + volumes: |
| 143 | + - name: tmp-dir |
| 144 | + emptyDir: { } |
| 145 | + - name: ca-certificate |
| 146 | + secret: |
| 147 | + defaultMode: 420 |
| 148 | + secretName: {{ .Values.httpProxyConfiguration.name | quote }} |
| 149 | + items: |
| 150 | + - key: caCertificate |
| 151 | + path: root.crt |
| 152 | + optional: true |
| 153 | + {{- if not .Values.networkAnalyzer.outpostId }} |
| 154 | + - name: secrets |
| 155 | + projected: |
| 156 | + sources: |
| 157 | + - secret: |
| 158 | + name: {{ .Values.agentCredsSecretName }} |
| 159 | + items: |
| 160 | + - key: privateKey |
| 161 | + path: WIZ_PRIVATE_KEY |
| 162 | + {{- end}} |
| 163 | +{{- end}} |
0 commit comments