-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathconfiguring-app-image-registry.html.md.erb
209 lines (152 loc) · 8.24 KB
/
configuring-app-image-registry.html.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
---
title: Configuring Your App Image Registry
owner: Tanzu Application Service Release Engineering
---
This topic describes how to configure <%= vars.app_runtime_full %> (<%= vars.app_runtime_short %>)
to access container image registries,
and how to create and configure a new private registry
for <%= vars.app_runtime_short %>.
## <a id='overview'></a>Overview
<%= vars.app_runtime_short %> pulls system component container images
from the [VMware Tanzu Network container registry](https://registry.pivotal.io/),
and retains those images in a private container image registry.
Before you begin this procedure, ensure that you have
created a private container image registry. VMware recommends that you use a VMware Harbor registry
as your container image registry.
To use a VMware Harbor registry as your container image registry,
complete the procedures in [Use Harbor as Your Application Image Registry](#configure-harbor-registry) below.
To use a different registry as your container image registry,
complete the procedures in [Use a Different Image Registry](#configure-other-registry) below.
## <a id='configure-harbor-registry'></a> Use Harbor as Your Application Image Registry
To use a VMware Harbor registry as your container image registry:
* [Create a Harbor Project and User Account](#harbor-project-user)
* [Configure the Harbor Project](#harbor-project-configure)
* [Retrieve the Harbor CA Certificate](#harbor-ca-cert)
* [Configure the App Image Registry](#harbor-config-file)
### <a id='harbor-project-user'></a> Create a Harbor Project and User Account
Harbor requires that your create a Harbor project before pushing container images
to Harbor.
To create a Harbor project for your <%= vars.app_runtime_short %> container images:
1. Open your browser and navigate to your Harbor registry.
```
https://HARBOR-FQDN/
```
Where `HARBOR-FQDN` is the fully qualified domain name for your Harbor installation.
1. Log in with your Harbor administrative credentials.
1. Create a new Harbor user named `tas-app-images-push-pull`.
You must provide a username and password to create the account.
For more information, see [Create a new user]
(https://goharbor.io/docs/1.10/administration/managing-users/create-users-db/)
in the Harbor documentation.
1. Create a new Harbor project named `tas-app-images`.
For more information, see [Create a new private project]
(https://goharbor.io/docs/1.10/working-with-projects/create-projects/)
in the Harbor documentation.
<p class="note"><strong>Note:</strong>
If you specify custom project and user names in the
Harbor configuration procedure above, use the same project and user names when configuring the
<code>values.yml</code> file. For more information, see <a href="#harbor-config-file">
Configure the App Image Registry</a> below.
</p>
### <a id='harbor-project-configure'></a> Configure the Harbor Project
To grant your Harbor user account permissions to your Harbor project:
1. Open your Harbor registry in a browser, and open the **Projects** list.
1. Click the `tas-app-images` project in the Projects list,
and select the **Members** tab.
1. Click the **+ USER** button to open the **New Member** dialog box.
1. In the **Name** field, enter `tas-app-images-push-pull`.
1. In the **Role** field, select the **Master** option.
1. Click **OK** to add the user to your Harbor project.
For more information on the Harbor `Master` role, see
[Managing Users](https://goharbor.io/docs/1.10/administration/managing-users/)
in the Harbor documentation.
### <a id='harbor-ca-cert'></a> Retrieve the Harbor CA Certificate
<%= vars.app_runtime_short %> must use your
Harbor registry's CA certificate or self-signed certificate
to access the registry.
<p class="note"><strong>Note:</strong>
If you did not use the Ops Manager tile to deploy your Harbor installation,
contact your Harbor installation administrator to obtain the CA certificate
that issued the Harbor certificate.
</p>
To retrieve the CA certificate or self-signed certificate from an
Ops Manager-deployed Harbor tile:
1. Log in to Ops Manager as an administrative user and navigate to the **Installation Dashboard**.
1. Click the **VMware Harbor Registry** tile.
1. Navigate to the **Certificate** configuration pane and
scroll down to the **Certificate Authority (CA)** field.
1. Copy the CA certificate:
* If the **Certificate Authority (CA)** field contains a PEM-encoded certificate value,
copy this value.
* If the **Certificate Authority (CA)** field is blank, the certificate for the Harbor installation was
likely issued from the Ops Manager root CA certificate.
<br>
To download the Ops Manager root CA certificate:
1. In the upper upper-right corner of the Ops Manager user interface, click the drop-down with your user name.
1. Click **Settings**.
1. In the **Settings** page, click **Advanced Options**.
1. In the **Advanced Options** pane, click the **DOWNLOAD ROOT CA CERT** button.
1. Use the retrieved CA certificate as the certificate authority value when
configuring <%= vars.app_runtime_short %>. For more information, see
[Create the Harbor Image Registry Configuration File](#harbor-config-file) below.
### <a id='harbor-config-file'></a> Configure the App Image Registry
To configure <%= vars.app_runtime_short %> to use your private container image registry:
1. Change directory into the `configuration-values` directory you created earlier, and open the `values.yml` file in the `configuration-values` directory.
1. Populate the `app_registry` section of the file with the following:
```yaml
app_registry:
ca: |
-----BEGIN CERTIFICATE-----
CA-CERTIFICATE-CONTENT
-----END CERTIFICATE-----
hostname: "HARBOR-FQDN"
repository_prefix: "HARBOR-FQDN/tas-app-images"
username: "tas-app-images-push-pull"
password: "APP-REGISTRY-PASSWORD"
```
Where:
* `HARBOR-FQDN` is the fully qualified domain name for your Harbor installation.
* `APP-REGISTRY-PASSWORD` is the password you submitted for the `tas-app-images-push-pull` user.
* `CA-CERTIFICATE-CONTENT` is the CA certificate or self-signed certificate for your Harbor
registry. Ensure each line of the CA certificate value is indented four spaces,
matching the indentation of the `BEGIN CERTIFICATE` and `END CERTIFICATE` lines above.
1. Save the file.
## <a id='configure-other-registry'></a> Use a Different Image Registry
In addition to supporting a VMware Harbor registry as a container image registry,
<%= vars.app_runtime_short %> also supports using other container image registries.
To use Google Container Registry (GCR), Docker Hub, or another registry as your <%= vars.app_runtime_short %> container image registry:
1. Change directory into the `configuration-values` directory you created earlier.
1. Open the `values.yml` file.
1. Populate the `app_registry` section with the following:
```yaml
app_registry:
ca: ""
hostname: "HOST-FQDN"
repository_prefix: "REPOSITORY"
username: "APP-REGISTRY-USERNAME"
password: "APP-REGISTRY-PASSWORD"
```
Where:
* `HOST-FQDN` is the fully qualified domain name for your registry.
* `REPOSITORY` is the full URL for the <%= vars.app_runtime_short %>
project within your registry.
* `APP-REGISTRY-USERNAME` is the username for an account with access to the
<%= vars.app_runtime_short %> project within your registry.
* `APP-REGISTRY-PASSWORD` is the password for the specified account.
1. (Optional) To specify a CA certificate for the registry, replace the empty `ca:` property with the following:
```
ca: |
-----BEGIN CERTIFICATE-----
CA-CERTIFICATE-CONTENT
-----END CERTIFICATE-----
```
Where `CA-CERTIFICATE-CONTENT` is the CA certificate or self-signed certificate for your
registry. Ensure each line of the CA certificate value is indented four spaces,
matching the indentation of the `BEGIN CERTIFICATE` and `END CERTIFICATE` lines above.
<br>
Specifying a CA certificate is required if your registry does not have a
certificate signed by a trusted authority.
1. Save the file.
## <a id="next"></a> Next Steps
After you complete this procedure, proceed to
[Configuring System Image Registry](configuring-sys-image-registry.html).