Skip to content

Latest commit

 

History

History
831 lines (434 loc) · 14.2 KB

REFERENCE.md

File metadata and controls

831 lines (434 loc) · 14.2 KB

Reference

Table of Contents

Classes

Public Classes

Private Classes

  • harbor::backup: Backs up Harbor database to a known location if a version change is detected
  • harbor::config: Handles Harbor configuration files and running the migrator
  • harbor::install: Download Harbor and install into /opt/harbor and loads docker images if the offline installer is used
  • harbor::prepare: Runs the Harbor prepare script
  • harbor::service: Sets up a systemd unit file and service for Harbor

Resource types

Classes

harbor

Harbor Puppet module main class

Examples

include harbor

Parameters

The following parameters are available in the harbor class.

version

Data type: Pattern[/\d+\.\d+\.\d+.*/]

Specifies the Harbor version to install. See available releases at {https://github.com/goharbor/harbor/releases Harbor Releases}

release

Data type: Pattern[/\d+\.\d+\.\d+.*/]

Specifies the Harbor release for the download URL.

installer

Data type: Enum['offline','online']

Specifies which installer type to use. Note that not every release has both installer types available.

with_notary

Data type: Boolean

Specifies whether to include Notary functionality in the deployment. Defaults to false

with_clair

Data type: Boolean

Specifies whether to include Clair functionality in the deployment. Defaults to false

with_chartmuseum

Data type: Boolean

Specifies whether to include Helm Chart repository functionality in the deployment. Defaults to false

harbor_ha

Data type: Boolean

Specifies whether to include high availability functionality in the deployment. Defaults to false

download_source

Data type: Stdlib::Httpurl

Specifies download location for the Harbor installation tar file.

Default value: "https://storage.googleapis.com/harbor-releases/release-${release}/harbor-${installer}-installer-v${version}.tgz"

checksum

Data type: String

Specifies the MD5 checksum for downloaded Harbor installation tar file.

hostname

Data type: Stdlib::Host

The target host's hostname, which is used to access the Portal and the registry service. It should be the IP address or the fully qualified domain name (FQDN) of your target machine. Defaults to facts.fqdn

ui_url_protocol

Data type: Enum['http','https']

http or https. Defaults to http

max_job_workers

Data type: Integer

The maximum number of replication workers in job service Defaults to 10

absolute_url

Data type: Enum['enabled','disabled']

Change the value of absolute_url to enabled can enable absolute url in chart Defaults to disabled

customize_crt

Data type: Enum['on','off']

When this attribute is on, the prepare script creates private key and root certificate for the generation/verification of the registry's token. Defaults to on

ssl_cert

Data type: Stdlib::Absolutepath

The path of SSL certificate,

ssl_cert_key

Data type: Stdlib::Absolutepath

The path of SSL key

secretkey_path

Data type: Stdlib::Absolutepath

The path of key for encrypt or decrypt the password of a remote registry in a replication policy.

external_url

Data type: Variant[Stdlib::Httpurl,String[0,0]]

log_level

Data type: Enum['debug','info','warning','error','fatal']

Defaults to 'info'

log_rotate_count

Data type: Integer

Defaults to 50

log_rotate_size

Data type: String

Defaults to 200M

log_location

Data type: String

Defaults to /var/log/harbor

http_proxy

Data type: Variant[Stdlib::Httpurl,String[0,0]]

Defaults to None

https_proxy

Data type: Variant[Stdlib::Httpurl,String[0,0]]

Defaults to None

no_proxy

Data type: String

Defaults to None

data_volume

Data type: String

Defaults to '/data'

harbor_admin_password

Data type: String

Defaults to Harbor12345

db_host

Data type: Stdlib::Host

Defaults to postgresql

db_password

Data type: String

Defaults to root123

db_port

Data type: Stdlib::Port

Defaults to 5432

db_user

Data type: String

Defaults to postgres

db_max_idle_connections

Data type: Integer

Defaults to 50

db_max_open_conns

Data type: Integer

Defaults to 100

external_redis

Data type: Boolean

Defaults to false

redis_host

Data type: Stdlib::Host

Defaults to redis

redis_port

Data type: Stdlib::Port

Defaults to 6379

redis_password

Data type: String

Defaults to None

redis_registry_db_index

Data type: Integer

redis_jobservice_db_index

Data type: Integer

redis_chartmuseum_db_index

Data type: Integer

redis_clair_db_index

Data type: Integer

clair_db_host

Data type: Stdlib::Host

Defaults to postgresql

clair_db_password

Data type: String

Defaults to root123

clair_db_port

Data type: Stdlib::Port

Defaults to 5432

clair_db_username

Data type: String

Defaults to postgres

clair_db

Data type: String

Defaults to postgres

clair_updaters_interval

Data type: Integer

uaa_ca_cert

Data type: String

registry_storage_provider_name

Data type: Enum['filesystem','s3','gcs','azure','swift','oss']

registry_storage_provider_config

Data type: String

registry_custom_ca_bundle

Data type: Variant[Stdlib::Absolutepath,String[0,0]]

reload_config

Data type: Variant[Boolean,String[0,0]]

skip_reload_env_pattern

Data type: String

webhook_job_max_retry

Data type: Integer

backup_enabled

Data type: Boolean

Specifies whether to create a backup tar file of the Harbor database if an upgrade is detected Defaults to false

backup_directory

Data type: Stdlib::Absolutepath

Specifies the directory in which to store Harbor backup files Defaults to '/tmp'

Resource types

harbor_project

Manage projects within Harbor

Examples

Creating a project in Harbor
harbor_project { 'my-project':
  ensure  => present,
  public  => 'true',
  members => ['bob', 'alice'],
}

Properties

The following properties are available in the harbor_project type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

public

Valid values: true, false

Whether to mark the project for public access

Default value: false

members

An array of members for the project

Parameters

The following parameters are available in the harbor_project type.

name

namevar

The name of the project

harbor_registry

Manage Harbor registry endpoints

Examples

Creating a registry within Harbor
harbor_registry { 'my-registry':
  ensure         => present,
  url            => 'https://registry.example.org',
  description    => 'Upstream registry',
  set_credential => 'true',
  access_key     => 'admin',
  access_secret  => $encrypted_password,
}

Properties

The following properties are available in the harbor_registry type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

description

Description of the registry

url

The registry URL string

insecure

Valid values: true, false

Whether or not the certificate will be verified when Harbor tries to access the server

Default value: false

Parameters

The following parameters are available in the harbor_registry type.

name

namevar

The registry name

set_credential

Valid values: true, false

Whether to set the credential for the registry

Default value: false

access_key

The access key or username for the registry if using set_credential

access_secret

The secret or password for the registry if using set_credential

harbor_replication_policy

Manage Harbor replication policies

Examples

Creating a replication policy within Harbor
harbor_replication_policy { 'example-replication':
  ensure           => 'present',
  deletion         => false,
  enabled          => true,
  override         => false,
  replication_mode => 'pull',
  remote_registry  => 'UPSTREAM'
  filters          => [{'type' => 'name', 'value' => 'exampleproject/**'}, {'type' => 'tag', 'value' => '*'}],
  trigger          => {type => "scheduled", trigger_settings => {cron => "0 0 15 * * *"}},
}

Properties

The following properties are available in the harbor_replication_policy type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

description

The description of the policy

Default value: ''

dest_namespace

The destination namespace

trigger

Trigger type and trigger settings for policy

filters

The replication policy filter array

deletion

Whether to replicate the deletion operation

override

Whether to override the resources on the destination registry

enabled

Whether the policy is enabled or not

Parameters

The following parameters are available in the harbor_replication_policy type.

name

namevar

The policy name

replication_mode

Valid values: push, pull

The replication policy direction. Can be "push" or "pull"

remote_registry

The name of registry to push to/pull from

harbor_system_label

Manage Harbor system labels

Examples

Creating a system-level label within Harbor
harbor_system_label { 'foo':
  ensure      => 'present',
  description => "Black text on white background label",
  color       => '#FFFFFF',
}

Properties

The following properties are available in the harbor_system_label type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

description

The description of label

Default value: ''

color

The color of label

Default value: #FFFFFF

Parameters

The following parameters are available in the harbor_system_label type.

name

namevar

The name of label

harbor_user_settings

Manage Harbor system configuration settings

Examples

Set LDAP configuration settings within Harbor
harbor_user_settings { 'ldap_settings':
  auth_mode      => 'ldap_auth',
  ldap_url       => 'ldap://example.org',
  ldap_base_dn   => 'dc=example,dc=org',
  ldap_search_dn => '<ldap_bind_user>',
}

Properties

The following properties are available in the harbor_user_settings type.

auth_mode

Valid values: db_auth, ldap_auth, uaa_auth, oidc_auth

The auth mode of current system, such as "db_auth", "ldap_auth"

Default value: db_auth

email_from

The sender name for Email notification

Default value: admin [email protected]

email_host

The hostname of SMTP server that sends Email notification

Default value: smtp.mydomain.com

email_port

The port of SMTP server

Default value: 25

email_identity

By default it is empty so the email_username is picked

email_username

The username for authentication against SMTP server

Default value: [email protected]

email_ssl

Valid values: true, false

When set to true the system will access Email server via TLS by default. If set to false, it still will handle "STARTTLS" from server side

Default value: false

email_insecure

Valid values: true, false

Whether or not the certificate will be verified when Harbor tries to access the email server

Default value: false

ldap_url

The URL of LDAP server

ldap_base_dn

The Base DN for LDAP binding

ldap_filter

The filter for LDAP binding

ldap_scope

Valid values: 0, 1, 2

The scope to search ldap. "0-LDAP_SCOPE_BASE, 1-LDAP_SCOPE_ONELEVEL, 2-LDAP_SCOPE_SUBTREE"

Default value: 2

ldap_uid

The attribute which is used as identity for the LDAP binding, such as "CN" or "SAMAccountname"

Default value: cn

ldap_search_dn

The DN of the user to do the search

ldap_timeout

Timeout in seconds for connection to LDAP server

Default value: 5

ldap_group_attribute_name

Valid values: cn, gid

The attribute which is used as identity of the LDAP group, default is cn

ldap_group_base_dn

The base DN to search LDAP group

ldap_group_search_filter

The filter to search the ldap group

ldap_group_search_scope

Valid values: 0, 1, 2

The scope to search ldap groups. "0-LDAP_SCOPE_BASE, 1-LDAP_SCOPE_ONELEVEL, 2-LDAP_SCOPE_SUBTREE"

Default value: 2

ldap_group_admin_dn

Specify the ldap group which have the same privilege with Harbor admin

project_creation_restriction

Valid values: everyone, adminonly

This attribute restricts what users have the permission to create project. It can be "everyone" or "adminonly"

Default value: everyone

read_only

Valid values: true, false

"docker push" is prohibited by Harbor if set to true

Default value: false

self_registration

Valid values: true, false

Whether the Harbor instance supports self-registration. If set to false, admin needs to add user to the instance

Default value: true

token_expiration

The expiration time of the token for internal Registry, in minutes

Default value: 30

Parameters

The following parameters are available in the harbor_user_settings type.

name

namevar

Arbitrary name for the group of settings controlled in the resource