Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[registry-scanner] feat: allow specify existing or external secrets instead of creating a new one #146

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions charts/registry-scanner/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
This file documents all notable changes to Sysdig Registry Scanner. The release
numbering uses [semantic versioning](http://semver.org).

## v0.0.7

### Minor changes

* New option `existingSecretName` to use existing or external secret

## v0.0.5

### Minor changes
Expand Down
2 changes: 1 addition & 1 deletion charts/registry-scanner/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Sysdig Registry Scanner
type: application
home: https://sysdiglabs.github.io/registry-scanner/
icon: https://478h5m1yrfsa3bbe262u7muv-wpengine.netdna-ssl.com/wp-content/uploads/2019/02/Shovel_600px.png
version: 0.0.6
version: 0.0.7
appVersion: 0.0.1
maintainers:
- name: airadier
Expand Down
1 change: 1 addition & 0 deletions charts/registry-scanner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ The following table lists the configurable parameters of the Sysdig Registry Sca
| `imagePullSecrets` | The image pull secrets | `[]` |
| `nameOverride` | Chart name override | ` ` |
| `fullnameOverride` | Chart full name override | ` ` |
| `existingSecretName` | Name of a Kubernetes secret containing an 'secureAPIToken', 'registryUser', and 'registryPassword' entries | ` ` |
| `podAnnotations` | Registry scanner pod annotations | `{}` |
| `podSecurityContext` | Security context for Registry Scanner pod | `{}` |
| `securityContext` | Security context for Registry Scanner container | `{}` |
Expand Down
12 changes: 12 additions & 0 deletions charts/registry-scanner/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ spec:
- name: SECURE_API_TOKEN
valueFrom:
secretKeyRef:
{{- if not .Values.existingSecretName }}
name: {{ include "registry-scanner.fullname" . }}
{{- else }}
name: {{ .Values.existingSecretName }}
{{- end }}
key: secureAPIToken
{{- if .Values.proxy.httpProxy }}
- name: http_proxy
Expand All @@ -64,12 +68,20 @@ spec:
- name: REGISTRYSCANNER_REGISTRY_USER
valueFrom:
secretKeyRef:
{{- if not .Values.existingSecretName }}
name: {{ include "registry-scanner.fullname" . }}
{{- else }}
name: {{ .Values.existingSecretName }}
{{- end }}
key: registryUser
- name: REGISTRYSCANNER_REGISTRY_PASSWORD
valueFrom:
secretKeyRef:
{{- if not .Values.existingSecretName }}
name: {{ include "registry-scanner.fullname" . }}
{{- else }}
name: {{ .Values.existingSecretName }}
{{- end }}
key: registryPassword
restartPolicy: {{ .Values.cronjob.restartPolicy }}
{{- with .Values.nodeSelector }}
Expand Down
4 changes: 3 additions & 1 deletion charts/registry-scanner/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.existingSecretName }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -8,4 +9,5 @@ type: Opaque
data:
secureAPIToken: {{ .Values.config.secureAPIToken | b64enc | quote }}
registryUser: {{ .Values.config.registryUser | b64enc | quote }}
registryPassword: {{ .Values.config.registryPassword | b64enc | quote }}
registryPassword: {{ .Values.config.registryPassword | b64enc | quote }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/registry-scanner/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

# Specify the name of a Kubernetes secret containing an 'secureAPIToken', 'registryUser', and 'registryPassword' entries
existingSecretName: ""

podAnnotations: {}

podSecurityContext: {}
Expand Down