feat: make health probe timeoutSeconds and failureThreshold configurable via values (#2317)
Expose all five probe timing parameters (initialDelaySeconds, periodSeconds, timeoutSeconds, failureThreshold, successThreshold) as configurable values for all components: core, portal, jobservice, registry, nginx, exporter, trivy, database, and redis.
Defaults match the current hardcoded values exactly, so there is zero behavioral change on upgrade.
Closes goharbor/harbor-helm#2316
Signed-off-by: Alexander Lindeskär lindeskar@users.noreply.github.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
Helm Chart for Harbor
Notes: The master branch is in heavy development, please use the other stable versions instead. A highly available solution for Harbor based on chart can be found here. And refer to the guide to upgrade the existing deployment.
This repository, including the issues, focuses on deploying Harbor chart via helm. For functionality issues or Harbor questions, please open issues on goharbor/harbor
Introduction
This Helm chart installs Harbor in a Kubernetes cluster. Welcome to contribute to Helm Chart for Harbor.
Prerequisites
Installation
Add Helm repository
Configure the chart
The following items can be set via
--setflag during installation or configured by editing thevalues.yamldirectly (need to download the chart first).Configure how to expose Harbor service
NodeIP:NodePort.Configure the external URL
The external URL for Harbor core service is used to:
Format:
protocol://domain[:port]. Usually:Ingress, thedomainshould be the value ofexpose.ingress.hosts.coreClusterIP, thedomainshould be the value ofexpose.clusterIP.nameNodePort, thedomainshould be the IP address of one Kubernetes nodeLoadBalancer, set thedomainas your own domain name and add a CNAME record to map the domain name to the one you got from the cloud providerIf Harbor is deployed behind the proxy, set it as the URL of proxy.
Configure how to persist data
StorageClassis needed in the Kubernetes cluster to dynamically provision the volumes. Specify another StorageClass in thestorageClassor setexistingClaimif you already have existing persistent volumes to use.azure,gcs,s3swiftandoss.Configure the other items listed in configuration section
Install the chart
Install the Harbor helm chart with a release name
my-release:Uninstallation
To uninstall/delete the
my-releasedeployment:Configuration
The following table lists the configurable parameters of the Harbor chart and the default values.
expose.typeingress,clusterIP,nodePortorloadBalancer, other values will be ignored and the creation of service will be skipped.ingressexpose.tls.enabledssl-redirectannotations inexpose.ingress.annotationswhen TLS is disabled andexpose.typeisingress. Note: if theexpose.typeisingressand TLS is disabled, the port must be included in the command when pulling/pushing images. Refer to https://github.com/goharbor/harbor/issues/5291 for details.trueexpose.tls.certSourceauto,secretornoneand fill the information in the corresponding section: 1) auto: generate the TLS certificate automatically 2) secret: read the TLS certificate from the specified secret. The TLS certificate can be generated manually or by cert manager 3) none: configure no TLS certificate for the ingress. If the default TLS certificate is configured in the ingress controller, choose this optionautoexpose.tls.auto.commonNameingressexpose.tls.secret.secretNametls.crt- the certificate;tls.key- the private keyexpose.ingress.hosts.corecore.harbor.domainexpose.ingress.controllerdefault,gce,alb,f5-bigipandncpdefaultexpose.ingress.kubeVersionOverrideexpose.ingress.classNameingressClassNameused to implement the Ingress (Kubernetes 1.18+)expose.ingress.annotationsexpose.ingress.labelsexpose.clusterIP.nameharborexpose.clusterIP.annotationsexpose.clusterIP.ports.httpPort80expose.clusterIP.ports.httpsPort443expose.clusterIP.annotationsexpose.clusterIP.labelsexpose.nodePort.nameharborexpose.nodePort.ports.http.port80expose.nodePort.ports.http.nodePort30002expose.nodePort.ports.https.port443expose.nodePort.ports.https.nodePort30003expose.nodePort.annotationsexpose.nodePort.labelsexpose.loadBalancer.nameharborexpose.loadBalancer.IP""expose.loadBalancer.ports.httpPort80expose.loadBalancer.ports.httpsPort30002expose.loadBalancer.annotationsexpose.loadBalancer.labelsexpose.loadBalancer.sourceRangesinternalTLS.enabledfalseinternalTLS.strong_ssl_ciphersfalseinternalTLS.certSourceauto,manual,secret.autointernalTLS.trustCacertSourceismanual. Note: all the internal certificates of the components must be issued by this CAinternalTLS.core.secretNamecertSourceissecret. The secret must contain keys named:ca.crt- the CA certificate which is used to issue internal key and crt pair for components and all Harbor components must be issued by the same CA,tls.crt- the content of the TLS cert file,tls.key- the content of the TLS key file.internalTLS.core.crtcertSourceismanualinternalTLS.core.keycertSourceismanualinternalTLS.jobservice.secretNamecertSourceissecret. The secret must contain keys named:ca.crt- the CA certificate which is used to issue internal key and crt pair for components and all Harbor components must be issued by the same CA,tls.crt- the content of the TLS cert file,tls.key- the content of the TLS key file.internalTLS.jobservice.crtcertSourceismanualinternalTLS.jobservice.keycertSourceismanualinternalTLS.registry.secretNamecertSourceissecret. The secret must contain keys named:ca.crt- the CA certificate which is used to issue internal key and crt pair for components and all Harbor components must be issued by the same CA,tls.crt- the content of the TLS cert file,tls.key- the content of the TLS key file.internalTLS.registry.crtcertSourceismanualinternalTLS.registry.keycertSourceismanualinternalTLS.portal.secretNamecertSourceissecret. The secret must contain keys named:ca.crt- the CA certificate which is used to issue internal key and crt pair for components and all Harbor components must be issued by the same CA,tls.crt- the content of the TLS cert file,tls.key- the content of the TLS key file.internalTLS.portal.crtcertSourceismanualinternalTLS.portal.keycertSourceismanualinternalTLS.trivy.secretNamecertSourceissecret. The secret must contain keys named:ca.crt- the CA certificate which is used to issue internal key and crt pair for components and all Harbor components must be issued by the same CA,tls.crt- the content of the TLS cert file,tls.key- the content of the TLS key file.internalTLS.trivy.crtcertSourceismanualinternalTLS.trivy.keycertSourceismanualipFamily.ipv4.enabledtrueipFamily.ipv6.enabledtruepersistence.enabledtruepersistence.resourcePolicykeepto avoid removing PVCs during a helm delete operation. Leaving it empty will delete PVCs after the chart deleted. Does not affect PVCs created for internal database and redis components.keeppersistence.persistentVolumeClaim.registry.existingClaimsubPathif the PVC is shared with other componentspersistence.persistentVolumeClaim.registry.storageClassstorageClassused to provision the volume. Or the default StorageClass will be used (the default). Set it to-to disable dynamic provisioningpersistence.persistentVolumeClaim.registry.subPathpersistence.persistentVolumeClaim.registry.accessModeReadWriteOncepersistence.persistentVolumeClaim.registry.size5Gipersistence.persistentVolumeClaim.registry.annotationspersistence.persistentVolumeClaim.jobservice.jobLog.existingClaimsubPathif the PVC is shared with other components.persistence.persistentVolumeClaim.jobservice.jobLog.storageClassstorageClassused to provision the volume. Or the default StorageClass will be used (the default). Set it to-to disable dynamic provisioningpersistence.persistentVolumeClaim.jobservice.jobLog.subPathpersistence.persistentVolumeClaim.jobservice.jobLog.accessModeReadWriteOncepersistence.persistentVolumeClaim.jobservice.jobLog.size1Gipersistence.persistentVolumeClaim.jobservice.jobLog.annotationspersistence.persistentVolumeClaim.database.existingClaimsubPathif the PVC is shared with other components. If external database is used, the setting will be ignoredpersistence.persistentVolumeClaim.database.storageClassstorageClassused to provision the volume. Or the default StorageClass will be used (the default). Set it to-to disable dynamic provisioning. If external database is used, the setting will be ignoredpersistence.persistentVolumeClaim.database.subPathpersistence.persistentVolumeClaim.database.accessModeReadWriteOncepersistence.persistentVolumeClaim.database.size1Gipersistence.persistentVolumeClaim.database.annotationspersistence.persistentVolumeClaim.redis.existingClaimsubPathif the PVC is shared with other components. If external Redis is used, the setting will be ignoredpersistence.persistentVolumeClaim.redis.storageClassstorageClassused to provision the volume. Or the default StorageClass will be used (the default). Set it to-to disable dynamic provisioning. If external Redis is used, the setting will be ignoredpersistence.persistentVolumeClaim.redis.subPathpersistence.persistentVolumeClaim.redis.accessModeReadWriteOncepersistence.persistentVolumeClaim.redis.size1Gipersistence.persistentVolumeClaim.redis.annotationspersistence.persistentVolumeClaim.trivy.existingClaimsubPathif the PVC is shared with other componentspersistence.persistentVolumeClaim.trivy.storageClassstorageClassused to provision the volume. Or the default StorageClass will be used (the default). Set it to-to disable dynamic provisioningpersistence.persistentVolumeClaim.trivy.subPathpersistence.persistentVolumeClaim.trivy.accessModeReadWriteOncepersistence.persistentVolumeClaim.trivy.size1Gipersistence.persistentVolumeClaim.trivy.annotationspersistence.imageChartStorage.disableredirects3storage type), please set it totrueto disable redirects. Refer to the guide for more detailsfalsepersistence.imageChartStorage.caBundleSecretNamecaBundleSecretNameif the storage service uses a self-signed certificate. The secret must contain keys namedca.crtwhich will be injected into the trust store of registry’s and containers.persistence.imageChartStorage.typefilesystem,azure,gcs,s3,swiftoross. The type must befilesystemif you want to use persistent volumes for registry. Refer to the guide for more detailsfilesystempersistence.imageChartStorage.gcs.existingSecret""persistence.imageChartStorage.gcs.useWorkloadIdentityserviceAccountNameof each component, then allow automounting the service account.falseexternalURLhttps://core.harbor.domaincaBundleSecretNameuaaSecretNameca.crt.imagePullPolicyimagePullSecretsupdateStrategy.typeRollingUpdateorRecreate. Set it asRecreatewhenRWMfor volumes isn’t supportedRollingUpdatelogLeveldebug,info,warning,errororfatalinfoharborAdminPasswordHarbor12345existingSecretAdminPasswordexistingSecretAdminPasswordKeyHARBOR_ADMIN_PASSWORDcaSecretNameca.crt. Setting this enables the download link on portal to download the CA certificate when the certificate isn’t generated automaticallysecretKeynot-a-secure-keyexistingSecretSecretKey""proxy.httpProxyproxy.httpsProxyproxy.noProxyproxy.componentsenableMigrateHelmHookfalseingress, Nginx will not be used)nginx.image.repositorygoharbor/nginx-photonnginx.image.tagdevnginx.replicas1nginx.revisionHistoryLimit10nginx.resourcesnginx.automountServiceAccountTokenfalsenginx.nodeSelector{}nginx.tolerations[]nginx.affinity{}nginx.topologySpreadConstraints[]nginx.podAnnotations{}nginx.priorityClassNameportal.image.repositorygoharbor/harbor-portalportal.image.tagdevportal.replicas1portal.revisionHistoryLimit10portal.resourcesportal.automountServiceAccountTokenfalseportal.nodeSelector{}portal.tolerations[]portal.affinity{}portal.topologySpreadConstraints[]portal.podAnnotations{}portal.serviceAnnotations{}portal.priorityClassNameportal.initContainers[]core.image.repositorygoharbor/harbor-corecore.image.tagdevcore.replicas1core.revisionHistoryLimit10core.startupProbe.initialDelaySeconds10core.resourcescore.automountServiceAccountTokenfalsecore.nodeSelector{}core.tolerations[]core.affinity{}core.topologySpreadConstraints[]core.podAnnotations{}core.serviceAnnotations{}core.configureUserSettingsCONFIG_OVERWRITE_JSONto configure user settings. See the [official docs](https://goharbor.io/docs/latest/install-config/configure-system-settings-cli/#set-configuration-items-using-an-environment-variable.core.quotaUpdateProviderredisordb. You can set it to be implemented byrediswhich can improve the performance of high concurrent pushing to the same project, and reduce database connection spikes and occupies. Using redis will bring up some delay for quota usage update for display, so only suggest switch provider to redis if you ran into the db connections spike around the scenario of high concurrent pushing to same project, no improvement for other scenes.dbcore.secretcore.secretNametls.crt- the certificate andtls.key- the private key. The default key pair will be used if it isn’t setcore.tokenKeycore.secretNameis unset. If set,core.tokenCertMUST also be set.core.tokenCertcore.tokenKeyused to validate service tokens. Only used ifcore.secretNameis unset. If set,core.tokenKeyMUST also be set.core.xsrfKeycore.priorityClassNamecore.artifactPullAsyncFlushDurationcore.gdpr.deleteUserfalsecore.gdpr.auditLogsCompliantfalsecore.initContainers[]jobservice.image.repositorygoharbor/harbor-jobservicejobservice.image.tagdevjobservice.replicas1jobservice.revisionHistoryLimit10jobservice.maxJobWorkers10jobservice.jobLoggersfile,databaseorstdout[file]jobservice.loggerSweeperDurationjobLoggersis set tostdout)14jobservice.notification.webhook_job_max_retry3jobservice.notification.webhook_job_http_client_timeout3jobservice.registryHttpClientTimeout30jobservice.reaper.max_update_hours24jobservice.reaper.max_dangling_hours168jobservice.resourcesjobservice.automountServiceAccountTokenfalsejobservice.nodeSelector{}jobservice.tolerations[]jobservice.affinity{}jobservice.topologySpreadConstraints[]jobservice.podAnnotations{}jobservice.priorityClassNamejobservice.secretjobservice.initContainers[]registry.registry.image.repositorygoharbor/registry-photonregistry.registry.image.tagdevregistry.registry.resourcesregistry.controller.image.repositorygoharbor/harbor-registryctlregistry.controller.image.tagdevregistry.controller.resourcesregistry.replicas1registry.revisionHistoryLimit10registry.nodeSelector{}registry.automountServiceAccountTokenfalseregistry.tolerations[]registry.affinity{}registry.topologySpreadConstraints[]registry.middlewaredocker pullrecipient. See official docs.registry.podAnnotations{}registry.priorityClassNameregistry.secretregistry.credentials.usernameregistry.credentials.password, a htpasswd is created. This is an alternative to providingregistry.credentials.htpasswdString. For more details see official docs.harbor_registry_userregistry.credentials.passwordregistry.credentials.username, a htpasswd is created. This is an alternative to providingregistry.credentials.htpasswdString. For more details see official docs. It is suggested you update this value before installation.harbor_registry_passwordregistry.credentials.existingSecretREGISTRY_PASSWD""registry.credentials.htpasswdStringregistry.credentials.usernameandregistry.credentials.password. May come in handy when integrating with tools like argocd or flux. This allows the same line to be generated each time the template is rendered, instead of thehtpasswdfunction from helm, which generates different lines each time because of the salt.registry.relativeurlsfalseregistry.upload_purging.enabledtrueregistry.upload_purging.age168hregistry.upload_purging.interval24hregistry.upload_purging.dryrunfalseregistry.initContainers[]trivy.enabledtruetrivy.image.repositorygoharbor/trivy-adapter-photontrivy.image.tagdevtrivy.resourcestrivy.automountServiceAccountTokenfalsetrivy.replicas1trivy.debugModefalsetrivy.vulnTypeosandlibrary.os,librarytrivy.severityUNKNOWN,LOW,MEDIUM,HIGH,CRITICALtrivy.ignoreUnfixedfalsetrivy.insecurefalsetrivy.skipUpdatefalsetrivy.skipJavaDBUpdatetrivy-java.dbfile Trivy Java DB and mount it in the/home/scanner/.cache/trivy/java-db/trivy-java.dbpathfalsetrivy.dbRepositorymirror.gcr.io/aquasec/trivy-db,ghcr.io/aquasecurity/trivy-dbtrivy.javaDBRepositorymirror.gcr.io/aquasec/trivy-java-db,ghcr.io/aquasecurity/trivy-java-dbtrivy.offlineScanfalsetrivy.securityCheckvulntrivy.timeout5m0strivy.gitHubTokentrivy.priorityClassNametrivy.topologySpreadConstraintstrivy.initContainers[]database.typeexternalinternaldatabase.internal.image.repositorygoharbor/harbor-dbdatabase.internal.image.tagdevdatabase.internal.passwordchangeitdatabase.internal.shmSizeLimit512Midatabase.internal.resourcesdatabase.internal.automountServiceAccountTokenfalsedatabase.internal.initContainer.migrator.resourcesdatabase.internal.initContainer.permissions.resourcesdatabase.internal.nodeSelector{}database.internal.tolerations[]database.internal.affinity{}database.internal.priorityClassNamedatabase.internal.livenessProbe.timeoutSecondsdatabase.internal.readinessProbe.timeoutSecondsdatabase.internal.extrInitContainers[]database.external.host192.168.0.1database.external.port5432database.external.usernameuserdatabase.external.passwordpassworddatabase.external.coreDatabaseregistrydatabase.external.existingSecretpassword.""database.external.sslmodedisabledatabase.maxIdleConns50database.maxOpenConns100database.podAnnotations{}redis.typeexternalinternalredis.internal.image.repositorygoharbor/redis-photonredis.internal.image.tagdevredis.internal.resourcesredis.internal.automountServiceAccountTokenfalseredis.internal.nodeSelector{}redis.internal.tolerations[]redis.internal.affinity{}redis.internal.priorityClassNameredis.internal.jobserviceDatabaseIndex1redis.internal.registryDatabaseIndex2redis.internal.trivyAdapterIndex5redis.internal.harborDatabaseIndex0redis.internal.cacheLayerDatabaseIndex0redis.internal.initContainers[]redis.external.addr192.168.0.2:6379redis.external.sentinelMasterSetredis.external.coreDatabaseIndex0redis.external.jobserviceDatabaseIndex1redis.external.registryDatabaseIndex2redis.external.trivyAdapterIndex5redis.external.harborDatabaseIndex0redis.external.cacheLayerDatabaseIndex0redis.external.usernameredis.external.passwordredis.external.existingSecretREDIS_PASSWORD.""redis.podAnnotations{}exporter.replicas1exporter.revisionHistoryLimit10exporter.podAnnotations{}exporter.image.repositorygoharbor/harbor-exporterexporter.image.tagdevexporter.nodeSelector{}exporter.tolerations[]exporter.affinity{}exporter.topologySpreadConstraints[]exporter.automountServiceAccountTokenfalseexporter.cacheDuration30exporter.cacheCleanInterval14400exporter.priorityClassNamemetrics.enabledfalsemetrics.core.path/metricsmetrics.core.port8001metrics.registry.path/metricsmetrics.registry.port8001metrics.exporter.path/metricsmetrics.exporter.port8001metrics.serviceMonitor.enabledfalsemetrics.serviceMonitor.additionalLabels""metrics.serviceMonitor.interval""metrics.serviceMonitor.metricRelabelings[]metrics.serviceMonitor.relabelings[]trace.enabledfalsetrace.providerjaegerorotel.jaegershould be 1.26+jaegertrace.sample_ratesample_rateto 1 if you want sampling 100% of trace data; set 0.5 if you want sampling 50% of trace data, and so forth1trace.namespacetrace.attributesattributesis a key value dict contains user defined attributes used to initialize trace providertrace.jaeger.endpointhttp://hostname:14268/api/tracestrace.jaeger.usernametrace.jaeger.passwordtrace.jaeger.agent_hosttrace.jaeger.agent_port6831trace.otel.endpointhostname:4318trace.otel.url_path/v1/tracestrace.otel.compressionfalsetrace.otel.insecuretruetrace.otel.timeout10cache.enabledfalsecache.expireHours24Harbor Kubernetes Version Compatibility Matrix
The following is a list of the Test Kubernetes versions for each Harbor version. Generally, Harbor supporting Kubernetes version above v1.20+ . However we only test against 3 Kubernetes minor versions for each Harbor minor release.