You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These updates are reflected in the revised *Harbor* Helm charts, available in the *GitHub* repository [*pcai-helm-examples*](https://github.com/GuopingJia/pcai-helm-examples/tree/main/harbor). With these customizations, *Harbor* can be seamlessly deployed into PCAI using the *Import Framework*:
59
+
These updates are implemented in the revised *Harbor* Helm charts, available in the *GitHub* repository [*pcai-helm-examples*](https://github.com/GuopingJia/pcai-helm-examples/tree/main/harbor). With these customizations, *Harbor* can be seamlessly deployed into PCAI using the *Import Framework*:
60
60
61
61

62
62
63
63
### Harbor UI access via its endpoint
64
64
65
-
After *Harbor* is installed through PCAI *Import Framework*, an **Imported***Harbor* tile is added to *Tools & Frameworks*, under *Data Science* tab. A virtual service endpoint, e.g., *https://harbor.ingress.pcai0104.ld7.hpecolo.net*, has been configured and exposed for *Harbor* access.
65
+
After *Harbor* is deployed via the PCAI *Import Framework*, an **Imported***Harbor* tile appears under *Tools & Frameworks* on the *Data Science* tab. A virtual service endpoint, e.g., *https://harbor.ingress.pcai0104.ld7.hpecolo.net*, is automatically configured and exposed, providing access to *Harbor*.
66
66
67
67

68
68
69
-
Simply clicking*Open* button, or copying the endpoint URL to the browser, the *Harbor* login page shows up in a new window:
69
+
Click the*Open* button, or paste the endpoint URL into your browser, to launch the *Harbor* login page:
70
70
71
71

72
72
73
-
Using the default Harbor *admin* user credentials, you can log into *Harbor* projects page:
73
+
From there, you can log into *Harbor* projects page using the default *admin* user credentials:
74
74
75
75

76
76
77
77
### Harbor project and user creation
78
78
79
-
*Harbor* manages container images through projects. A project contains all image repositories of an application. Images cannot be pushed to *Harbor* before a project is created. By default, there is a public project *library* pre-created. You can create your project by clicking *+ NEW PRORJECT*:
79
+
*Harbor* manages container images through projects, each of which hosts the image repositories for your application. Before pushing images to *Harbor*, a project must first be created. A defaultpublic project named *library*is pre-created, but new projects can be created by clicking *+ NEW PRORJECT*:
80
80
81
81

82
82
83
-
You should always create a private project to restrict any user to pull images from the *Harbor* project. The private project *demo* is created using the default unlimited (**-1**) quota. However, you can add quota, e.g., *500G*, to limit project usage of registry capacity, in your production setup.
83
+
For security, it's recommended to create *private* projects to restrict unauthorized images pulls. In this blog post, a private project named *demo* is created with an unlimited quota (**-1**). In production environments, setting a defined quota, e.g., *500G*, can help manage registry storage usage.
84
84
85
-
You can then create users and add them as the members to a project using RBAC.
85
+
Next, users can be created and assigned to projects using role-based access control (RBAC).
86
86
87
-
In this section, two users, *pcai-developer*, & *pcai-admin*, are created:
87
+
Two users, *pcai-developer*, & *pcai-admin*, are created:
88
88
89
89

90
90
91
-
In addition to the default admin user, these two newly created users have been added as members to the project *demo* with the role *Developer* and *Maintainer*, respectively. The user *pcai-developer* has read and write privileges for the project, while *pcai-admin* has elevated permissions including the ability to scan images, view replication jobs and delete images.
91
+
These users, along with the default *admin* user, are added to the project *demo* with distinct roles:
92
+
**pcai-developer* has **Developer** role (with read/write access to project)
93
+
**pcai-admin* is assigned the **Maintainer** role, with extended privileges including image scanning, replication job visibility and image deletion
92
94
93
95

94
96
95
-
Please refer to [Harbor Managing Users](https://goharbor.io/docs/2.13.0/administration/managing-users/) for the detailed permissions in each role. As a best practice in production environment, it’s highly recommended to set up users with different role assignments in *Harbor*.
97
+
For a detailed breakdown of each role's capabilities, refer to the official [Harbor Managing Users page](https://goharbor.io/docs/2.13.0/administration/managing-users/). As a best practice, production deployments should enforce role separation to maintain security and operational clarity in *Harbor*.
96
98
97
99
### Pushing Images to Harbor Registry
98
100
99
-
With the project and users created, you can now push the container images using the following steps:
101
+
With the project and users set up, you're ready to push the container images to *Harbor* by following these steps:
100
102
101
-
**Log into Harbor registry*
103
+
**Log in to Harbor registry*
102
104
103
-
Log into *Harbor* registry from the Docker client by running the command using the user *pcai-admin* credentials:
105
+
Use the Docker client to authenticate with the *Harbor* registry using the *pcai-admin*user credentials, by running the following command :
If you get any certificate error when trying to log in from your Linux client, you can edit the file */etc/docker/daemon.json*to add the line below, by replacing the *Harbor* registry URL with your own one.
119
+
If you get any certificate error when logging in from a Linux client, update the file */etc/docker/daemon.json*by adding the following entry, replacing the *Harbor* registry URL with your own:
You need to run *'systemctl daemon-reload'* and restart the *docker* service after you edit the file */etc/docker/daemon.json*.
127
+
After making this change, reload the daemon and resart the Docker service:
128
+
129
+
```shell
130
+
$ sudo systemctl daemon-reload
131
+
$ sudo systemctl restart docker
132
+
```
126
133
127
134
**Tag an existing image*
128
135
129
-
Instead of building a Docker image using a Dockerfile, we pull a sample nginx image, *'pcaidemo/cfe-nginx'*, from *DockerHub* and tag it with the *Harbor* registry URL and project name:
136
+
Rather than building a Docker image from a Dockerfile, we'll pull the sample CFE Nginx image, *'pcaidemo/cfe-nginx'*, from *DockerHub* and tag it with the *Harbor* registry URL and project name:
The image *cfe-nginx*is showing up under *Repositories* tab of the *harbor* project*demo*:
170
+
From the *Harbor* UI, the image *cfe-nginx*appears under *Repositories* tab of the *demo* project:
164
171
165
172

166
173
167
-
Log into *Harbor* registry as the user *pcai-developer*, then pull the image from the harbor registry:
174
+
Log in to the *Harbor* registry as the *pcai-developer* user, then pull the image *cfe-nginx*from the registry. The image downloads successfully, confirming that the user has appropriate access and the *Harbor*registry is functioning as expected.
With images being pushed to *Harbor* registry, let’s try to deploy the application to PCAI using the same *Import Framework* and demonstrate pulling images from the *Harbor* registry.
209
+
With the container images pushed to the *Harbor* registry, the next step is to deploy the application to PCAI using the same *Import Framework*, demonstrating how to pull images from *Harbor*.
203
210
204
-
The Helm charts of the sample Nginx application has been available from GitHub repository [nginx-chart](https://github.com/GuopingJia/pcai-helm-examples/tree/main/nginx-chart). In addition to the *virtualService* and Kyverno *ClusterPolicy* YAML manifest files, the *values.yaml* of the sample Helm charts includes the *imageCredentials* section to provide the *Harbor* access credentials for the user *pcai-developer*. The *imagePullSecrets* uses the Secret resource *harbor*, which is created as part of deployment, for
205
-
for pulling images from *Harbor* registry.
211
+
The Helm charts of the sample Nginx application are available from GitHub repository [pcai-helm-examples](https://github.com/GuopingJia/pcai-helm-examples/tree/main/nginx-chart). Alongside the required *virtualService* and Kyverno *ClusterPolicy* YAML files, the *values.yaml* file includes the *imageCredentials* section that specifies the *Harbor* access credentials for the *pcai-developer* user. It also references the *imagePullSecrets* field that uses the Secret resource *harbor*, which is created during deployment, to securely pull container images from the *Harbor* registry.
Using this sample Helm charts, the CFE Nginx application can be easily deployed to PCAI using the *Import Framework*. An **Imported***Nginx* tile shows up under *Tools & Framework*, with its virtual service endpoint:
230
+
Using the provided sample Helm charts, the CFE Nginx application can be easily deployed to PCAI via the *Import Framework*. After deployment, an **Imported***Nginx* tile appears under *Tools & Framework*, along with its configured virtual service endpoint:
225
231
226
232

227
233
228
-
By clicking*Open* button, you land to the CFE Nginx page:
234
+
Clicking the*Open* button launches the CFE Nginx main page:
229
235
230
236

231
237
232
-
The CFE Nginx application is deployed to the namespace *nginx* in the K8s cluster. If you have access to the cluster, type the following command to see the deployment:
238
+
The CFE Nginx application is deployed to the namespace *nginx* in the K8s cluster. If you have access to the cluster, you can verify the deployment by running the following command:
233
239
234
240
```shell
235
241
# kubectl get all -n nginx
@@ -246,14 +252,14 @@ NAME DESIRED CURRENT READY AGE
246
252
replicaset.apps/nginx-chart-546476cd99 1 1 1 6s
247
253
```
248
254
249
-
From the namespace *nginx*, the secrete *harbor*with the type *dockerconfigjson* is created. This secret is used when pulling the image from the *Harbor* registry’s private project *demo*during CFE Nginx application deployment:
255
+
Within the *nginx* namespace , a *harbor*secret of type *dockerconfigjson* is created. This secret is used to authenticate and pull images from the *demo*’ private project in the *Harbor* registry during the deployment of the CFE Nginx application:
250
256
251
257
```shell
252
258
# kubectl get secret harbor -n nginx
253
259
NAME TYPE DATA AGE
254
260
harbor kubernetes.io/dockerconfigjson 1 3m41s
255
261
```
256
-
Type the following command, you can see the image *cfe-nginx*with tag*v0.1.0* is pulling from the *Harbor* registry:
262
+
Type the following command to observe the *cfe-nginx*image, tagged*v0.1.0*, being pulled from the *Harbor* registry:
257
263
258
264
```shell
259
265
[root@ez-master01 ~]# k describe pod/nginx-chart-546476cd99-2nqzz -n nginx
@@ -274,7 +280,7 @@ Events:
274
280
Normal Created 2m16s kubelet Created container nginx-chart
275
281
Normal Started 2m16s kubelet Started container nginx-chart
276
282
```
277
-
The *Logs* page of *Harbor*registry contains all the audit logs about project and user creation, image push and pull operations, etc.
283
+
The *Logs* page of the *Harbor*UI provides a comprehensive audit trail, capturing key activities such as project and user creation, as well as image push and pull operations:
0 commit comments