Skip to content

Commit

Permalink
feat: NVSHAS-9287 gen cert on fresh installation
Browse files Browse the repository at this point in the history
Generate internal certificate for fresh installation.
  • Loading branch information
holyspectral committed Aug 7, 2024
1 parent cb69078 commit deb64e3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
8 changes: 6 additions & 2 deletions charts/core/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ spec:
env:
- name: OVERRIDE_CHECKSUM
value: {{ dict "image" (include "neuvector.controller.image" .) "internal" .Values.internal "certupgrader" .Values.controller.certupgrader | toJson | sha256sum }}
{{- if and .Values.internal.autoRotateCert (not $pre540) }}
- name: ENABLE_ROTATION
value: "1"
{{- end }}
{{- with .Values.controller.certupgrader.env }}
{{- toYaml . | nindent 12 }}
{{- end }}
Expand Down Expand Up @@ -230,7 +234,7 @@ spec:
subPath: {{ .Values.controller.internal.certificate.caFile }}
name: internal-cert
readOnly: true
{{- else if and .Values.internal.autoGenerateCert (not $pre540) }}
{{- else if and .Values.internal.autoRotateCert (not $pre540) }}
- mountPath: /etc/neuvector/certs/internal/
name: internal-cert-dir
{{- end }}
Expand Down Expand Up @@ -296,7 +300,7 @@ spec:
- name: internal-cert
secret:
secretName: {{ .Values.controller.internal.certificate.secret }}
{{- else if and .Values.internal.autoGenerateCert (not $pre540) }}
{{- else if and .Values.internal.autoRotateCert (not $pre540) }}
- name: internal-cert-dir
emptyDir:
sizeLimit: 50Mi
Expand Down
4 changes: 2 additions & 2 deletions charts/core/templates/enforcer-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ spec:
subPath: {{ .Values.enforcer.internal.certificate.caFile }}
name: internal-cert
readOnly: true
{{- else if and .Values.internal.autoGenerateCert (not $pre540) }}
{{- else if and .Values.internal.autoRotateCert (not $pre540) }}
- mountPath: /etc/neuvector/certs/internal/
name: internal-cert-dir
{{- end }}
Expand Down Expand Up @@ -204,7 +204,7 @@ spec:
- name: internal-cert
secret:
secretName: {{ .Values.enforcer.internal.certificate.secret }}
{{- else if and .Values.internal.autoGenerateCert (not $pre540) }}
{{- else if and .Values.internal.autoRotateCert (not $pre540) }}
- name: internal-cert-dir
emptyDir:
sizeLimit: 50Mi
Expand Down
4 changes: 2 additions & 2 deletions charts/core/templates/registry-adapter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ spec:
subPath: {{ .Values.cve.adapter.internal.certificate.caFile }}
name: internal-cert
readOnly: true
{{- else if and .Values.internal.autoGenerateCert (not $pre540) }}
{{- else if and .Values.internal.autoRotateCert (not $pre540) }}
- mountPath: /etc/neuvector/certs/internal/
name: internal-cert-dir
{{- end }}
Expand All @@ -168,7 +168,7 @@ spec:
- name: internal-cert
secret:
secretName: {{ .Values.cve.adapter.internal.certificate.secret }}
{{- else if and .Values.internal.autoGenerateCert (not $pre540) }}
{{- else if and .Values.internal.autoRotateCert (not $pre540) }}
- name: internal-cert-dir
emptyDir:
sizeLimit: 50Mi
Expand Down
4 changes: 2 additions & 2 deletions charts/core/templates/scanner-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ spec:
subPath: {{ .Values.cve.scanner.internal.certificate.caFile }}
name: internal-cert
readOnly: true
{{- else if and .Values.internal.autoGenerateCert (not $pre540) }}
{{- else if and .Values.internal.autoRotateCert (not $pre540) }}
- mountPath: /etc/neuvector/certs/internal/
name: internal-cert-dir
{{- end }}
Expand All @@ -132,7 +132,7 @@ spec:
- name: internal-cert
secret:
secretName: {{ .Values.cve.scanner.internal.certificate.secret }}
{{- else if and .Values.internal.autoGenerateCert (not $pre540) }}
{{- else if and .Values.internal.autoRotateCert (not $pre540) }}
- name: internal-cert-dir
emptyDir:
sizeLimit: 50Mi
Expand Down
3 changes: 2 additions & 1 deletion charts/core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ internal:
certmanager: # enable when cert-manager is installed for the internal certificates
enabled: false
secretname: neuvector-internal
autoGenerateCert: false
autoGenerateCert: true
autoRotateCert: false

controller:
# If false, controller will not be installed
Expand Down

0 comments on commit deb64e3

Please sign in to comment.