Skip to content
2 changes: 1 addition & 1 deletion bitnami/harbor/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: harbor
version: 4.1.1
version: 5.0.0
appVersion: 1.10.1
description: Harbor is an an open source trusted cloud native registry project that stores, signs, and scans content
keywords:
Expand Down
19 changes: 19 additions & 0 deletions bitnami/harbor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,25 @@ The following table lists the configurable parameters of the Harbor chart and th
| `clair.podAnnotations` | Annotations to add to the clair pod | `{}` |
| `clair.livenessProbe` | Liveness probe configuration | `Check values.yaml file` |
| `clair.readinessProbe` | Readiness probe configuration | `Check values.yaml file` |
| **Notary** |

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

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 :)

| `notary.enabled` | Enable Notary | `true` |
| `notaryServerImage.registry` | Registry for notary server image | `docker.io` |
| `notaryServerImage.repository` | Repository for notary server image | `bitnami/harbor-notary-server` |
| `notaryServerImage.tag` | Tag for notary server image | `1.10.1-debian-10-r0` |
| `notaryServerImage.pullPolicy` | Harbor notary server image pull policy | `IfNotPresent` |
| `notarySignerImage.registry` | Registry for notary signer images | `docker.io` |
| `notarySignerImage.repository` | Repository for notary signer image | `bitnami/harbor-notary-signer` |
| `notarySignerImage.tag` | Tag for notary signer image | `1.10.1-debian-10-r0` |
| `notarySignerImage.pullPolicy` | Harbor notary signer image pull policy | `IfNotPresent` |
| `notary.server.replicas` | The replica count | `1` |
| `notary.server.resources` | The [resources] to allocate for container | `{}` |
| `notary.signer.replicas` | The replica count | `1` |
| `notary.signer.resources` | The [resources] to allocate for container | `{}` |
| `notary.nodeSelector` | Node labels for pod assignment | `{}` |
| `notary.tolerations` | Tolerations for pod assignment | `[]` |
| `notary.affinity` | Node/Pod affinities | `{}` |
| `notary.podAnnotations` | Annotations to add to the notary pod | `{}` |
| `notary.secretName` | Fill the name of a kubernetes secret if you want to use your own TLS certificate authority, certificate and private key for notary communications. The secret must contain keys named `tls.ca`, `tls.crt` and `tls.key` that contain the CA, certificate and private key. They will be generated if not set. | `nil` |
| **PostgreSQL** |
| `posgresql.enabled` | If external database is used, set it to `false` | `true` |
| `posgresql.postgresqlUsername` | Postgresql username | `postgres` |
Expand Down
21 changes: 21 additions & 0 deletions bitnami/harbor/conf/clair.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
clair:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 values.yaml, Please do no create a new file add the necessary to the values.yaml

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file comes from moving this out from clair-cm.yaml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, in that case, move those values to the values.yaml

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, helm package will package the whole directory, except files specified in a .helmignore.

This approach is the same as in here, where we import the cert folder: https://github.com/bitnami/charts/blob/master/bitnami/harbor/templates/core/core-secret.yaml#L24-L27

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"
32 changes: 32 additions & 0 deletions bitnami/harbor/conf/notary-server.json
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"
}
}
}
20 changes: 20 additions & 0 deletions bitnami/harbor/conf/notary-signer.json
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"
}
}
34 changes: 0 additions & 34 deletions bitnami/harbor/templates/clair/clair-cm.yaml

This file was deleted.

13 changes: 5 additions & 8 deletions bitnami/harbor/templates/clair/clair-dpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For that case I think it should be enough with the redis.password parameter

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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 redis.enabled: false to avoid installing stable/redis that I won't use.

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 }}
Expand Down Expand Up @@ -75,7 +75,7 @@ spec:
ports:
- containerPort: 6060
volumeMounts:
- name: clair-config
- name: config
mountPath: /etc/clair/config.yaml
subPath: config.yaml
- name: adapter
Expand Down Expand Up @@ -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 }}
11 changes: 11 additions & 0 deletions bitnami/harbor/templates/clair/clair-secret.yaml
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 }}
Comment thread
miguelaeh marked this conversation as resolved.
{{- end }}
2 changes: 0 additions & 2 deletions bitnami/harbor/templates/core/core-cm-envvars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ data:
CONFIG_PATH: "/etc/core/app.conf"
SYNC_REGISTRY: "false"
CHART_CACHE_DRIVER: "redis"
_REDIS_URL: "{{ template "harbor.redisForCore" . }}"
_REDIS_URL_REG: "{{ template "harbor.redisForGC" . }}"
PORTAL_URL: "http://{{ template "harbor.portal" . }}"
REGISTRYCTL_URL: "http://{{ template "harbor.registry" . }}:8080"
CLAIR_HEALTH_CHECK_SERVER_URL: "http://{{ template "harbor.clair" . }}:6061"
Expand Down
2 changes: 2 additions & 0 deletions bitnami/harbor/templates/core/core-secret-envvars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ metadata:
labels: {{- include "harbor.labels" . | nindent 4 }}
type: Opaque
data:
_REDIS_URL: "{{ include "harbor.redisForCore" . | b64enc }}"
_REDIS_URL_REG: "{{ include "harbor.redisForGC" . | b64enc }}"
{{- if .Values.harborAdminPassword }}
HARBOR_ADMIN_PASSWORD: {{ .Values.harborAdminPassword | b64enc | quote }}
{{- else if (not .Values.forcePassword) }}
Expand Down
73 changes: 0 additions & 73 deletions bitnami/harbor/templates/notary/notary-cm.yaml

This file was deleted.

18 changes: 18 additions & 0 deletions bitnami/harbor/templates/notary/notary-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if .Values.notary.enabled }}
Comment thread
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 }}
6 changes: 3 additions & 3 deletions bitnami/harbor/templates/notary/notary-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
labels: {{- include "harbor.labels" . | nindent 8 }}
component: notary-server
annotations:
checksum/configmap: {{ include (print $.Template.BasePath "/notary/notary-cm.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/notary/notary-secret.yaml") . | sha256sum }}
checksum/secret-core: {{ include (print $.Template.BasePath "/core/core-secret.yaml") . | sha256sum }}
{{- if .Values.notary.podAnnotations }}
annotations: {{- include "harbor.tplValue" (dict "value" .Values.notary.podAnnotations "context" $) | nindent 8 }}
Expand Down Expand Up @@ -66,8 +66,8 @@ spec:
name: notary-server
volumes:
- name: notary-config
configMap:
name: {{ include "harbor.notary-server" . }}
secret:
secretName: {{ include "harbor.notary-server" . }}
- name: root-certificate
secret:
{{- if .Values.core.secretName }}
Expand Down
6 changes: 3 additions & 3 deletions bitnami/harbor/templates/notary/notary-signer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
labels: {{- include "harbor.labels" . | nindent 8 }}
component: notary-signer
annotations:
checksum/configmap: {{ include (print $.Template.BasePath "/notary/notary-cm.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/notary/notary-secret.yaml") . | sha256sum }}
{{- if .Values.notary.podAnnotations }}
annotations: {{- include "harbor.tplValue" (dict "value" .Values.notary.podAnnotations "context" $) | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -67,8 +67,8 @@ spec:
{{- end }}
volumes:
- name: notary-config
configMap:
name: {{ include "harbor.notary-server" . }}
secret:
secretName: {{ include "harbor.notary-server" . }}
{{- if .Values.notary.secretName }}
- name: notary-cert
secret:
Expand Down
7 changes: 4 additions & 3 deletions bitnami/harbor/values-production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1076,8 +1076,8 @@ clair:
# memory: 1Gi
requests: {}
# cpu: 250m
# memory: 256Mi
# memory: 256Mi

replicas: 1
# The http(s) proxy used to update vulnerabilities database from internet
httpProxy:
Expand Down Expand Up @@ -1143,8 +1143,8 @@ clair:
##
notary:
enabled: true
replicas: 1
server:
replicas: 1
## Notary server containers' resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
Expand Down Expand Up @@ -1177,6 +1177,7 @@ notary:
failureThreshold: 6
successThreshold: 1
signer:
replicas: 1
## Notary signer containers' resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
Expand Down
Loading