forked from goharbor/harbor-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc(tutorial): draft tutorial doc (goharbor#580)
- complete tutorial - complete cluster deletion - add doc placeholders for backup data - add doc placeholder for upgrade cluster - add doc placeholder for monitor logs - add one more sample manifest for deploying full harbor with all external services Signed-off-by: Steven Zou <[email protected]>
- Loading branch information
1 parent
ffc42e9
commit 157bf76
Showing
15 changed files
with
742 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Backup data | ||
|
||
The documentations shown here talk about how to backup the related data created and used by the corresponding in-cluster services such as `PostgreSQL`, `Redis` and `Minio`. For the case of using existing external dependent services, it is not covered by this document. | ||
|
||
You can follow the guides to backup your data regularly for data protection or only backup data before upgrading or deleting your Harbor cluster. | ||
|
||
## Backup data of in-cluster PostgrSQL | ||
|
||
You can check the data backup guideline for [PostgreSQL](./backup-psql-data.md). | ||
|
||
## Backup data of in-cluster Redis | ||
|
||
You can check the data backup guideline for [Redis](./backup-redis-data.md). | ||
|
||
## Backup data of in-cluster Minio | ||
|
||
You can check the data backup guideline for [Minio](./backup-minio-data.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Backup Minio data | ||
|
||
Documentation shown here guides you how to backup the Minio data. | ||
|
||
TBD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Backup Postgresql data | ||
|
||
Documentation shown here guides you how to backup the psql database data. | ||
|
||
TBD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Backup Redis data | ||
|
||
Documentation shown here guides you how to backup the Redis data. | ||
|
||
TBD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# Harbor cluster controller | ||
|
||
Cluster operator is responsible for controlling the reconciling process of CR `HarborCluster` that is a top level resource owning the `Harbor` CR and the CRs of Harbor's dependent services. Its primary flow is apply the `Harbor` CR and start `Harbor` CR's reconciling process when the related dependent services CR required in the spec are ready. The apply processes of the related dependent services CR are handled in a concurrent way. | ||
|
||
## Resource status | ||
|
||
Combination of the conditions that indicates the status of `Harbor` as well as status of its dependent service CRs such as `postgresql`, `redisfailover` and minio `tenant` leads to the current state of the `HarborCluster` resource. | ||
|
||
### Conditions | ||
|
||
Here are the conditions involved in the status combination process: | ||
|
||
| Condition | Description | | ||
|----------------|---------------| | ||
| `StorageReady` | in-cluster storage minio service is ready | | ||
| `DatabaseReady` | in-cluster database postgresql is ready | | ||
| `CacheReady` | in-cluster cache redis is ready | | ||
| `ServiceReady` | the harbor is ready | | ||
|
||
> NOTE: condition `ConfigurationReady` indicates if the cfgMap based Day2 configuration has been successfully applied. But it does not take account into the combination of the overall status. | ||
### Overall status | ||
|
||
The overall status dimensions and the conditions of its establishment is listed in the table shown below: | ||
|
||
| Status | Conditions | | ||
|-------------|------------| | ||
| `healthy` | 4 conditions are all `True` | | ||
| `unhealthy` | at least one of the 4 conditions is `False` | | ||
| `creating` | Otherwise | | ||
|
||
## Reconcile loop | ||
|
||
The reconcile loop is triggered by a Kubernetes event when the `HarborCluster` Resource or relevant resources owned by that `HarborCluster` changes. | ||
|
||
```text | ||
Event received +----------------------+ | ||
------------------->| Reconcile | | ||
+----------+-----------+ | ||
| | ||
| True | ||
Deleted? ------------>Exit | ||
| | ||
| | ||
v | ||
Start service deploy group | ||
+-------------------------------+----------------------------+ | ||
| | | | ||
| | | | ||
| | | | ||
+----------------v---------------+ +-----------+-----------+ +-----------v---------+ | ||
| PostgreSQL Reconcile | | Redis Reconcile | | Minio Reconcile | | ||
+----------------+---------------+ +-----------+-----------+ +-----------+---------+ | ||
| | | | ||
| | | | ||
| | | | ||
| | | | ||
v v v | ||
Apply or update Apply or update Apply or update | ||
| | | | ||
| | | | ||
| | | | ||
| | | | ||
| v | | ||
+--------------------> Any error occurred?<------------------+ | ||
| | | ||
| NO | YES | ||
| +----------------------------> Exit | ||
| | | ||
v NO | | ||
All services are ready?------------------> Exit | | ||
| | | | ||
| YES | | | ||
| | | | ||
| | | | ||
v | | | ||
+----------------------+ | | | ||
| Harbor Reconcile | | | | ||
+----------+-----------+ | | | ||
| | | | ||
| | | | ||
| | | | ||
v | | | ||
Apply or update? | | | ||
| | | | ||
| | | | ||
| | | | ||
| | | | ||
v YES | | | ||
Any error occurred? -----------> Exit | | | ||
| | | | | ||
| | | | | ||
| NO | | | | ||
| | | | | ||
v | | | | ||
Completed | | | | ||
| | | | | ||
| | | | | ||
| | | | | ||
| | | | | ||
+--------------+--------------+ | | | | ||
| Set status & conditions <---------+-------+-----+ | ||
+-----------------------------+ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,29 @@ | ||
# Delete the Harbor cluster | ||
|
||
[backup data](./backup-data.md) before deletion. | ||
For deleting the deployed Harbor cluster, one important thing to note here is, you should make sure all your data is correctly [backup](./backup-data.md) before deletion if you cares about your data (not development or testing environments). | ||
|
||
TBD | ||
## Delete the Harbor cluster CR | ||
|
||
You can delete your Harbor cluster by deleting the CR with `kubectl`: | ||
|
||
```shell | ||
# Replace the text between <> with the real ones. | ||
kubectl delete HarborCluster/<myClusterName> -n <myNamespace> | ||
|
||
# e.g: | ||
# kubectl delete HarborCluster/harbor-cluster-sample -n sample | ||
``` | ||
|
||
> NOTE: the command shown above will delete the Harbor cluster as well as all the associated resources (including all the PVs) except the ones pre-created such as namespace, root password or cert-manager issuer etc. | ||
## Delete by manifest | ||
|
||
The Harbor cluster can also be deleted via the deployment manifests that may be either the manifest yaml file or the kustomization template file. With this way, both the associated resources and the resources pre-defined in the manifest like namespace, root password or cert-manager issuer etc. can be cleaned up at the same time. | ||
|
||
```shell | ||
# With deployment manifest | ||
kubectl delete -f my-deployment.yaml | ||
|
||
# OR with kustomization template | ||
kustomize build | kubectl delete -f - | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Monitor logs with grafana | ||
|
||
TBD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# How to upgrade your Harbor cluster | ||
|
||
TBD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.