-
Notifications
You must be signed in to change notification settings - Fork 10.3k
[bitnami/harbor] Store passwords of redis, clair and notary in secrets #1941
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
Changes from all commits
d66a260
65f9102
359583a
fb56e37
0fd60a6
bbd708d
68fe70b
fa68cc5
cc99143
75a6a02
c924e24
d01b72c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| clair: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are you duplicating the values on this file? They are already into the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file comes from moving this out from clair-cm.yaml
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, in that case, move those values to the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the config file that clair will use here, it is not related to values.yaml
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not clear on this because I think this forces the user to clone the bitnami/charts repository in order to work. Would this file become part of the final tarball?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, This approach is the same as in here, where we import the |
||
| database: | ||
| type: pgsql | ||
| options: | ||
| source: "{{ template "harbor.database.clair" . }}" | ||
| # Number of elements kept in the cache | ||
| # Values unlikely to change (e.g. namespaces) are cached in order to save prevent needless roundtrips to the database. | ||
| cachesize: 16384 | ||
| api: | ||
| # API server port | ||
| port: 6060 | ||
| healthport: 6061 | ||
| # Deadline before an API request will respond with a 503 | ||
| timeout: 300s | ||
| updater: | ||
| interval: {{ .Values.clair.updatersInterval }}h | ||
| notifier: | ||
| attempts: 3 | ||
| renotifyinterval: 2h | ||
| http: | ||
| endpoint: "http://{{ template "harbor.core" . }}/service/notifications/clair" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| "server": { | ||
| "http_addr": ":4443" | ||
| }, | ||
| "trust_service": { | ||
| "type": "remote", | ||
| "hostname": "{{ template "harbor.notary-signer" . }}", | ||
| "port": "7899", | ||
| {{- if not .Values.notary.secretName }} | ||
| "tls_ca_file": "./notary-signer-ca.crt", | ||
| {{- else }} | ||
| "tls_ca_file": "/etc/ssl/notary/cert/notary-signer-ca.crt", | ||
| {{- end }} | ||
| "key_algorithm": "ecdsa" | ||
| }, | ||
| "logging": { | ||
| "level": "{{ .Values.logLevel }}" | ||
| }, | ||
| "storage": { | ||
| "backend": "postgres", | ||
| "db_url": "{{ template "harbor.database.notaryServer" . }}" | ||
| }, | ||
| "auth": { | ||
| "type": "token", | ||
| "options": { | ||
| "realm": "{{ template "harbor.externalUrl" . }}/service/token", | ||
| "service": "harbor-notary", | ||
| "issuer": "harbor-token-issuer", | ||
| "rootcertbundle": "/root.crt" | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "server": { | ||
| "grpc_addr": ":7899", | ||
| {{- if not .Values.notary.secretName }} | ||
| "tls_cert_file": "./notary-signer.crt", | ||
| "tls_key_file": "./notary-signer.key" | ||
| {{- else }} | ||
| "tls_cert_file": "/etc/ssl/notary/cert/notary-signer.crt", | ||
| "tls_key_file": "/etc/ssl/notary/cert/notary-signer.key" | ||
| {{- end }} | ||
| }, | ||
| "logging": { | ||
| "level": "{{ .Values.logLevel }}" | ||
| }, | ||
| "storage": { | ||
| "backend": "postgres", | ||
| "db_url": "{{ template "harbor.database.notarySigner" . }}", | ||
| "default_alias": "defaultalias" | ||
| } | ||
| } |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ spec: | |
| labels: {{- include "harbor.labels" . | nindent 8 }} | ||
| app.kubernetes.io/component: clair | ||
| annotations: | ||
| checksum/configmap: {{ include (print $.Template.BasePath "/clair/clair-cm.yaml") . | sha256sum }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are you doing this? This file has no password inside it is correct to be a configmap.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For that case I think it should be enough with the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, take into account that I am using the externalRedis feature, so I have to set |
||
| checksum/secret: {{ include (print $.Template.BasePath "/clair/clair-secret.yaml") . | sha256sum }} | ||
| {{- if .Values.clair.podAnnotations }} | ||
| {{- include "harbor.tplValue" (dict "value" .Values.clair.podAnnotations "context" $) | nindent 8 }} | ||
| {{- end }} | ||
|
|
@@ -75,7 +75,7 @@ spec: | |
| ports: | ||
| - containerPort: 6060 | ||
| volumeMounts: | ||
| - name: clair-config | ||
| - name: config | ||
| mountPath: /etc/clair/config.yaml | ||
| subPath: config.yaml | ||
| - name: adapter | ||
|
|
@@ -119,10 +119,7 @@ spec: | |
| ports: | ||
| - containerPort: 8080 | ||
| volumes: | ||
| - name: clair-config | ||
| configMap: | ||
| name: {{ include "harbor.clair" . }} | ||
| items: | ||
| - key: config.yaml | ||
| path: config.yaml | ||
| - name: config | ||
| secret: | ||
| secretName: "{{ template "harbor.clair" . }}" | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| {{- if .Values.clair.enabled }} | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: {{ template "harbor.clair" . }} | ||
| labels: | ||
| {{ include "harbor.labels" . | indent 4 }} | ||
| type: Opaque | ||
| data: | ||
| config.yaml: {{ tpl (.Files.Get "conf/clair.yaml") . | b64enc }} | ||
|
miguelaeh marked this conversation as resolved.
|
||
| {{- end }} | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| {{- if .Values.notary.enabled }} | ||
|
miguelaeh marked this conversation as resolved.
|
||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: {{ include "harbor.notary-server" . }} | ||
| labels: {{- include "harbor.labels" . | nindent 4 }} | ||
| component: notary | ||
| data: | ||
| {{- if not .Values.notary.secretName }} | ||
| {{ $ca := genCA "harbor-notary-ca" 365 }} | ||
| {{ $cert := genSignedCert (include "harbor.notary-signer" .) nil nil 365 $ca }} | ||
| notary-signer-ca.crt: {{ $ca.Cert | b64enc | quote }} | ||
| notary-signer.crt: {{ $cert.Cert | b64enc | quote }} | ||
| notary-signer.key: {{ $cert.Key | b64enc | quote }} | ||
| {{- end }} | ||
| server-config.postgres.json: {{ tpl (.Files.Get "conf/notary-server.json") . | b64enc }} | ||
| signer-config.postgres.json: {{ tpl (.Files.Get "conf/notary-signer.json") . | b64enc }} | ||
| {{- end }} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are variables here that are not used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true, I just reviewed them one by one :)