forked from pivotal-cf/docs-tas-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuring-image-registries.html.md.erb
220 lines (165 loc) · 8.51 KB
/
configuring-image-registries.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
210
211
212
213
214
215
216
217
218
219
220
---
title: Configuring Your App Image Registry
owner: Tanzu Application Service Release Engineering
---
This topic describes how to configure Tanzu Application Service for Kubernetes (TAS for Kubernetes)
to access container image registries,
and how to create and configure a new private registry
for TAS for Kubernetes.
## <a id='overview'></a>Overview
TAS for Kubernetes 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.
<p class="note"><strong>Note:</strong> The YAML files in this topic use
<code>ytt</code> syntax in their first line.
For more information about <code>ytt</code>, see <a href="https://get-ytt.io/">ytt</a>.
</p>
## <a id='prerequisites'></a>Prerequisites
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.
## <a id='configure-app-registry'></a> Configure a Harbor Container Image Registry
TAS for Kubernetes retains system component container images
in a private container image registry. VMware recommends that you use a VMware Harbor registry
as your container image registry.
To configure a container image registry for Tanzu Application Services for Kubernetes:
* Configure a Harbor registry:
1. [Create a Harbor Project and User Account](#harbor-project-user)
1. [Configure the Harbor Project](#harbor-project-configure)
1. [Retrieve the Harbor CA Certificate](#harbor-ca-cert)
1. [Create the Configuration File](#harbor-config-file)
* Configure a different type of registry:
[Create the Configuration File for a Different Image Registry]
(#configure-other-registry)
### <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 TAS for Kubernetes 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 names when configuring the
<code>app-registry-values.yml</code> file. See <a href="#harbor-config-file">
Create the Image Registry Configuration File</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
TAS for Kubernetes 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 TAS for Kubernetes. See
[Create the Harbor Image Registry Configuration File](#harbor-config-file), below.
### <a id='harbor-config-file'></a> Create the Harbor Image Registry Configuration File
To configure TAS for Kubernetes to use your private container image registry:
1. Change directory into the `configuration-values` directory you created earlier.
1. Create a file named `app-registry-values.yml` in the `configuration-values` directory.
1. Populate the `configuration-values` file with the following:
```yaml
#@data/values
---
app_registry:
ca: |
-----BEGIN CERTIFICATE-----
CA-CERTIFICATE-CONTENT
-----END CERTIFICATE-----
#@library/ref "@github.com/cloudfoundry/cf-for-k8s"
#@data/values
---
app_registry:
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.
1. After creating the image registry configuration file, proceed to the
[Installing Tanzu Application Service for Kubernetes](installing-tas-for-kubernetes.html) topic.
### <a id='configure-other-registry'></a> Create the Configuration File for a Different Image Registry
In addition to supporting a VMware Harbor registry as a container image registry,
TAS for Kubernetes also supports using other container image
registries, such as a Google Container Registry (GCR) or Docker Hub registry.
To use a container image registry other than a Harbor registry:
1. Change directory into the `configuration-values` directory you created earlier.
1. Create a file named `app-registry-values.yml` in the `configuration-values` directory.
1. Populate the `configuration-values` file with the following:
```yml
#@data/values
---
app_registry:
ca: |
-----BEGIN CERTIFICATE-----
CA-CERTIFICATE-CONTENT
-----END CERTIFICATE-----
#@library/ref "@github.com/cloudfoundry/cf-for-k8s"
#@data/values
---
app_registry:
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 TAS for Kubernetes
project within your registry.
* `APP-REGISTRY-USERNAME` is the username for an account with access to the
TAS for Kubernetes project within your registry.
* `APP-REGISTRY-PASSWORD` is the password for the specified account.
1. Save the file.
1. After creating the image registry configuration file, proceed to the
[Installing Tanzu Application Service for Kubernetes](installing-tas-for-kubernetes.html) topic.